-
Notifications
You must be signed in to change notification settings - Fork 408
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
Replace JavaJarExec
with JavaExec
#1197
Conversation
Goooler
commented
Jan 26, 2025
•
edited
Loading
edited
- CHANGELOG's "Unreleased" section has been updated, if applicable.
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.
Copilot reviewed 2 out of 6 changed files in this pull request and generated no comments.
Files not reviewed (4)
- api/shadow.api: Language not supported
- src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/ApplicationPluginTest.kt: Language not supported
- src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowApplicationPlugin.kt: Language not supported
- src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/JavaJarExec.kt: Language not supported
… mainClass
it.mainClass.set("-jar") | ||
it.classpath(jarFile) | ||
it.mainClass.set(javaApplication.mainClass) |
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.
Set mainClass
from javaApplication.mainClass
instead of -jar
and make sure the jarFile
is in classpath
, so that we can get rid of the args appending logic in
shadow/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/JavaJarExec.kt
Lines 14 to 19 in 4850db3
val allArgs = buildList { | |
add(jarFile.get().asFile.path) | |
// Must cast args to List<String> here to avoid type mismatch. | |
addAll(args as List<String>) | |
} | |
setArgs(allArgs) |
Also, eliminates doFirst
logic in 2900592.
…a-jar-exec // Conflicts: // src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/ApplicationPluginTest.kt
0c4472d
to
6aa5c44
Compare
The newly added test in #1214 passed both before and after this change, so everything looks good. Feel free to have a post review. |