File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
main/kotlin/com/github/gradle/node/util
test/groovy/com/github/gradle/node/util Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ open class PlatformHelper {
24
24
*/
25
25
arch == " arm" || arch.startsWith(" aarch" ) -> property(" uname" )
26
26
.mapIf({ it == " armv8l" || it == " aarch64" }) { " arm64" }
27
+ .mapIf({ it == " x86_64" }) {" x64" }
27
28
arch == " ppc64le" -> " ppc64le"
28
29
arch == " s390x" -> " s390x"
29
30
arch.contains(" 64" ) -> " x64"
Original file line number Diff line number Diff line change @@ -58,6 +58,25 @@ class PlatformHelperTest extends Specification {
58
58
' ppc64le' | ' ppc64le' | ' ppc64le'
59
59
}
60
60
61
+ @Unroll
62
+ def " verify ARM handling Mac OS #archProp (#unameProp)" () {
63
+ given :
64
+ this . props. setProperty(" os.name" , " Mac OS X" )
65
+ this . props. setProperty(" os.arch" , archProp)
66
+ this . props. setProperty(" uname" , unameProp)
67
+
68
+ expect :
69
+ this . helper. getOsName() == " darwin"
70
+ this . helper. getOsArch() == osArch
71
+
72
+ where :
73
+ archProp | unameProp | osArch
74
+ ' aarch32' | ' arm' | ' arm'
75
+ ' aarch64' | ' arm64' | ' arm64'
76
+ ' aarch64' | ' aarch64' | ' arm64'
77
+ ' aarch64' | ' x86_64' | ' x64' // This shouldn't really happen but according to PR #204 it does
78
+ }
79
+
61
80
def " throw exception if unsupported os" () {
62
81
given :
63
82
this . props. setProperty(" os.name" , ' Nonsense' )
You can’t perform that action at this time.
0 commit comments