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 {
2424 */
2525 arch == " arm" || arch.startsWith(" aarch" ) -> property(" uname" )
2626 .mapIf({ it == " armv8l" || it == " aarch64" }) { " arm64" }
27+ .mapIf({ it == " x86_64" }) {" x64" }
2728 arch == " ppc64le" -> " ppc64le"
2829 arch == " s390x" -> " s390x"
2930 arch.contains(" 64" ) -> " x64"
Original file line number Diff line number Diff line change @@ -58,6 +58,25 @@ class PlatformHelperTest extends Specification {
5858 ' ppc64le' | ' ppc64le' | ' ppc64le'
5959 }
6060
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+
6180 def " throw exception if unsupported os" () {
6281 given :
6382 this . props. setProperty(" os.name" , ' Nonsense' )
You can’t perform that action at this time.
0 commit comments