-
Notifications
You must be signed in to change notification settings - Fork 168
fix: export maven/gradle, install runtime wrappers #1991
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
Conversation
This code has been tested to work with Maven and Gradle on Linux and Windows. |
Looks like a good start, but why did you remove the JAR from the resources? |
Encountered a weird issue. File gradle-wrapper.jar (binary file) was not copied to the JBang JAR file, so it could not be read at runtime. Does thiis make any sense? So I reverted to downloading the file at runtime. But would prefer to have it in the JBang JAR if possible. |
Aha, I guess it must be something in the Gradle assembly process that filters out files that it thinks should not be part of the output. |
Just as a test, try renaming the file to give it a different extension from ".jar" and see if that works. |
Renamed it to -jar instead of .jar; and it works fine at runtime. Will update the pull request shortly. |
Ok, good to know, still I'd like to find out how we can get it to work with its original name. |
It might be added to the classpath if it is stored as a .jar file, and then it will be loaded and the classes it contains made available to the JVM. Maybe not what we want. I think it would be fine to keep it as a -jar file, and also simple enough to rename the file when updating it in the future. |
Adding scrupt
|
Created an |
Good enough 👍 |
Done with coding and testing; ready to be reviewed. |
@quintesse , please restart the build. (smile) |
if (isWindows) | ||
return; | ||
|
||
if (execFlag) { |
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.
Ok, everything is perfect for merging, but .... I wonder if you could do me a favor and perform a small refactor: there is already some code in JBang to set a file as executable (See https://github.com/jbangdev/jbang/blob/main/src/main/java/dev/jbang/cli/App.java#L192). Could you perhaps extract that, move it to Util.java (just below the isExecutable() method for example) and make Export use that one as well?
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.
That's a good idea. I'll implement the requested changes.
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.
@quintesse , I tested the refactored code using the new Util.setExecutable() method on Linux and Windows, with Maven and Gradle. All tests were successful.
The build failed again, so when you have a chance please restart it. Thanks.
Thanks for your effort @wfouche ! |
Closes #1987