groovy git commit: GROOVY-8143: Performance subproject included in release artifacts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: GROOVY-8143: Performance subproject included in release artifacts

paulk
Repository: groovy
Updated Branches:
  refs/heads/master 57fb455f5 -> ed091e501


GROOVY-8143: Performance subproject included in release artifacts


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

Branch: refs/heads/master
Commit: ed091e5011458148d9035b72597e167b2d52de49
Parents: 57fb455
Author: paulk <[hidden email]>
Authored: Fri Apr 21 19:47:17 2017 +1000
Committer: paulk <[hidden email]>
Committed: Fri Apr 21 20:39:09 2017 +1000

----------------------------------------------------------------------
 build.gradle          |   8 +--
 gradle/publish.gradle |  45 ++++++++------
 gradle/upload.gradle  | 152 +++++++++++++++++++++++----------------------
 3 files changed, 108 insertions(+), 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/ed091e50/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index a17549f..b5a5f74 100644
--- a/build.gradle
+++ b/build.gradle
@@ -64,6 +64,10 @@ buildScan {
     recipes 'git-status', 'gc-stats', 'teamcity', 'travis-ci'
 }
 
+ext.modules = {
+    subprojects.findAll{ !['performance', 'groovy-tests-vm8'].contains(it.name) }
+}
+
 apply from: 'gradle/filter.gradle'
 apply from: 'gradle/indy.gradle'
 apply from: 'gradle/publish.gradle'
