hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1504953 - in /httpcomponents/project-release-tools/trunk: ./ buildSrc/src/main/groovy/
Date Fri, 19 Jul 2013 18:15:25 GMT
Author: olegk
Date: Fri Jul 19 18:15:24 2013
New Revision: 1504953

URL: http://svn.apache.org/r1504953
Log:
Added tasks to stage RC dists

Added:
    httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnContentTask.groovy
      - copied, changed from r1504493, httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnStatus.groovy
Modified:
    httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/HCPlugin.groovy
    httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/HCProject.groovy
    httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnGet.groovy
    httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnStatus.groovy
    httpcomponents/project-release-tools/trunk/gradle.properties.template
    httpcomponents/project-release-tools/trunk/rc.gradle

Modified: httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/HCPlugin.groovy
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/HCPlugin.groovy?rev=1504953&r1=1504952&r2=1504953&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/HCPlugin.groovy (original)
+++ httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/HCPlugin.groovy Fri
Jul 19 18:15:24 2013
@@ -25,6 +25,9 @@
  *
  */
 
+
+import org.apache.maven.artifact.versioning.ArtifactVersion
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion
 import org.gradle.api.InvalidUserDataException
 import org.gradle.api.Plugin
 import org.gradle.api.Project
@@ -34,6 +37,7 @@ import org.gradle.api.Project
  *
  * 'mvn' - Maven wrapper
  * 'rc' - Release candidate project metadata
+ * 'rcQualifier' - Release candidate qualifier such as RC1, RC2, etc
  */
 class HCPlugin implements Plugin<Project> {
 
@@ -55,6 +59,17 @@ class HCPlugin implements Plugin<Project
         }
         HCProject rc = new HCProject(new URI(HC_RC), project)
         project.extensions.add('rc', rc)
+
+        String rcQualifier = null
+        String path = rc.repo.path
+        if (path) {
+            String name = new File(path).name
+            if (name) {
+                ArtifactVersion ver = new DefaultArtifactVersion(name)
+                rcQualifier = ver.qualifier
+            }
+        }
+        project.extensions.add('rcQualifier', rcQualifier ?: "RC" )
     }
 
 }

Modified: httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/HCProject.groovy
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/HCProject.groovy?rev=1504953&r1=1504952&r2=1504953&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/HCProject.groovy (original)
+++ httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/HCProject.groovy Fri
Jul 19 18:15:24 2013
@@ -43,7 +43,7 @@ class HCProject {
         this.pom = Mvn.parsePom(localDir)
     }
 
