File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
lib-extra/src/main/java/com/diffplug/spotless/extra/npm Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ protected File nodeModulePath() {
9292 }
9393
9494 private String j2v8MavenCoordinate () {
95- return "com.eclipsesource.j2v8:j2v8_" + PlatformInfo .normalizedOSName () + "_" + PlatformInfo .archName () + ":4.6.0" ;
95+ return "com.eclipsesource.j2v8:j2v8_" + PlatformInfo .normalizedOSName () + "_" + PlatformInfo .normalizedArchName () + ":4.6.0" ;
9696 }
9797
9898 protected static String readFileFromClasspath (Class <?> clazz , String name ) {
Original file line number Diff line number Diff line change @@ -43,8 +43,19 @@ static String normalizedOSName() {
4343 throw new RuntimeException ("Cannot handle os " + osNameProperty );
4444 }
4545
46- static String archName () {
47- return Optional .ofNullable (StandardSystemProperty .OS_ARCH .value ())
48- .orElseThrow (() -> new RuntimeException ("Arch not detectable." ));
46+ static String normalizedArchName () {
47+ final String osArchProperty = StandardSystemProperty .OS_ARCH .value ();
48+ if (osArchProperty == null ) {
49+ throw new RuntimeException ("No info about ARCH available, cannot decide which implementation of j2v8 to use" );
50+ }
51+ final String normalizedOsArch = osArchProperty .toLowerCase (Locale .ENGLISH );
52+
53+ if (normalizedOsArch .contains ("64" )) {
54+ return "x86_64" ;
55+ }
56+ if (normalizedOsArch .contains ("x86" ) || normalizedOsArch .contains ("32" )) {
57+ return "x86" ;
58+ }
59+ throw new RuntimeException ("Cannot handle arch " + osArchProperty );
4960 }
5061}
You can’t perform that action at this time.
0 commit comments