File tree 2 files changed +15
-4
lines changed
lib-extra/src/main/java/com/diffplug/spotless/extra/npm
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ protected File nodeModulePath() {
92
92
}
93
93
94
94
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" ;
96
96
}
97
97
98
98
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() {
43
43
throw new RuntimeException ("Cannot handle os " + osNameProperty );
44
44
}
45
45
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 );
49
60
}
50
61
}
You can’t perform that action at this time.
0 commit comments