-    protected static File findLocalDir(URI repo, File buildDir) {
+    private static File findLocalDir(URI repo, File buildDir) {
         if (!repo.absolute) {
             new File(repo.toString())
         } else {

Copied: httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnContentTask.groovy
(from r1504493, httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnStatus.groovy)
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnContentTask.groovy?p2=httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnContentTask.groovy&p1=httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnStatus.groovy&r1=1504493&r2=1504953&rev=1504953&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnStatus.groovy (original)
+++ httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnContentTask.groovy
Fri Jul 19 18:15:24 2013
@@ -26,9 +26,8 @@
  */
 
 import org.gradle.api.DefaultTask
-import org.gradle.api.tasks.TaskAction
 
-class SvnStatus extends DefaultTask {
+class SvnContentTask extends DefaultTask {
 
     private URI repo
     private File localDir
@@ -39,17 +38,19 @@ class SvnStatus extends DefaultTask {
 
     void setRepo(URI repo) {
         this.repo = repo
-        this.localDir = HCProject.findLocalDir(repo, project.buildDir)
+        if (!repo.absolute) {
+            this.localDir = new File(repo.toString())
+        } else {
+            String l = repo.path
+            if (l.endsWith('/')) {
+                l = l.substring(0, l.length() - 1)
+            }
+            this.localDir = new File(buildDir, l.replace('/', '-'))
+        }
     }
 
     File getLocalDir() {
         return localDir
     }
 
-    @TaskAction
-    void status() {
-        println("Local changes ${repo}")
-        Svn.status(localDir)
-    }
-
 }
\ No newline at end of file

Modified: httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnGet.groovy
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnGet.groovy?rev=1504953&r1=1504952&r2=1504953&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnGet.groovy (original)
+++ httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnGet.groovy Fri
Jul 19 18:15:24 2013
@@ -25,38 +25,19 @@
  *
  */
 
-import org.gradle.api.DefaultTask
-import org.gradle.api.artifacts.Configuration
-import org.gradle.api.artifacts.PublishArtifact
-import org.gradle.api.tasks.InputFiles
-import org.gradle.api.tasks.OutputFiles
 import org.gradle.api.tasks.TaskAction
 
-class SvnGet extends DefaultTask {
-
-    private URI repo
-    private File localDir
-
-    URI getRepo() {
-        return repo
-    }
-
-    void setRepo(URI repo) {
-        this.repo = repo
-        this.localDir = HCProject.findLocalDir(repo, project.buildDir)
-    }
-
-    File getLocalDir() {
-        return localDir
-    }
+class SvnGet extends SvnContentTask {
 
     @TaskAction
     void get() {
-        println("Site content source: ${repo}")
-        if (!localDir.exists()) {
-            Svn.checkout(repo, localDir)
-        } else {
-            Svn.update(localDir)
+        if (repo.absolute) {
+            println("Site content source: ${repo}")
+            if (!localDir.exists()) {
+                Svn.checkout(repo, localDir)
+            } else {
+                Svn.update(localDir)
+            }
         }
     }
 

Modified: httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnStatus.groovy
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnStatus.groovy?rev=1504953&r1=1504952&r2=1504953&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnStatus.groovy (original)
+++ httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/SvnStatus.groovy Fri
Jul 19 18:15:24 2013
@@ -25,31 +25,16 @@
  *
  */
 
-import org.gradle.api.DefaultTask
 import org.gradle.api.tasks.TaskAction
 
-class SvnStatus extends DefaultTask {
-
-    private URI repo
-    private File localDir
-
-    URI getRepo() {
-        return repo
-    }
-
-    void setRepo(URI repo) {
-        this.repo = repo
-        this.localDir = HCProject.findLocalDir(repo, project.buildDir)
-    }
-
-    File getLocalDir() {
-        return localDir
-    }
+class SvnStatus extends SvnContentTask {
 
     @TaskAction
     void status() {
-        println("Local changes ${repo}")
-        Svn.status(localDir)
+        if (repo.absolute) {
+            println("Local changes ${repo}")
+            Svn.status(localDir)
+        }
     }
 
 }
\ No newline at end of file

Modified: httpcomponents/project-release-tools/trunk/gradle.properties.template
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/gradle.properties.template?rev=1504953&r1=1504952&r2=1504953&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/gradle.properties.template (original)
+++ httpcomponents/project-release-tools/trunk/gradle.properties.template Fri Jul 19 18:15:24
2013
@@ -9,6 +9,7 @@ HC_PUBLISHED_RELEASES=\
   http://svn.apache.org/repos/asf/httpcomponents/httpasyncclient/trunk/
 
 HC_RC=http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/
+HC_DIST_STAGING=https://dist.apache.org/repos/dist/dev/httpcomponents/
 
 signing.keyId=
 signing.password=

Modified: httpcomponents/project-release-tools/trunk/rc.gradle
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/rc.gradle?rev=1504953&r1=1504952&r2=1504953&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/rc.gradle (original)
+++ httpcomponents/project-release-tools/trunk/rc.gradle Fri Jul 19 18:15:24 2013
@@ -29,7 +29,7 @@ apply plugin: HCPlugin
 apply plugin: 'signing'
 
 println "========================================================"
-println "Release candidate ${rc.pom.artifactId}:${rc.pom.version}"
+println "${rc.pom.artifactId}:${rc.pom.version} (${rcQualifier})"
 println "========================================================"
 
 repositories {
@@ -50,6 +50,17 @@ task generate() << {
     mvn.exec(rc.localDir, 'clean', 'install', 'site', 'javadoc:aggregate')
 }
 
+task prepareStage(type: SvnGet) {
+    if (!HC_DIST_STAGING) {
+        throw InvalidUserDataException("HC_DIST_STAGING not set")
+    }
+    repo = new URI(HC_DIST_STAGING)
+}
+
+task showStaged(type: SvnStatus) {
+    repo = tasks.prepareStage.repo
+}
+
 task distWinBin(type: Zip) {
     with docs(rc, Line.CRLF), atrifacts(configurations.rc)
     classifier = 'bin'
@@ -72,26 +83,27 @@ task distUxOSGiBin(type: Tar) {
 
 task distWinSrc(type: Zip) {
     with sources(rc, Line.CRLF)
+    into "${rc.pom.artifactId}-${rc.pom.version}"
     classifier = 'src'
 }
 
 task distUxSrc(type: Tar) {
     with sources(rc, Line.LF)
+    into "${rc.pom.artifactId}-${rc.pom.version}"
     classifier = 'src'
 }
 
-tasks.withType(Zip) { Zip zip ->
-    zip.baseName = rc.pom.artifactId
-    zip.version = rc.pom.version
-    zip.destinationDir = file("${buildDir}/dists")
+tasks.withType(AbstractArchiveTask) { AbstractArchiveTask archive ->
+    archive.dependsOn prepareStage
+    archive.baseName = rc.pom.artifactId
+    archive.version = rc.pom.version
+    archive.destinationDir = file("${prepareStage.localDir}/" +
+            "${rc.pom.artifactId}-${rc.pom.version}-${rcQualifier}")
 }
 
 tasks.withType(Tar) { Tar tar ->
-    tar.baseName = rc.pom.artifactId
-    tar.version = rc.pom.version
     tar.extension = "tar.gz"
     tar.compression = Compression.GZIP
-    tar.destinationDir = file("${buildDir}/dists")
 }
 
 configurations {
@@ -110,6 +122,13 @@ task digest(type: Digest) {
     digest configurations.dist
 }
 
+task copyReleaseNotes(type: Copy, dependsOn: prepareStage) {
+    from "${rc.localDir}/RELEASE_NOTES.txt"
+    into "${prepareStage.localDir}/" +
+            "${rc.pom.artifactId}-${rc.pom.version}-${rcQualifier}"
+    rename { "RELEASE_NOTES-${rc.pom.major}.${rc.pom.minor}.x.txt" }
+}
+
 CopySpec docs(HCProject hcProject, String delim) {
     CopySpec spec = copySpec {
         from (hcProject.localDir) {



Mime
View raw message