Skip to content

Commit eb67ba0

Browse files
ritvickdeepy
authored andcommitted
Support for AIX OS on ppc64
1 parent 76a5e30 commit eb67ba0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ internal enum class OsType(val osName: String) {
88
LINUX("linux"),
99
FREEBSD("linux"), // https://github.com/node-gradle/gradle-node-plugin/issues/178
1010
SUN("sunos"),
11+
AIX("aix"),
1112
}
1213

1314
internal fun parsePlatform(type: OsType, arch: String, uname: () -> String): Platform {
@@ -24,6 +25,7 @@ internal fun parseOsType(type: String): OsType {
2425
name.contains("linux") -> OsType.LINUX
2526
name.contains("freebsd") -> OsType.FREEBSD
2627
name.contains("sunos") -> OsType.SUN
28+
name.contains("aix") -> OsType.AIX
2729
else -> error("Unsupported OS: $name")
2830
}
2931
}
@@ -39,6 +41,7 @@ fun parseOsName(name: String): String {
3941
name.contains("linux") -> "linux"
4042
name.contains("freebsd") -> "linux"
4143
name.contains("sunos") -> "sunos"
44+
name.contains("aix") -> "aix"
4245
else -> error("Unsupported OS: $name")
4346
}
4447
}
@@ -52,6 +55,7 @@ fun parseOsArch(arch: String, uname: Callable<String>): String {
5255
arch == "arm" || arch.startsWith("aarch") -> uname.call()
5356
.mapIf({ it == "armv8l" || it == "aarch64" }) { "arm64" }
5457
.mapIf({ it == "x86_64" }) {"x64"}
58+
arch == "ppc64" -> "ppc64"
5559
arch == "ppc64le" -> "ppc64le"
5660
arch == "s390x" -> "s390x"
5761
arch.contains("64") -> "x64"

src/test/groovy/com/github/gradle/node/util/PlatformHelperTest.groovy

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class PlatformHelperTest extends Specification {
2828
'Linux' | 's390x' || 'linux' | 's390x' | false
2929
'SunOS' | 'x86' || 'sunos' | 'x86' | false
3030
'SunOS' | 'x86_64' || 'sunos' | 'x64' | false
31+
'AIX' | 'ppc64' || 'aix' | 'ppc64' | false
3132
}
3233

3334
@Unroll

0 commit comments

Comments
 (0)