You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by cc...@apache.org on 2017/12/11 19:25:20 UTC

[06/13] groovy git commit: Re-introduce an `all` module, which is now using `pom` packaging

Re-introduce an `all` module, which is now using `pom` packaging

Unfortunately this doesn't seem to work unless we have at least one artifact.


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/af49c2e7
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/af49c2e7
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/af49c2e7

Branch: refs/heads/master
Commit: af49c2e700641649ad344f9f500bd5ce16d92265
Parents: 9e39eed
Author: Cedric Champeau <cc...@apache.org>
Authored: Sun Dec 10 22:22:51 2017 +0100
Committer: Cedric Champeau <cc...@apache.org>
Committed: Mon Dec 11 19:17:11 2017 +0100

----------------------------------------------------------------------
 gradle/upload.gradle | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/af49c2e7/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 88f5ab6..6078d01 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -143,7 +143,7 @@ allprojects {
 // we don't want them in the root project so add them as artifacts with a modified name
 // we'll exclude the original artifacts during publication with an exclude pattern
 [uploadArchives, install]*.with {
-    dependsOn([sourceJar, javadocJar, groovydocJar, distBin, distDoc, dist, distBin])
+    dependsOn([sourceAllJar, javadocAllJar, groovydocAllJar, distBin, distDoc, dist, distBin])
     doFirst {
         project.artifacts.add('archives', distBin) {
             name = 'groovy-binary'
@@ -197,7 +197,8 @@ ext.pomAll = {
                 !(artifact.name.contains('backport'))
     }
     addFilter('all') { artifact, file ->
-        artifact.name.contains('groovy-all')
+        // add an arbitrary artifact, so that the pom file is generated
+        artifact.name.contains('groovy-binary')
     }
     addFilter('binary') { artifact, file ->
         artifact.name.contains('groovy-binary')
@@ -231,6 +232,25 @@ ext.pomAll = {
         p.dependencies.clear()
     }
 
+    // pom for "all" dependencies
+    def allpom = pom('all', pomConfigureClosureWithoutTweaks)
+    allpom.artifactId = 'groovy-all'
+    allpom.packaging = 'pom'
+    allpom.whenConfigured { p ->
+        // this is the only way to get a handle on `maven.Dependency`
+        def dependencyClass = p.dependencies[0].getClass()
+        p.dependencies.clear()
+        allprojects {
+            if (it.name.startsWith('groovy')) {
+                def dep = dependencyClass.newInstance()
+                dep.groupId = 'org.codehaus.groovy'
+                dep.artifactId = it.name
+                dep.version = version
+                p.dependencies.add(dep)
+            }
+        }
+    }
+
     beforeDeployment { MavenDeployment deployment -> if (isReleaseVersion) signing.signPom(deployment) }
 }