Skip to content

Commit

Permalink
normalized arch name (matching arch for for ci)
Browse files Browse the repository at this point in the history
  • Loading branch information
simschla committed Aug 26, 2018
1 parent 9067271 commit 53e5ba4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected File nodeModulePath() {
}

private String j2v8MavenCoordinate() {
return "com.eclipsesource.j2v8:j2v8_" + PlatformInfo.normalizedOSName() + "_" + PlatformInfo.archName() + ":4.6.0";
return "com.eclipsesource.j2v8:j2v8_" + PlatformInfo.normalizedOSName() + "_" + PlatformInfo.normalizedArchName() + ":4.6.0";
}

protected static String readFileFromClasspath(Class<?> clazz, String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,19 @@ static String normalizedOSName() {
throw new RuntimeException("Cannot handle os " + osNameProperty);
}

static String archName() {
return Optional.ofNullable(StandardSystemProperty.OS_ARCH.value())
.orElseThrow(() -> new RuntimeException("Arch not detectable."));
static String normalizedArchName() {
final String osArchProperty = StandardSystemProperty.OS_ARCH.value();
if (osArchProperty == null) {
throw new RuntimeException("No info about ARCH available, cannot decide which implementation of j2v8 to use");
}
final String normalizedOsArch = osArchProperty.toLowerCase(Locale.ENGLISH);

if (normalizedOsArch.contains("64")) {
return "x86_64";
}
if (normalizedOsArch.contains("x86") || normalizedOsArch.contains("32")) {
return "x86";
}
throw new RuntimeException("Cannot handle arch " + osArchProperty);
}
}

0 comments on commit 53e5ba4

Please sign in to comment.