db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r1027882 - in /db/derby/code/trunk/tools/release: build.xml jirasoap/src/main/java/org/apache/derbyBuild/jirasoap/FilteredIssueListerAntWrapper.java
Date Wed, 27 Oct 2010 09:55:43 GMT
Author: kristwaa
Date: Wed Oct 27 09:55:43 2010
New Revision: 1027882

URL: http://svn.apache.org/viewvc?rev=1027882&view=rev
Log:
DERBY-4857: Utilize the SOAP API to fetch JIRA issue list for release notes generation 

Integrated the JIRA SOAP tool with the ant genrelnotes target, which now:
 o checks if the required properties have been set
 o builds the JIRA SOAP tool using Maven 2
 o executes the JIRA SOAP tool to generate the issue list
 o executes the ReleaseNotesGenerator
The target is started from the directory tools/release.
Try 'ant -p' or see JavaDoc for ReleaseNotesGenerator for help on usage.

Patch file: derby-4857-4b-jirasoap_ant_integration.diff


Added:
    db/derby/code/trunk/tools/release/jirasoap/src/main/java/org/apache/derbyBuild/jirasoap/FilteredIssueListerAntWrapper.java
  (with props)
Modified:
    db/derby/code/trunk/tools/release/build.xml

Modified: db/derby/code/trunk/tools/release/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/release/build.xml?rev=1027882&r1=1027881&r2=1027882&view=diff
==============================================================================
--- db/derby/code/trunk/tools/release/build.xml (original)
+++ db/derby/code/trunk/tools/release/build.xml Wed Oct 27 09:55:43 2010
@@ -55,9 +55,19 @@
 <!-- These properties are used by the Release Notes Generator. -->
 
   <property name="relnotes.src.summary" value="${basedir}/releaseSummary.xml" />
-  <property name="relnotes.src.buglist" value="${relnotes.src.reports}/fixedBugsList.xml"
/>
+  <property name="relnotes.src.buglist" value="${relnotes.src.reports}/fixedBugsList.txt"
/>
   <property name="relnotes.out.filename" value="${basedir}/RELEASE-NOTES.html" />
 
+  <condition property="isWindows">
+    <os family="windows"/>
+  </condition>
+
+  <condition property="isUnix">
+    <not>
+      <os family="windows"/>
+    </not>
+  </condition>
+
 <!-- Define the task which generates the release notes -->
   <taskdef
     name="generateReleaseNotes"
@@ -67,7 +77,9 @@
 
 <!-- Targets -->
 
-  <target name="release" depends="clean,bin,lib,lib-debug,src"/>
+  <target name="release"
+      description="Generates the release artifacts."
+      depends="clean,bin,lib,lib-debug,src"/>
 
   <target name="init">
     <mkdir dir="${release.dir}"/>
@@ -101,16 +113,82 @@
    The ${relnotes.src.reports} property must point at a
    directory containing a JIRA report:
 
-     fixedBugsList.xml  - This is a JIRA xml report of issues fixed in the release.
+     fixedBugsList.txt  - This is a list of JIRA issues fixed in the release.
 -->
-  <target name="genrelnotes">
-
+  <target name="genrelnotes"
+      depends="missing-properties, maven-exec-windows, maven-exec-unix"
+      description="Generates the release notes. Takes the following properties: jira.user,
jira.password, jira.filter.id, release.version, relnotes.src.reports">
+
+        <!-- Build the JIRA SOAP client -->
+	<exec executable="${mvn.exec}"
+                dir="${basedir}/tools/release/jirasoap">
+        <!-- comment out for debugging -->
+        <arg line="--quiet"/>
+        <arg line="-Pbuildclient"/>
+        </exec>
+
+        <!-- Define the task which generates the issue list data for the
+             release notes generator
+        -->
+        <taskdef
+            name="jirasoapclient"
+            classname="org.apache.derbyBuild.jirasoap.FilteredIssueListerAntWrapper"
+            classpath="${basedir}/tools/release/jirasoap/target/JiraSOAP-LATEST-jar-with-dependencies.jar"
+        />
+
+        <!-- Execute the JIRA SOAP client -->
+        <jirasoapclient
+            user="${jira.user}"
+            password="${jira.password}"
+            releaseVersion="${release.version}"
+            filterId="${jira.filter.id}"
+            outputFile="${relnotes.src.buglist}"
+        />
+            
      <generateReleaseNotes
        summaryFileName="${relnotes.src.summary}"
        bugListFileName="${relnotes.src.buglist}"
        outputFileName="${relnotes.out.filename}"
      />
