hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1532999 - in /httpcomponents/project-release-tools/trunk: build.gradle buildSrc/src/main/groovy/Mvn.groovy buildSrc/src/main/groovy/Pom.groovy
Date Thu, 17 Oct 2013 07:58:49 GMT
Author: olegk
Date: Thu Oct 17 07:58:49 2013
New Revision: 1532999

URL: http://svn.apache.org/r1532999
Log:
Added task to generate release vote message template

Modified:
    httpcomponents/project-release-tools/trunk/build.gradle
    httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/Mvn.groovy
    httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/Pom.groovy

Modified: httpcomponents/project-release-tools/trunk/build.gradle
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/build.gradle?rev=1532999&r1=1532998&r2=1532999&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/build.gradle (original)
+++ httpcomponents/project-release-tools/trunk/build.gradle Thu Oct 17 07:58:49 2013
@@ -444,6 +444,60 @@ if (rcTagFile.exists() && rcRevisionFile
         }
     }
 
+    if (distRevisionFile.exists()) {
+
+        task prepareVote() {
+            group = 'Release'
+            description = "Generates release vote message content."
+            doLast {
+                Pom pom = Mvn.parsePom(checkoutRC.localDir)
+                String name = pom.name
+                if (name.startsWith('Apache ')) {
+                    name = name.substring(7)
+                }
+                String rcQualifier = rcQualifierFile.text.trim()
+                String rcName = getProductName(pom.artifactId).toLowerCase(Locale.US)
+                String rcFullName = "${rcName}-${pom.version}-${rcQualifier}"
+                String releaseNotes = "RELEASE_NOTES-${pom.major}.${pom.minor}.x.txt"
+                URI rcTag = new URI(rcTagFile.text.trim())
+
+                String rcRevision = rcRevisionFile.text.trim()
+                String distRevision = distRevisionFile.text.trim()
+
+                String releaseVer = pom.version
+
+                println '----------------8<-------------[ cut here ]------------------'
+                println "[VOTE] Release ${name} ${releaseVer} based on ${rcQualifier}"
+                println ""
+                println "Please vote on releasing these packages as ${name} ${releaseVer}."
+                println "The vote is open for the at least 72 hours, and only votes from"
+                println "HttpComponents PMC members are binding. The vote passes if at least"
+                println "three binding +1 votes are cast and there are more +1 than -1 votes."
+                println ""
+                println "Packages:"
+                println "${checkoutDistStage.repo}${rcFullName}"
+                println "revision ${distRevision}"
+                println ""
+                println "Release notes:"
+                println "${checkoutDistStage.repo}${rcFullName}/${releaseNotes}"
+                println ""
+                println "Maven artefacts:"
+                println "[link]"
+                println ""
+                println "SVN tag:"
+                println "${rcTag}"
+                println "revision ${rcRevision}"
+                println ""
+                println "--------------------------------------------------------------------------"
+                println "Vote: ${name} ${releaseVer} release"
+                println "[ ] +1 Release the packages as ${name} ${releaseVer}."
+                println "[ ] -1 I am against releasing the packages (must include a reason)."
+                println '----------------8<-------------[ cut here ]------------------'
+            }
+        }
+
+    }
+
     task promoteRC(dependsOn: checkoutRC) {
         group = 'Release'
         description = "Promotes RC to official release."

Modified: httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/Mvn.groovy
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/Mvn.groovy?rev=1532999&r1=1532998&r2=1532999&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/Mvn.groovy (original)
+++ httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/Mvn.groovy Thu Oct
17 07:58:49 2013
@@ -47,19 +47,20 @@ class Mvn {
         }
     }
 
-    static Pom parsePom(File dir) {
+    static Pom parsePom(File dir) {
         File pomFile = new File(dir, 'pom.xml')
-        def pomModel = new XmlSlurper().parse(pomFile)
-        def el = pomModel['parent']
-        PomArtifact pomParent = el ? new PomArtifact(
-                el.groupId.text(),
-                el.artifactId.text(),
-                el.version.text()) : null
-        PomArtifact artifact = new PomArtifact(
-                pomModel.groupId.text(),
-                pomModel.artifactId.text(),
-                pomModel.version.text())
-        new Pom(pomParent, artifact, pomModel.modules.module*.text())
+        def pomModel = new XmlSlurper().parse(pomFile)
+        def el = pomModel['parent']
+        PomArtifact pomParent = el ? new PomArtifact(
+                el.groupId.text(),
+                el.artifactId.text(),
+                el.version.text()) : null
+        PomArtifact artifact = new PomArtifact(
+                pomModel.groupId.text(),
+                pomModel.artifactId.text(),
+                pomModel.version.text())
+        String name = pomModel.name
+        new Pom(name, pomParent, artifact, pomModel.modules.module*.text())
     }
 
 }

Modified: httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/Pom.groovy
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/Pom.groovy?rev=1532999&r1=1532998&r2=1532999&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/Pom.groovy (original)
+++ httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/Pom.groovy Thu Oct
17 07:58:49 2013
@@ -27,16 +27,22 @@
 
 class Pom {
 
+    private final String name
     private final PomArtifact parent
     private final PomArtifact artifact
     private final List<String> modules
 
-    Pom(PomArtifact parent, PomArtifact artifact, modules) {
+    Pom(String name, PomArtifact parent, PomArtifact artifact, modules) {
+        this.name = name
         this.parent = parent
         this.artifact = artifact
         this.modules = modules
     }
 
+    String getName() {
+        return name
+    }
+
     String getGroupId() {
         if (artifact.groupId) {
             artifact.groupId



Mime
View raw message