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
Refactor Initialization of Configuration File Merger #586
base: master
Are you sure you want to change the base?
Refactor Initialization of Configuration File Merger #586
Conversation
|
||
private void initializeMergerExecutable() throws MojoExecutionException { | ||
Path nativeImage = NativeImageConfigurationUtils.getNativeImage(logger); | ||
File nativeImageExecutable = nativeImage.toAbsolutePath().toFile(); | ||
File mergerExecutable = new File(nativeImageExecutable.getParentFile(), nativeImageConfigureFileName()); |
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.
Use a variable for nativeImageConfigureFileName()
so it's only called once.
throw new MojoExecutionException("'" + nativeImageConfigureFileName() + "' tool was not found in your " + nativeImage + "." + | ||
"This probably means that the JDK at '" + nativeImage + "' is not a GraalVM distribution." |
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.
getNativeImage()
already checks whether native-image
exists, so if native-image-configure
is missing, then it is an incomplete GraalVM distribution. Maybe something like this:
throw new MojoExecutionException("'" + nativeImageConfigureFileName() + "' tool was not found in your " + nativeImage + "." + | |
"This probably means that the JDK at '" + nativeImage + "' is not a GraalVM distribution." | |
throw new MojoExecutionException("'" + nativeImageConfigureFileName() + "' tool was not found in the GraalVM JDK at '" + nativeImageExecutable.getParentFile().getParentFile() + "'." + | |
"This probably means that you are using a GraalVM distribution that is not fully supported by the Native Build Tools." |
Remove macro from merger init and throw better error if executable does not exist