+    <echo message="Release notes written to ${relnotes.out.filename}"/>
+
+  </target>
 
+  <!-- Execute this target if one or more of the required properties are missing -->
+  <target name="missing-properties" depends="check-properties" unless="properties-set">
+        <echo message="Not all required properties are set."/>
+        <echo message="Make sure the following properties are set:"/>
+        <echo message="  jira.user             = ${jira.user}"/>
+        <echo message="  jira.password         = ${jira.password}"/>
+        <echo message="  jira.filter.id        = ${jira.filter.id}"/>
+        <echo message="                          (digits only)"/>
+        <echo message="  release.version       = ${release.version}"/>
+        <echo message="                          (i.e. 10.7.1.0)"/>
+        <echo message="  relnotes.src.reports  = ${relnotes.src.reports}"/>
+        <echo message="                          (specify a directory)"/>
+        <fail message="Build aborted due to missing system properties."/>
+  </target>
+
+  <!-- Checks if all required properties are set -->
+  <target name="check-properties"/>
+        <!-- Check if the properties have been set -->
+        <condition property="properties-set">
+            <and>
+                <isset property="jira.user"/>
+                <isset property="jira.password"/>
+                <isset property="release.version"/>
+                <isset property="jira.filter.id"/>
+                <isset property="relnotes.src.reports"/>
+            </and>
+        </condition>
+
+  <!-- Targets used to specify the correct Maven executable -->
+  <target name="maven-exec-windows" unless="isUnix">
+    <property name="mvn.exec" value="mvn.bat"/>
+  </target>
+
+  <target name="maven-exec-unix" unless="isWindows">
+    <property name="mvn.exec" value="mvn"/>
   </target>
 
   <!-- bin distribution -->
@@ -390,8 +468,16 @@
   </target>
 
   <!-- remove all the files generated by the release targets. -->
-  <target name="clean">
+  <target name="clean"
+      description="Cleans up resources generated by the relaese targets."
+      depends="maven-exec-windows,maven-exec-unix">
     <delete dir="${release.dir}"/>
+    <exec executable="${mvn.exec}"
+            dir="${basedir}/tools/release/jirasoap">
+        <!-- comment out for debugging -->
+        <arg line="--quiet"/>
+        <arg line="clean"/>
+    </exec>
   </target>
 
   <!-- bumps the last part of the version string to the next digit. -->

Added: db/derby/code/trunk/tools/release/jirasoap/src/main/java/org/apache/derbyBuild/jirasoap/FilteredIssueListerAntWrapper.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/release/jirasoap/src/main/java/org/apache/derbyBuild/jirasoap/FilteredIssueListerAntWrapper.java?rev=1027882&view=auto
==============================================================================
--- db/derby/code/trunk/tools/release/jirasoap/src/main/java/org/apache/derbyBuild/jirasoap/FilteredIssueListerAntWrapper.java
(added)
+++ db/derby/code/trunk/tools/release/jirasoap/src/main/java/org/apache/derbyBuild/jirasoap/FilteredIssueListerAntWrapper.java
Wed Oct 27 09:55:43 2010
@@ -0,0 +1,77 @@
+/*
+
+   Derby - Class org.apache.derbyBuild.jirasoap.FilteredIssueListerAntWrapper
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to you under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyBuild.jirasoap;
+
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Wrapper for invoking {@code FilteredIssueLister} from ant.
+ */
+public class FilteredIssueListerAntWrapper {
+
+    private String user;
+    private String password;
+    private String releaseVersion;
+    private long filterId;
+    private String output;
+
+    public FilteredIssueListerAntWrapper() {};
+
+    public void setUser(String user) {
+        this.user = user;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public void setReleaseVersion(String releaseVersion) {
+        this.releaseVersion = releaseVersion;
+    }
+
+    public void setFilterId(String id)
+            throws BuildException {
+        try {
+            filterId = Long.parseLong(id);
+        } catch (NumberFormatException nfe) {
+            throw new BuildException(
+                    "invalid JIRA filter id (only digits allowed): " + id, nfe);
+        }
+    }
+
+    public void setOutputFile(String output) {
+        this.output = output;
+    }
+
+    public void execute()
+            throws BuildException {
+        try {
+            FilteredIssueLister issueLister =
+                new FilteredIssueLister(user, password);
+            issueLister.prepareReleaseNotes(
+                    releaseVersion, filterId, output, null);
+        } catch (Exception e) {
+            throw new BuildException(e);
+        }
+
+    }
+}

Propchange: db/derby/code/trunk/tools/release/jirasoap/src/main/java/org/apache/derbyBuild/jirasoap/FilteredIssueListerAntWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message