Skip to content

Commit

Permalink
Remove duplicate Eclipse .classpath entries in Gradle 5.6+
Browse files Browse the repository at this point in the history
The workaround used in this commit was authored by @marcphilipp for
gradle/gradle#10393.
  • Loading branch information
sbrannen committed Aug 29, 2019
1 parent 51330c3 commit 3e9565a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions buildSrc/src/main/kotlin/java-library-conventions.gradle.kts
@@ -1,3 +1,5 @@
import org.gradle.plugins.ide.eclipse.model.Classpath

plugins {
`java-library`
eclipse
Expand Down Expand Up @@ -31,6 +33,18 @@ sourceSets {
eclipse {
classpath {
plusConfigurations.add(shadowed)

// Workaround for https://github.com/gradle/gradle/issues/10393
file {
whenMerged(Action<Classpath> {
entries = entries.distinctBy {
if (it is org.gradle.plugins.ide.eclipse.model.ProjectDependency)
it.path
else
it
}
})
}
}
}

Expand Down

0 comments on commit 3e9565a

Please sign in to comment.