-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check GraalVM version before returning macos/darwin platform. #1123
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ | |
import com.gluonhq.substrate.util.Logger; | ||
import com.gluonhq.substrate.util.ProcessRunner; | ||
import com.gluonhq.substrate.util.Strings; | ||
import com.gluonhq.substrate.util.Version; | ||
|
||
import java.io.BufferedWriter; | ||
import java.io.File; | ||
|
@@ -359,6 +360,14 @@ private String getJniPlatformArg() { | |
|
||
private String getJniPlatform() { | ||
Triplet target = projectConfiguration.getTargetTriplet(); | ||
boolean graalVM221 = false; | ||
try { | ||
Version graalVersion = projectConfiguration.getGraalVersion(); | ||
if ((graalVersion.getMajor() > 21) && (graalVersion.getMinor() >0)) graalVM221 = true; | ||
} catch (IOException ex) { | ||
ex.printStackTrace(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need an stacktrace here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not? This should never happen, so if it happens, we at least need a detailed reason (or we should call System.exit()) |
||
Logger.logSevere("Could not detect GraalVM version, assuming lower than 22.1"); | ||
} | ||
String os = target.getOs(); | ||
String arch = target.getArch(); | ||
switch (os) { | ||
|
@@ -380,7 +389,7 @@ private String getJniPlatform() { | |
} | ||
return "IOS_AARCH64"; | ||
case Constants.OS_DARWIN: | ||
return "DARWIN_AMD64"; | ||
return graalVM221 ? "MACOS_AMD64" : "DARWIN_AMD64"; | ||
case Constants.OS_WINDOWS: | ||
return "WINDOWS_AMD64"; | ||
case Constants.OS_ANDROID: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
if
and assigngraalVM221
directly?