Skip to content
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

Merged
merged 8 commits into from
Jan 29, 2025
Merged

Conversation

Goooler
Copy link
Member

@Goooler Goooler commented Jan 26, 2025


  • CHANGELOG's "Unreleased" section has been updated, if applicable.

Sorry, something went wrong.

@Goooler Goooler requested a review from Copilot January 26, 2025 06:30

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
@Goooler Goooler enabled auto-merge (squash) January 26, 2025 06:31
@Goooler Goooler disabled auto-merge January 26, 2025 06:32
Comment on lines -51 to +56
it.mainClass.set("-jar")
it.classpath(jarFile)
it.mainClass.set(javaApplication.mainClass)
Copy link
Member Author

@Goooler Goooler Jan 26, 2025

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

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.

@Goooler
Copy link
Member Author

Goooler commented Jan 26, 2025

@ljacomet Can you take a review for this? I noticed you did some adoption in #576.

…a-jar-exec

// Conflicts:
//	src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/ApplicationPluginTest.kt
@Goooler Goooler force-pushed the g/20250126/remove-java-jar-exec branch from 0c4472d to 6aa5c44 Compare January 29, 2025 02:12
@Goooler Goooler enabled auto-merge (squash) January 29, 2025 02:36
@Goooler Goooler disabled auto-merge January 29, 2025 02:36
@Goooler Goooler enabled auto-merge (squash) January 29, 2025 02:37
@Goooler Goooler merged commit 3663571 into main Jan 29, 2025
7 checks passed
@Goooler Goooler deleted the g/20250126/remove-java-jar-exec branch January 29, 2025 02:41
@Goooler
Copy link
Member Author

Goooler commented Jan 29, 2025

The newly added test in #1214 passed both before and after this change, so everything looks good.

Feel free to have a post review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant