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

Set duplicates strategy for all archive tasks #335

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import org.gradle.api.tasks.JavaExec
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetOutput
import org.gradle.api.tasks.TaskContainer
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.compile.GroovyCompile
import org.gradle.api.tasks.testing.Test
Expand Down Expand Up @@ -143,6 +144,8 @@ class GrailsGradlePlugin extends GroovyPlugin {
configureRunCommand(project)

configurePathingJar(project)

configureArchiveCommands(project)
}

protected void excludeDependencies(Project project) {
Expand Down Expand Up @@ -702,4 +705,11 @@ class GrailsGradlePlugin extends GroovyPlugin {
}
fileCollection
}

protected void configureArchiveCommands(Project project) {
project.tasks.withType(AbstractArchiveTask).configureEach {
// the zip format supports duplicates and gradle implements this feature, so exclude them
it.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
}
Loading