@@ -369,10 +373,6 @@ task ensureGrammars {
 apply from: 'gradle/utils.gradle'
 apply from: 'gradle/wrapper.gradle'
 
-ext.modules = {
-    subprojects
-}
-
 task dgmConverter(dependsOn:compileJava) {
     description = 'Generates DGM info file required for faster startup.'
     def classesDir = sourceSets.main.output.classesDir

http://git-wip-us.apache.org/repos/asf/groovy/blob/ed091e50/gradle/publish.gradle
----------------------------------------------------------------------
diff --git a/gradle/publish.gradle b/gradle/publish.gradle
index a5647d1..e825e64 100644
--- a/gradle/publish.gradle
+++ b/gradle/publish.gradle
@@ -35,23 +35,26 @@ if (!artifactoryUser) {
 logger.lifecycle "ArtifactoryUser user: $artifactoryUser"
 
 allprojects {
-    apply plugin: 'com.jfrog.artifactory-upload'
+    if (project == rootProject || rootProject.ext.modules().contains(project)) {
+        apply plugin: 'com.jfrog.artifactory-upload'
 
-    artifactory {
-        contextUrl = project.hasProperty('artifactoryContext') ? project.artifactoryContext : 'https://oss.jfrog.org'
-        resolve {
-            repository {
-                repoKey = 'libs-release'
+        artifactory {
+            contextUrl = project.hasProperty('artifactoryContext') ? project.artifactoryContext : 'https://oss.jfrog.org'
+            resolve {
+                repository {
+                    repoKey = 'libs-release'
+                }
             }
-        }
-        publish {
-            excludePatterns = "org/codehaus/groovy/groovy/*/groovy-all-*,org/codehaus/groovy/groovy/*/groovy-backports-*,org/codehaus/groovy/groovy/*/groovy-binary-*"
-            repository {
-                repoKey = project.hasProperty('artifactoryRepoKey') ? project.artifactoryRepoKey : 'oss-snapshot-local' //The Artifactory repository key to publish to
-                //when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
-                //~/.gradle/gradle.properties, otherwise to be set in the build server
-                username = rootProject.artifactoryUser
-                password = rootProject.artifactoryPassword
+            publish {
+                excludePatterns = "org/codehaus/groovy/groovy/*/groovy-all-*,org/codehaus/groovy/groovy/*/groovy-backports-*,org/codehaus/groovy/groovy/*/groovy-binary-*"
+                repository {
+                    repoKey = project.hasProperty('artifactoryRepoKey') ? project.artifactoryRepoKey : 'oss-snapshot-local'
+                    //The Artifactory repository key to publish to
+                    //when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
+                    //~/.gradle/gradle.properties, otherwise to be set in the build server
+                    username = rootProject.artifactoryUser
+                    password = rootProject.artifactoryPassword
+                }
             }
         }
     }
@@ -84,10 +87,14 @@ artifactoryPublish {
 
         if (isReleaseVersion) {
             allprojects {
-                configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier }.each {
-                    // add pom signatures
-                    def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
-                    deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
+                if (project == rootProject || rootProject.ext.modules().contains(project)) {
+                    configurations.archives.artifacts.findAll {
+                        it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier
+                    }.each {
+                        // add pom signatures
+                        def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
+                        deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
+                    }
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/ed091e50/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index c6c1c01..be65fba 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -32,9 +32,11 @@ def removeJarjaredDependencies = { p ->
 }
 
 allprojects {
-    apply plugin: 'maven'
-    apply from: "${rootProject.projectDir}/gradle/pomconfigurer.gradle"
-    install.dependsOn checkCompatibility
+    if (project == rootProject || modules().contains(project)) {
+        apply plugin: 'maven'
+        apply from: "${rootProject.projectDir}/gradle/pomconfigurer.gradle"
+        install.dependsOn checkCompatibility
+    }
 }
 
 apply from: 'gradle/backports.gradle'
@@ -43,95 +45,97 @@ ext.basename = { String s -> s.take(s.lastIndexOf('.')) }
 ext.deriveFile = { File archive, String suffix -> new File(archive.parent, basename(archive.name) + "-${suffix}.jar") }
 
 allprojects {
-    ext.signWithClassifier = { String c, File f ->
-        if (rootProject.isReleaseVersion) {
-            signing.sign(c, f)
-            def ascFile = new File(f.parent, f.name + '.asc')
-            if (ascFile.exists()) {
-                project.artifacts.add('archives', ascFile) {
-                    classifier = c
-                    type = 'asc'
-                    extension = 'jar.asc'
+    if (project == rootProject || modules().contains(project)) {
+        ext.signWithClassifier = { String c, File f ->
+            if (rootProject.isReleaseVersion) {
+                signing.sign(c, f)
+                def ascFile = new File(f.parent, f.name + '.asc')
+                if (ascFile.exists()) {
+                    project.artifacts.add('archives', ascFile) {
+                        classifier = c
+                        type = 'asc'
+                        extension = 'jar.asc'
+                    }
                 }
             }
         }
-    }
 
-    ext.signArchiveTask = { archiveTask ->
-        if (rootProject.isReleaseVersion) {
-            signing.sign(archiveTask.classifier, archiveTask.archivePath)
-            def ascFile = new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')
-            if (ascFile.exists()) {
-                project.artifacts.add('archives', ascFile) {
-                    name = archiveTask.baseName
-                    classifier = archiveTask.classifier
-                    type = 'asc'
-                    extension = archiveTask.extension + '.asc'
+        ext.signArchiveTask = { archiveTask ->
+            if (rootProject.isReleaseVersion) {
+                signing.sign(archiveTask.classifier, archiveTask.archivePath)
+                def ascFile = new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')
+                if (ascFile.exists()) {
+                    project.artifacts.add('archives', ascFile) {
+                        name = archiveTask.baseName
+                        classifier = archiveTask.classifier
+                        type = 'asc'
+                        extension = archiveTask.extension + '.asc'
+                    }
                 }
             }
         }
-    }
 
-    uploadArchives {
-        repositories {
-            mavenDeployer {
-                pom pomConfigureClosure
-                beforeDeployment { MavenDeployment deployment -> if (rootProject.isReleaseVersion) signing.signPom(deployment) }
+        uploadArchives {
+            repositories {
+                mavenDeployer {
+                    pom pomConfigureClosure
+                    beforeDeployment { MavenDeployment deployment -> if (rootProject.isReleaseVersion) signing.signPom(deployment) }
+                }
             }
         }
-    }
 
-    install {
-        repositories {
-            mavenInstaller {
-                pom pomConfigureClosure
-                beforeDeployment { MavenDeployment deployment -> if (rootProject.isReleaseVersion) signing.signPom(deployment) }
+        install {
+            repositories {
+                mavenInstaller {
+                    pom pomConfigureClosure
+                    beforeDeployment { MavenDeployment deployment -> if (rootProject.isReleaseVersion) signing.signPom(deployment) }
+                }
             }
         }
-    }
 
-    artifacts {
-        archives jar
-        archives sourceJar
-        archives javadocJar
-        archives groovydocJar
-    }
+        artifacts {
+            archives jar
+            archives sourceJar
+            archives javadocJar
+            archives groovydocJar
+        }
 
-    [uploadArchives, install]*.with {
-        // dependency on jarAllAll should in theory be replaced with jar, jarWithIndy but
-        // in practice, it is faster
-        dependsOn([jarAllAll, sourceJar, javadocJar, groovydocJar])
-        doFirst {
-            if (rootProject.useIndy()) {
-                new GradleException('You cannot use uploadArchives or install task with the flag [indy] turned'
-                        +' on because the build handles indy artifacts by itself in that case.')
-            }
-            def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
-            if (indyJar.exists()) {
-                project.artifacts.add('archives', indyJar)
-            }
-            def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
-            if (grooidJar.exists()) {
-                project.artifacts.add('archives', grooidJar)
+        [uploadArchives, install]*.with {
+            // dependency on jarAllAll should in theory be replaced with jar, jarWithIndy but
+            // in practice, it is faster
+            dependsOn([jarAllAll, sourceJar, javadocJar, groovydocJar])
+            doFirst {
+                if (rootProject.useIndy()) {
+                    new GradleException('You cannot use uploadArchives or install task with the flag [indy] turned'
+                            + ' on because the build handles indy artifacts by itself in that case.')
+                }
+                def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
+                if (indyJar.exists()) {
+                    project.artifacts.add('archives', indyJar)
+                }
+                def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
+                if (grooidJar.exists()) {
+                    project.artifacts.add('archives', grooidJar)
+                }
             }
         }
-    }
 
-    install {
-        doFirst {
-            // gradle doesn't expect us to mutate configurations like we do here
-            // so signing the configuration won't work and we do it manually here
-            signArchiveTask(jar)
-            signArchiveTask(sourceJar)
-            signArchiveTask(javadocJar)
-            signArchiveTask(groovydocJar)
-            def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
-            if (indyJar.exists()) {
-                signWithClassifier('indy', indyJar)
-            }
-            def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
-            if (grooidJar.exists()) {
-                signWithClassifier('grooid', grooidJar)
+        install {
+            doFirst {
+                // gradle doesn't expect us to mutate configurations like we do here
+                // so signing the configuration won't work and we do it manually here
+                signArchiveTask(jar)
+                signArchiveTask(sourceJar)
+                signArchiveTask(javadocJar)
+                signArchiveTask(groovydocJar)
+                def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
+                if (indyJar.exists()) {
+                    signWithClassifier('indy', indyJar)
+                }
+                def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
+                if (grooidJar.exists()) {
+                    signWithClassifier('grooid', grooidJar)
+                }
             }
         }
     }