summaryrefslogtreecommitdiffstats
path: root/buildhelpers
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2014-05-16 11:41:42 +0300
committerHenri Sara <hesara@vaadin.com>2014-05-16 13:03:09 +0300
commitb4180f2388a6ec97c422097f16da617114aba590 (patch)
tree86d73cb261f89d7360d5810e2986a6e78e066374 /buildhelpers
parente65231e6028892bd6847777c5bad982b73278b14 (diff)
parent0f74fdff68cef4eac27913bb4fd0943ff39ca604 (diff)
downloadvaadin-framework-7.3.0.alpha2.tar.gz
vaadin-framework-7.3.0.alpha2.zip
Merge master into valo7.3.0.alpha2
This change does not include all release notes updates from master. Change-Id: I209dc06d03d4541ac33746d1161630f0ca8ae5d9
Diffstat (limited to 'buildhelpers')
-rw-r--r--buildhelpers/build.xml9
-rw-r--r--buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java2
-rw-r--r--buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java101
-rw-r--r--buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java40
-rw-r--r--buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java2
-rw-r--r--buildhelpers/src/com/vaadin/buildhelpers/ManifestWriter.java4
-rw-r--r--buildhelpers/src/com/vaadin/buildhelpers/authormap.properties6
7 files changed, 153 insertions, 11 deletions
diff --git a/buildhelpers/build.xml b/buildhelpers/build.xml
index 28eb55e6e8..159435811f 100644
--- a/buildhelpers/build.xml
+++ b/buildhelpers/build.xml
@@ -44,6 +44,15 @@
</antcall>
</target>
+ <target name="fetch-release-notes-authors">
+ <copy file="src/com/vaadin/buildhelpers/authormap.properties" tofile="result/classes/com/vaadin/buildhelpers/authormap.properties" />
+ <antcall target="common.exec-buildhelper">
+ <param name="main.class" value="com.vaadin.buildhelpers.FetchReleaseNotesAuthors" />
+ <param name="output" value="${output}" />
+ </antcall>
+ <delete file="result/classes/com/vaadin/buildhelpers/authormap.properties" />
+ </target>
+
<target name="test" depends="checkstyle">
<!--<antcall target="common.test.run" /> -->
<echo>WHAT? No JUnit tests for ${module.name}!</echo>
diff --git a/buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java b/buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java
index 06b941f522..0fa4a7e8ab 100644
--- a/buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java
+++ b/buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 Vaadin Ltd.
+ * Copyright 2000-2014 Vaadin Ltd.
*
* Licensed 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
diff --git a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java
new file mode 100644
index 0000000000..cd85ca6a3f
--- /dev/null
+++ b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed 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 com.vaadin.buildhelpers;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+
+public class FetchReleaseNotesAuthors {
+ private static final String template = "<li class=\"author\">@author@</li>";
+
+ public static void main(String[] args) throws IOException,
+ InterruptedException {
+ Properties authorMap = new Properties();
+
+ String authorsFilename = FetchReleaseNotesAuthors.class.getPackage()
+ .getName().replace(".", "/")
+ + "/authormap.properties";
+ InputStream s = FetchReleaseNotesAuthors.class.getClassLoader()
+ .getResourceAsStream(authorsFilename);
+ if (s == null) {
+ System.err.println("Author mapping file " + authorsFilename
+ + " not found!");
+ }
+ authorMap.load(s);
+
+ String version = System.getProperty("vaadin.version");
+ String previousVersion = getPreviousVersion(version);
+ // System.out.println("Using previous version: " + previousVersion);
+ // List all commits which are in this version but not in
+ // "previousVersion"
+ String cmd = "git log --pretty=%an HEAD ^origin/" + previousVersion;
+ Process p = Runtime.getRuntime().exec(cmd);
+ p.waitFor();
+ if (p.exitValue() != 0) {
+ System.err.println("Exit code: " + p.exitValue());
+ }
+ BufferedReader b = new BufferedReader(new InputStreamReader(
+ p.getInputStream()));
+ String line = "";
+
+ List<String> authors = new ArrayList<String>();
+ while ((line = b.readLine()) != null) {
+ String author = line;
+ if (authorMap.containsKey(author)) {
+ author = authorMap.getProperty(author);
+ }
+ if (author != null && !author.equals("")
+ && !authors.contains(author)) {
+ authors.add(author);
+ }
+ }
+ Collections.sort(authors);
+ for (String author : authors) {
+ System.out.println(template.replace("@author@", author));
+ }
+ }
+
+ private static String getPreviousVersion(String version) {
+ String[] versionNumbers = version.split("\\.");
+ if (versionNumbers.length > 4 || versionNumbers.length < 3) {
+ throw new IllegalArgumentException("Cannot parse version: "
+ + version);
+ }
+ int major = Integer.parseInt(versionNumbers[0]);
+ int minor = Integer.parseInt(versionNumbers[1]);
+ int maintenance = Integer.parseInt(versionNumbers[2]);
+ // String qualifier = versionNumbers[3];
+
+ if (minor == 0) {
+ // Major release, can't know what the previous minor was
+ throw new IllegalArgumentException(
+ "Can't know what previous minor version was");
+ }
+ if (maintenance == 0) {
+ // Minor release, use last minor
+ return major + "." + (minor - 1);
+ } else {
+ // Maintenance, use last maintenance
+ return major + "." + minor + "." + (maintenance - 1);
+ }
+ }
+}
diff --git a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java
index fb7b672b21..028880b2e1 100644
--- a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java
+++ b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 Vaadin Ltd.
+ * Copyright 2000-2014 Vaadin Ltd.
*
* Licensed 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
@@ -17,6 +17,7 @@ package com.vaadin.buildhelpers;
import java.io.IOException;
import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
@@ -24,16 +25,33 @@ 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>";
+ private static final String queryURL = "http://dev.vaadin.com/query?status=closed&amp;@milestone@&amp;resolution=fixed&amp;col=id&amp;col=summary&amp;col=owner&amp;col=type&amp;col=priority&amp;col=component&amp;col=version&amp;col=bfptime&col=fv&amp;format=tab&amp;order=id";
+ private static final String ticketTemplate = "<tr>"
+ + "@badge@" //
+ + "<td class=\"ticket\"><a href=\"http://dev.vaadin.com/ticket/@ticket@\">#@ticket@</a></td>" //
+ + "<td>@description@</td>" //
+ + "</tr>"; //
public static void main(String[] args) throws IOException {
- String version = System.getProperty("vaadin.version");
- if (version == null || version.equals("")) {
+ String versions = System.getProperty("vaadin.version");
+ if (versions == null || versions.equals("")) {
usage();
}
+ String milestone = "";
+ for (String version : versions.split(" ")) {
+ if (!milestone.equals("")) {
+ milestone += "&amp;";
+ }
+ milestone += "milestone=Vaadin+" + version;
+ }
+
+ printMilestone(milestone);
+ }
- URL url = new URL(queryURL.replace("@version@", version));
+ private static void printMilestone(String milestone)
+ throws MalformedURLException, IOException {
+
+ URL url = new URL(queryURL.replace("@milestone@", milestone));
URLConnection connection = url.openConnection();
InputStream urlStream = connection.getInputStream();
@@ -52,8 +70,16 @@ public class FetchReleaseNotesTickets {
summary = summary.substring(1, summary.length() - 1);
summary = summary.replace("\"\"", "\"");
}
+ String badge = "<td></td>";
+ if (fields.length >= 8 && !fields[7].equals("")) {
+ badge = "<td class=\"bfp\"><span class=\"bfp\">Priority</span></td>";
+ } else if (fields.length >= 9 && fields[8].equalsIgnoreCase("true")) {
+ badge = "<td class=\"fv\"><span class=\"fv\">Vote</span></td>";
+ }
+
System.out.println(ticketTemplate.replace("@ticket@", fields[0])
- .replace("@description@", summary));
+ .replace("@description@", summary)
+ .replace("@badge@", badge));
}
urlStream.close();
}
diff --git a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
index 78ab0748ed..9dd51f8c6d 100644
--- a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
+++ b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 Vaadin Ltd.
+ * Copyright 2000-2014 Vaadin Ltd.
*
* Licensed 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
diff --git a/buildhelpers/src/com/vaadin/buildhelpers/ManifestWriter.java b/buildhelpers/src/com/vaadin/buildhelpers/ManifestWriter.java
index 688af4b591..9e9b29c4a1 100644
--- a/buildhelpers/src/com/vaadin/buildhelpers/ManifestWriter.java
+++ b/buildhelpers/src/com/vaadin/buildhelpers/ManifestWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 Vaadin Ltd.
+ * Copyright 2000-2014 Vaadin Ltd.
*
* Licensed 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
@@ -156,4 +156,4 @@ public class ManifestWriter {
public byte[] getBytes() {
return buffer.toString().getBytes();
}
-} \ No newline at end of file
+}
diff --git a/buildhelpers/src/com/vaadin/buildhelpers/authormap.properties b/buildhelpers/src/com/vaadin/buildhelpers/authormap.properties
new file mode 100644
index 0000000000..15b8ad2cba
--- /dev/null
+++ b/buildhelpers/src/com/vaadin/buildhelpers/authormap.properties
@@ -0,0 +1,6 @@
+denisanisimov=Denis Anisimov
+joheriks=Johannes Eriksson
+michaelvogt=Michael Vogt
+tapio=Tapio Aali
+Build\ Agent=
+mtzukanov=Michael Tzukanov \ No newline at end of file