From 1f6f9b04f6fc73ce5b1b9c29cbe7445730b3db29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Fri, 29 Aug 2014 13:53:49 +0300 Subject: [PATCH] Fetch prerelease tickets for rc and final releases (#14552) Change-Id: Ifd7f515c02c41a84cfa9401b85548a47c6412463 --- .../FetchReleaseNotesTickets.java | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java index dc2a676ab8..5bb010a1d2 100644 --- a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java +++ b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java @@ -20,6 +20,7 @@ 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; @@ -33,12 +34,26 @@ public class FetchReleaseNotesTickets { + ""; // public static void main(String[] args) throws IOException { - String versions = System.getProperty("vaadin.version"); - if (versions == null || versions.equals("")) { + String versionsProperty = System.getProperty("vaadin.version"); + if (versionsProperty == null || versionsProperty.equals("")) { usage(); } String milestone = ""; - for (String version : versions.split(" ")) { + + List versions = new ArrayList(); + 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 += "&"; } @@ -48,6 +63,22 @@ public class FetchReleaseNotesTickets { printMilestone(milestone); } + private static List findPrereleaseVersions(String baseVersion) { + List versions = new ArrayList(); + + 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 { -- 2.39.5