Skip to content

Commit

Permalink
refactor: name task configuration closure parameters for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
matrei committed Dec 11, 2024
1 parent 4c41a0e commit 3cb7bcc
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,16 @@ class GrailsPluginGradlePlugin extends GrailsGradlePlugin {
}

protected void configurePluginJarTask(Project project) {
project.tasks.named(SpringBootPlugin.BOOT_JAR_TASK_NAME) {
it.enabled = false // Grails Plugins should not produce a bootJar
project.tasks.named(SpringBootPlugin.BOOT_JAR_TASK_NAME) { Task bootJarTask ->
bootJarTask.enabled = false // Grails Plugins should not produce a bootJar
}
project.tasks.named(JavaPlugin.JAR_TASK_NAME, Jar) {
it.enabled = true
it.archiveClassifier.set('') // Remove '-plain' suffix from jar file name
it.exclude('application.yml', 'application.groovy', 'logback.groovy', 'logback.xml')
project.tasks.named(JavaPlugin.JAR_TASK_NAME, Jar) { Jar jarTask ->
jarTask.enabled = true
jarTask.archiveClassifier.set('') // Remove '-plain' suffix from jar file name
jarTask.exclude('application.yml', 'application.groovy', 'logback.groovy', 'logback.xml')
}
project.tasks.named(LifecycleBasePlugin.ASSEMBLE_TASK_NAME) {
it.dependsOn(JavaPlugin.JAR_TASK_NAME) // assemble task should produce the jar artifact
project.tasks.named(LifecycleBasePlugin.ASSEMBLE_TASK_NAME) { Task assembleTask ->
assembleTask.dependsOn(JavaPlugin.JAR_TASK_NAME) // assemble task should produce the jar artifact
}
}

Expand Down

0 comments on commit 3cb7bcc

Please sign in to comment.