diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-03-31 11:14:44 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-03-31 13:48:52 +0000 |
commit | bbd3549959ca6d7fbd9a78b85c5a6fa1121e00b8 (patch) | |
tree | 1b7647834f257190ccd8bad1de374cd2d24d9f49 /buildhelpers/src/main/java/com | |
parent | a82561b309f62cae4bce105403343e0b73998e64 (diff) | |
download | vaadin-framework-bbd3549959ca6d7fbd9a78b85c5a6fa1121e00b8.tar.gz vaadin-framework-bbd3549959ca6d7fbd9a78b85c5a6fa1121e00b8.zip |
Build vaadin-all with maven
Change-Id: I87aef5ee0b35ff8746a182192706f236afaef32d
Diffstat (limited to 'buildhelpers/src/main/java/com')
-rw-r--r-- | buildhelpers/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java | 101 | ||||
-rw-r--r-- | buildhelpers/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java | 171 |
2 files changed, 0 insertions, 272 deletions
diff --git a/buildhelpers/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java b/buildhelpers/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java deleted file mode 100644 index cd85ca6a3f..0000000000 --- a/buildhelpers/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java b/buildhelpers/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java deleted file mode 100644 index 0cd06890eb..0000000000 --- a/buildhelpers/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * 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.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.io.IOUtils; - -public class FetchReleaseNotesTickets { - private static final String queryURL = "https://dev.vaadin.com/query?status=pending-release&status=released&@milestone@&resolution=fixed&col=id&col=summary&col=owner&col=type&col=priority&col=component&col=version&col=bfptime&col=fv&format=tab&order=id"; - private static final String ticketTemplate = "<tr>" - + "@badge@" // - + "<td class=\"ticket\"><a href=\"https://dev.vaadin.com/ticket/@ticket@\">#@ticket@</a></td>" // - + "<td>@description@</td>" // - + "</tr>"; // - - public static void main(String[] args) throws IOException { - String versionsProperty = System.getProperty("vaadin.version"); - if (versionsProperty == null || versionsProperty.equals("")) { - usage(); - } - String milestone = ""; - - List<String> versions = new ArrayList<String>(); - for (String version : versionsProperty.split(" ")) { - if (version.endsWith(".0") || version.matches(".*\\.rc\\d+")) { - // Find all prerelease versions for final or rc - - // Strip potential rc prefix - version = version.replaceAll("\\.rc\\d+$", ""); - versions.addAll(findPrereleaseVersions(version)); - } else { - versions.add(version); - } - } - - for (String version : versions) { - if (!milestone.equals("")) { - milestone += "&"; - } - milestone += "milestone=Vaadin+" + version; - } - - printMilestone(milestone); - } - - private static List<String> findPrereleaseVersions(String baseVersion) { - List<String> versions = new ArrayList<String>(); - - for (int i = 0; i < 50; i++) { - versions.add(baseVersion + ".alpha" + i); - } - for (int i = 0; i < 10; i++) { - versions.add(baseVersion + ".beta" + i); - } - for (int i = 0; i < 10; i++) { - versions.add(baseVersion + ".rc" + i); - } - - return versions; - } - - 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(); - - List<String> tickets = IOUtils.readLines(urlStream); - - for (String ticket : tickets) { - // Omit BOM - if (!ticket.isEmpty() && ticket.charAt(0) == 65279) { - ticket = ticket.substring(1); - } - String[] fields = ticket.split("\t"); - if ("id".equals(fields[0])) { - // This is the header - continue; - } - String summary = fields[1]; - - summary = modifySummaryString(summary); - - 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("@badge@", badge)); - } - urlStream.close(); - } - - private static String modifySummaryString(String summary) { - - if (summary.startsWith("\"") && summary.endsWith("\"")) { - // If a summary starts with " and ends with " then all quotes in - // the summary are encoded as double quotes - summary = summary.substring(1, summary.length() - 1); - summary = summary.replace("\"\"", "\""); - } - - // this is needed for escaping html - summary = escapeHtml(summary); - - return summary; - } - - /** - * @since 7.4 - * @param string - * the string to be html-escaped - * @return string in html-escape format - */ - private static String escapeHtml(String string) { - - StringBuffer buf = new StringBuffer(string.length() * 2); - - // we check the string character by character and escape only special - // characters - for (int i = 0; i < string.length(); ++i) { - - char ch = string.charAt(i); - String charString = ch + ""; - - if ((charString).matches("[a-zA-Z0-9., ]")) { - // character is letter, digit, dot, comma or whitespace - buf.append(ch); - } else { - int charInt = ch; - buf.append("&"); - buf.append("#"); - buf.append(charInt); - buf.append(";"); - } - } - return buf.toString(); - } - - private static void usage() { - System.err.println("Usage: " - + FetchReleaseNotesTickets.class.getSimpleName() - + " -Dvaadin.version=<version>"); - System.exit(1); - } -} |