summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-02-18 21:31:32 +0200
committerVaadin Code Review <review@vaadin.com>2013-02-19 15:07:44 +0000
commitf09c12fd97cbafd10b31c79a55bd90dfef02f4a9 (patch)
tree5030cc74358b7615eaf81833eed41ecf6c9e519d
parent9da1979af798324cbe1eea2b6adde0886774f73b (diff)
downloadvaadin-framework-f09c12fd97cbafd10b31c79a55bd90dfef02f4a9.tar.gz
vaadin-framework-f09c12fd97cbafd10b31c79a55bd90dfef02f4a9.zip
Imported and updated release notes builder (#10918)
Change-Id: Ie21d448f89d0fab6b7732a0137c80172e9da8e69 Ticket: 10918
-rw-r--r--all/build.xml6
-rw-r--r--build/bin/closed-to-rn.py16
-rw-r--r--buildhelpers/build.xml7
-rw-r--r--buildhelpers/ivy.xml4
-rw-r--r--buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java46
-rw-r--r--client-compiled/build.xml3
-rw-r--r--common.xml34
-rw-r--r--uitest/build.xml4
8 files changed, 97 insertions, 23 deletions
diff --git a/all/build.xml b/all/build.xml
index ef8ac71c4d..40d82b3d47 100644
--- a/all/build.xml
+++ b/all/build.xml
@@ -35,6 +35,9 @@
</target>
<target name="javadoc" depends="copy-jars">
+ <!-- Ensure filtered webcontent files are available -->
+ <antcall target="common.filter.webcontent" />
+
<!-- Unpack all source files to javadoc.temp.dir-->
<antcontrib:foreach list="${modules.to.publish.to.maven}" target="unzip.to.javadoctemp" param="module" />
@@ -76,6 +79,9 @@
</target>
<target name="zip" depends="copy-jars, javadoc">
+ <!-- Ensure filtered webcontent files are available -->
+ <antcall target="common.filter.webcontent" />
+
<zip destfile="${zip.file}">
<fileset dir="${temp.dir}">
<!-- Avoid conflicts with servlet and portlet API. They are provided by the container -->
diff --git a/build/bin/closed-to-rn.py b/build/bin/closed-to-rn.py
deleted file mode 100644
index 0928877e1c..0000000000
--- a/build/bin/closed-to-rn.py
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/python
-
-import sys,string
-
-filename = sys.argv[1]
-
-fin = open(filename, "r")
-lines = fin.readlines()
-fin.close()
-
-for line in lines:
- fields = string.split(line, "\t")
-
- if fields[0] != "id":
- ticketid = "<a href=\"http://dev.vaadin.com/ticket/%s\">#%s</a>" % (fields[0],fields[0])
- print " <li>%s: %s</li>" % (ticketid, fields[1])
diff --git a/buildhelpers/build.xml b/buildhelpers/build.xml
index c7b9eba9d3..b56209f6cc 100644
--- a/buildhelpers/build.xml
+++ b/buildhelpers/build.xml
@@ -36,6 +36,13 @@
</antcall>
</target>
+ <target name="fetch-release-notes-tickets">
+ <antcall target="common.exec-buildhelper">
+ <param name="main.class" value="com.vaadin.buildhelpers.FetchReleaseNotesTickets" />
+ <param name="output" value="${output}" />
+ </antcall>
+ </target>
+
<target name="tests" depends="checkstyle">
<!--<antcall target="common.tests.run" />-->
<echo>WHAT? No JUnit tests for ${module.name}!</echo>
diff --git a/buildhelpers/ivy.xml b/buildhelpers/ivy.xml
index ba44ebfc3f..d8e4457296 100644
--- a/buildhelpers/ivy.xml
+++ b/buildhelpers/ivy.xml
@@ -27,6 +27,8 @@
<artifact type="pom" ext="pom" />
</publications>
- <dependencies />
+ <dependencies>
+ <dependency org="commons-io" name="commons-io" rev="1.4" />
+ </dependencies>
</ivy-module>
diff --git a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java
new file mode 100644
index 0000000000..76952bb329
--- /dev/null
+++ b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java
@@ -0,0 +1,46 @@
+package com.vaadin.buildhelpers;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+
+public class FetchReleaseNotesTickets {
+ private static final String queryURL = "http://dev.vaadin.com/query?status=closed&amp;milestone=Vaadin+@version@&amp;resolution=fixed&amp;format=tab&amp;order=id";
+ private static final String ticketTemplate = " <li><a href=\"http://dev.vaadin.com/ticket/@ticket@\">#@ticket@</a>: @description@</li>";
+
+ public static void main(String[] args) throws IOException {
+ String version = System.getProperty("vaadin.version");
+ if (version == null || version.equals("")) {
+ usage();
+ }
+
+ URL url = new URL(queryURL.replace("@version@", version));
+ URLConnection connection = url.openConnection();
+ InputStream urlStream = connection.getInputStream();
+
+ @SuppressWarnings("unchecked")
+ List<String> tickets = IOUtils.readLines(urlStream);
+
+ for (String ticket : tickets) {
+ String[] fields = ticket.split("\t");
+ if ("id".equals(fields[0])) {
+ // This is the header
+ continue;
+ }
+ System.out.println(ticketTemplate.replace("@ticket@", fields[0])
+ .replace("@description@", fields[1]));
+ }
+ urlStream.close();
+ }
+
+ private static void usage() {
+ System.err.println("Usage: "
+ + FetchReleaseNotesTickets.class.getSimpleName()
+ + " -Dvaadin.version=<version>");
+ System.exit(1);
+ }
+}
diff --git a/client-compiled/build.xml b/client-compiled/build.xml
index d1f3eda674..1a78b17a7f 100644
--- a/client-compiled/build.xml
+++ b/client-compiled/build.xml
@@ -98,6 +98,9 @@
</target>
<target name="client-compiled-cache.jar" depends="default-widgetset-cache">
+ <!-- Ensure filtered webcontent files are available -->
+ <antcall target="common.filter.webcontent" />
+
<jar file="${compiled-cache.jar}" compress="true">
<fileset dir="${gwtar.dir}">
<include name="**/*.gwtar" />
diff --git a/common.xml b/common.xml
index ff82b6b7ec..7a3f2f17c6 100644
--- a/common.xml
+++ b/common.xml
@@ -27,9 +27,12 @@
<union id="empty.reference" />
<property name="filtered.webcontent.dir" location="${vaadin.basedir}/result/filteredWebContent" />
+ <property name="release-notes-tickets-file" location="${vaadin.basedir}/result/release-notes-tickets.html" />
- <target name="filter.webcontent" unless="webcontent.filtered">
+ <target name="filter.webcontent" unless="webcontent.filtered" depends="fetch-release-notes-tickets">
<property name="webcontent.filtered" value="true" />
+ <!-- Running without build.release-notes will cause an error, which is ignored -->
+ <loadfile property="release-notes-tickets" srcFile="${release-notes-tickets-file}" failonerror="false" />
<delete dir="${filtered.webcontent.dir}" />
<copy todir="${filtered.webcontent.dir}">
@@ -57,11 +60,20 @@
<replacetokens begintoken="@" endtoken="@">
<token key="builddate" value="${build.date}" />
</replacetokens>
+ <replacetokens begintoken="@" endtoken="@">
+ <token key="release-notes-tickets" value="${release-notes-tickets}" />
+ </replacetokens>
</filterchain>
</copy>
+ </target>
-
+ <target name="fetch-release-notes-tickets" unless="built.release-notes" if="build.release-notes">
+ <subant buildpath="${vaadin.basedir}/buildhelpers" target="fetch-release-notes-tickets" antfile="build.xml" inheritall="true">
+ <property name="output" location="${release-notes-tickets-file}" />
+ </subant>
+ <property name="built.release-notes" value="1" />
</target>
+
<fileset dir="${filtered.webcontent.dir}" id="common.files.for.all.jars">
<patternset>
<include name="release-notes.html" />
@@ -110,7 +122,7 @@
</target>
- <target name="sources.jar" depends="compile">
+ <target name="sources.jar" depends="compile, filter.webcontent">
<fail unless="result.dir" message="No result.dir parameter given" />
<fail unless="module.name" message="No module.name parameter given" />
<fail unless="src" message="No src directory parameter given" />
@@ -132,7 +144,7 @@
</target>
- <target name="javadoc.jar" depends="dependencies">
+ <target name="javadoc.jar" depends="dependencies, filter.webcontent">
<fail unless="result.dir" message="No result.dir parameter given" />
<fail unless="module.name" message="No module.name parameter given" />
<property name="src" location="{$result.dir}/../src" />
@@ -157,7 +169,7 @@
</target>
- <target name="jar" depends="compile, pom.xml">
+ <target name="jar" depends="compile, pom.xml, filter.webcontent">
<fail unless="result.dir" message="No result.dir parameter given" />
<fail unless="module.name" message="No module.name parameter given" />
@@ -261,6 +273,16 @@
</javac>
</target>
+ <target name="exec-buildhelper" depends="compile">
+ <fail unless="main.class" message="No main class given in 'main.class'" />
+ <fail unless="output" message="No output file given in 'output'" />
+ <java classname="${main.class}" output="${output}" failonerror="true" fork="yes">
+ <classpath refid="vaadin.buildhelpers.classpath" />
+ <classpath refid="classpath.compile.dependencies" />
+ <jvmarg value="-Dvaadin.version=${vaadin.version}" />
+ </java>
+ </target>
+
<target name="directories">
<property name="result.dir" location="result" />
<property name="src" location="${result.dir}/../src" />
@@ -321,7 +343,7 @@
</copy>
</target>
- <target name="dependencies" description="Resolves dependencies needed by this module" depends="filter.webcontent">
+ <target name="dependencies" description="Resolves dependencies needed by this module">
<property name='conf' value="build, build-provided" />
<ivy:resolve resolveid="common" conf="${conf}" />
<ivy:cachepath pathid="classpath.compile.dependencies" conf="${conf}" />
diff --git a/uitest/build.xml b/uitest/build.xml
index ee2b2c6124..53da0ae2e9 100644
--- a/uitest/build.xml
+++ b/uitest/build.xml
@@ -106,6 +106,10 @@
<path refid="classpath.runtime.dependencies" />
</copy>
+
+ <!-- Ensure filtered webcontent files are available -->
+ <antcall target="common.filter.webcontent" />
+
<war destfile="${result.war}" duplicate="fail" index="true">
<fileset refid="common.files.for.all.jars" />
<fileset dir="${result.dir}">