diff options
Diffstat (limited to 'buildSrc')
-rw-r--r-- | buildSrc/build.gradle | 4 | ||||
-rw-r--r-- | buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 874dabc9..b62b4150 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -6,5 +6,5 @@ repositories { maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } } dependencies { - compile 'com.github.jengelman.gradle.plugins:shadow:2.0.1' -}
\ No newline at end of file + compile 'com.github.jengelman.gradle.plugins:shadow:2.0.4' +} diff --git a/buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy b/buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy index 3e1d2106..4f6dcd75 100644 --- a/buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy +++ b/buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy @@ -4,22 +4,23 @@ import org.gradle.api.Project import org.gradle.api.artifacts.ModuleVersionIdentifier import org.gradle.api.artifacts.ProjectDependency import org.gradle.api.artifacts.SelfResolvingDependency -import org.gradle.api.publish.internal.ProjectDependencyPublicationResolver +import org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectDependencyPublicationResolver import org.gradle.api.publish.maven.MavenPom import org.gradle.api.publish.maven.MavenPublication +//https://github.com/johnrengelman/shadow/issues/334 static void configure(MavenPublication publication, Project project) { publication.artifact(project.tasks.shadowJar) + publication.pom { MavenPom pom -> pom.withXml { xml -> def dependenciesNode = xml.asNode().appendNode('dependencies') project.configurations.shadow.allDependencies.each { - //if (! (it instanceof SelfResolvingDependency)) { if (it instanceof ProjectDependency) { - def projectDependencyResolver = project.gradle.services.get(ProjectDependencyPublicationResolver) - ModuleVersionIdentifier identifier = projectDependencyResolver.resolve(it) + final ProjectDependencyPublicationResolver projectDependencyResolver = project.gradle.services.get(ProjectDependencyPublicationResolver) + final ModuleVersionIdentifier identifier = projectDependencyResolver.resolve(ModuleVersionIdentifier, it) addDependency(dependenciesNode, identifier) } else if (!(it instanceof SelfResolvingDependency)) { addDependency(dependenciesNode, it) |