aboutsummaryrefslogtreecommitdiff
path: root/buildSrc/src/main/groovy/org/jetbrains
diff options
context:
space:
mode:
Diffstat (limited to 'buildSrc/src/main/groovy/org/jetbrains')
-rw-r--r--buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy9
1 files changed, 5 insertions, 4 deletions
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)