tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1237535 - in /openejb/trunk/sandbox/release-tools/src/main: java/org/apache/openejb/tools/release/ java/org/apache/openejb/tools/release/cmd/ java/org/apache/openejb/tools/release/util/ resources/
Date Mon, 30 Jan 2012 02:53:36 GMT
Author: dblevins
Date: Mon Jan 30 02:53:35 2012
New Revision: 1237535

URL: http://svn.apache.org/viewvc?rev=1237535&view=rev
Log:
Slight refactoring.  Tweaked the version update code and used it on trunk

Added:
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AdvanceVersions.java
      - copied, changed from r1237134, openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/util/ObjectMap.java
    openejb/trunk/sandbox/release-tools/src/main/resources/promote.txt
Modified:
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/Release.java
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AddVersion.java
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CloseJiras.java
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Deploy.java
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/ReviewCommits.java
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tag.java
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tck.java
    openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java
    openejb/trunk/sandbox/release-tools/src/main/resources/release-notes.vm

Modified: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/Release.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/Release.java?rev=1237535&r1=1237534&r2=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/Release.java
(original)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/Release.java
Mon Jan 30 02:53:35 2012
@@ -16,59 +16,189 @@
  */
 package org.apache.openejb.tools.release;
 
-import com.sun.xml.internal.bind.v2.runtime.Location;
 import org.apache.openejb.tools.release.util.Files;
+import org.apache.openejb.tools.release.util.ObjectMap;
 import org.apache.openejb.tools.release.util.Options;
 
 import java.io.File;
-import java.lang.reflect.Field;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * @version $Rev$ $Date$
  */
 public class Release {
 
-    public static String openejbSimpleVersion = "4.0.0-beta-2";
-    public static String tomeeSimpleVersion = "1.0.0-beta-2";
-    public static String openejbVersion = "openejb-" + openejbSimpleVersion;
-    public static String tomeeVersion = "tomee-" + tomeeSimpleVersion;
+    public static String openejbVersion = "4.0.0-beta-2";
+    public static String tomeeVersion = "1.0.0-beta-2";
+
+    public static String openejbVersionName = "openejb-${openejbVersion}";
+    public static String tomeeVersionName = "tomee-${tomeeVersion}";
 
     public static String trunk = "https://svn.apache.org/repos/asf/openejb/trunk/openejb/";
     public static String branches = "https://svn.apache.org/repos/asf/openejb/branches/";
     public static String tags = "https://svn.apache.org/repos/asf/openejb/tags/";
     public static String tckBranches = "https://svn.apache.org/repos/tck/openejb-tck/branches/";
     public static String tckTrunk = "https://svn.apache.org/repos/tck/openejb-tck/trunk";
-    public static String staging = "https://repository.apache.org/content/repositories/orgapacheopenejb-075";
+
+    public static String staging = "https://repository.apache.org/content/repositories/orgapacheopenejb-${build}";
+    public static String build = "075";
+
+
     public static String builddir = "/tmp/downloads";
     public static String workdir = "/tmp/release";
+
     public static String mavenOpts = "-Xmx2048m -XX:MaxPermSize=1024m";
-    public static String from = "dblevins@apache.org";
-    //    public static String to = from;
-    public static String to = "dev@openejb.apache.org";
+
     public static String user = System.getProperty("user.name");
-    public static String build = "075";
+    public static String to = "dev@openejb.apache.org";
+    public static String from = "${user}@apache.org";
+
     public static String lastReleaseDate = "2011-10-05";
 
+    private static final Pattern PATTERN = Pattern.compile("(\\$\\{)(\\w+)(})");
+
+
     static {
         final File public_html = Files.file(System.getProperty("user.home"), "public_html");
 
-        if (public_html.exists())  {
+        if (public_html.exists()) {
             builddir = public_html.getAbsolutePath();
         }
 
         final Options options = new Options(System.getProperties());
 
-        for (Field field : Release.class.getFields()) {
-            try {
-                final Object value = options.get(field.getName(), field.get(null));
-                field.set(null, value);
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();
+        final Map<String, Object> map = map();
+
+        boolean interpolating = true;
+        while (interpolating) {
+            interpolating = false;
+            for (Map.Entry<String, Object> entry : map.entrySet()) {
+                final Object value = options.get(entry.getKey(), entry.getValue());
+
+                final String raw = value.toString();
+                final String formatted = format(raw, map);
+                if (!raw.equals(formatted)) interpolating = true;
+
+                entry.setValue(formatted);
             }
         }
+    }
+
+    public static void main(String[] args) {
+        for (Map.Entry<String, Object> entry : map().entrySet()) {
+            System.out.printf("%s = %s\n", entry.getKey(), entry.getValue());
+        }
+    }
 
-        build = Release.staging.replaceAll(".*-", "");
+    static String format(String input, Map<String, Object> map) {
+        Matcher matcher = PATTERN.matcher(input);
+        StringBuffer buf = new StringBuffer();
+        while (matcher.find()) {
+            String key = matcher.group(2);
+            Object value = map.get(key);
+            if (value != null) {
+                try {
+                    matcher.appendReplacement(buf, value.toString());
+                } catch (Exception e) {
+                }
+            }
+        }
+        matcher.appendTail(buf);
+        return buf.toString();
     }
 
+    public static Map<String, Object> map() {
+        return new ObjectMap(Release.class);
+
+
+
+//        @Override
+//        public int size() {
+//            return clazz.getFields().length;
+//        }
+//
+//        @Override
+//        public boolean isEmpty() {
+//            return false;
+//        }
+//
+//        @Override
+//        public boolean containsKey(Object key) {
+//            try {
+//                clazz.getField(key.toString());
+//                return true;
+//            } catch (NoSuchFieldException e) {
+//                return false;
+//            }
+//        }
+//
+//        @Override
+//        public boolean containsValue(Object value) {
+//            return false;
+//        }
+//
+//        @Override
+//        public Object get(Object key) {
+//            try {
+//                final Field field = clazz.getField(key.toString());
+//                return field.get(object);
+//            } catch (Exception e) {
+//                return null;
+//            }
+//        }
+//
+//        @Override
+//        public Object put(String key, Object value) {
+//            try {
+//                final Object original = get(key);
+//
+//                final Field field = clazz.getField(key);
+//                field.set(object, value);
+//
+//                return original;
+//            } catch (Exception e) {
+//                return null;
+//            }
+//        }
+//
+//        @Override
+//        public String remove(Object key) {
+//            throw new UnsupportedOperationException();
+//        }
+//
+//        @Override
+//        public void putAll(Map<? extends String, ? extends Object> m) {
+//            for (Map.Entry<? extends String, ? extends Object> entry : m.entrySet())
{
+//                put(entry.getKey(), entry.getValue());
+//            }
+//        }
+//
+//        @Override
+//        public void clear() {
+//            throw new UnsupportedOperationException();
+//        }
+//
+//        @Override
+//        public Set<String> keySet() {
+//            return null;
+//        }
+//
+//        @Override
+//        public Collection<Object> values() {
+//            return null;
+//        }
+//
+//        @Override
+//        public Set<Map.Entry<String, Object>> entrySet() {
+//            return null;
+//        }
+//
+//        public static class FieldSet implements Set<Map.Entry<String, Object>>
{
+//
+//        }
+    }
 
 }

Modified: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AddVersion.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AddVersion.java?rev=1237535&r1=1237534&r2=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AddVersion.java
(original)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AddVersion.java
Mon Jan 30 02:53:35 2012
@@ -72,12 +72,12 @@ public class AddVersion {
             replaceSnapshot = true;
         }
 
-        final File workingDir = new File(Release.builddir, Release.openejbVersion);
+        final File workingDir = new File(Release.builddir, Release.openejbVersionName);
         final String[][] replacements = new String[][] {
-                new String[] { currentVersion(Release.openejbSimpleVersion, replaceSnapshot),
-                                nextVersion("openejb next version", Release.openejbSimpleVersion,
replaceSnapshot, setSnapshot) },
-                new String[] { currentVersion(Release.tomeeSimpleVersion, replaceSnapshot),
-                                nextVersion("openejb next version", Release.tomeeSimpleVersion,
replaceSnapshot, setSnapshot) }
+                new String[] { currentVersion(Release.openejbVersion, replaceSnapshot),
+                                nextVersion("openejb next version", Release.openejbVersion,
replaceSnapshot, setSnapshot) },
+                new String[] { currentVersion(Release.tomeeVersion, replaceSnapshot),
+                                nextVersion("openejb next version", Release.tomeeVersion,
replaceSnapshot, setSnapshot) }
         };
 
         // we hardcode the tomee or openejb version in some java, properties, pom (of course
;))...so simply take eveything we can

Copied: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AdvanceVersions.java
(from r1237134, openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java)
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AdvanceVersions.java?p2=openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AdvanceVersions.java&p1=openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java&r1=1237134&r2=1237535&rev=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java
(original)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AdvanceVersions.java
Mon Jan 30 02:53:35 2012
@@ -21,12 +21,16 @@ import org.apache.openejb.tools.release.
 import org.apache.openejb.tools.release.util.Files;
 import org.apache.openejb.tools.release.util.IO;
 import org.codehaus.swizzle.stream.ReplaceStringInputStream;
+import org.codehaus.swizzle.stream.StreamLexer;
 
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import static java.lang.String.format;
 import static org.apache.openejb.tools.release.util.Exec.cd;
@@ -37,31 +41,52 @@ import static org.apache.openejb.tools.r
  * @version $Rev$ $Date$
  */
 @Command(dependsOn = Close.class)
-public class UpdateVersions {
+public class AdvanceVersions {
 
     public static void main(String... args) throws Exception {
 
-        final File dir = new File("/tmp/release/branch");
+        final File dir = new File(Release.workdir);
         Files.mkdir(dir);
 
         cd(dir);
 
-        final String branch = Release.branches + Release.openejbVersion;
+        exec("svn", "co", Release.trunk);
 
-        // Make the branch
-        if (exec("svn", "info", branch) != 0) {
+        final File workingCopy = cd(new File(dir + File.separator + "openejb"));
 
-            exec("svn", "-m", format("[release-tools] tck branch for %s", Release.openejbVersion),
"cp", Release.trunk, branch);
+        final Set<String> versions = collectVersions(workingCopy);
+
+        for (String version : versions) {
+            System.out.println(version);
         }
 
-        // Checkout the branch
-        exec("svn", "co", branch);
+        updateVersions(workingCopy);
 
-        final File workingCopy = cd(new File(dir + "/" + Release.openejbVersion));
+//        exec("svn", "-m", "[release-tools] update staging repo for " + Release.openejbVersionName,
"ci");
+    }
 
-        updateVersions(workingCopy);
+    private static Set<String> collectVersions(File workingCopy) throws IOException
{
+        Set<String> versions = new HashSet<String>();
+
+
+        final List<File> files = collect(workingCopy, ".*pom.xml");
 
-        exec("svn", "-m", "[release-tools] update staging repo for " + Release.openejbVersion,
"ci");
+        for (File file : files) {
+            final InputStream read = IO.read(file);
+            final StreamLexer lexer = new StreamLexer(read);
+
+            while (lexer.readAndMark("<dependency>", "</dependency>")) {
+                final String groupId = lexer.peek("<groupId>", "</groupId>");
+                final String artifactId = lexer.peek("<artifactId>", "</artifactId>");
+                final String version = lexer.peek("<version>", "</version>");
+                lexer.unmark();
+                if (version != null && version.contains("-SNAPSHOT")) versions.add(String.format("%s:%s:%s",
groupId, artifactId, version));
+            }
+
+            read.close();
+        }
+
+        return versions;
     }
 
     private static void updateVersions(File workingCopy) throws IOException {
@@ -72,8 +97,12 @@ public class UpdateVersions {
         for (File file : files) {
             InputStream in = IO.read(file);
 
-            in = new ReplaceStringInputStream(in, "1.0.0-beta-2-SNAPSHOT", "1.0.0-beta-3-SNAPSHOT");
+            in = new ReplaceStringInputStream(in, "4.0.0-beta-2-SNAPSHOT-SNAPSHOT", "4.0.0-beta-3-SNAPSHOT");
             in = new ReplaceStringInputStream(in, "4.0.0-beta-2-SNAPSHOT", "4.0.0-beta-3-SNAPSHOT");
+            in = new ReplaceStringInputStream(in, "1.0.0-beta-2-SNAPSHOT", "1.0.0-beta-3-SNAPSHOT");
+            in = new ReplaceStringInputStream(in, "6.0-3-SNAPSHOT", "6.0-3");
+            in = new ReplaceStringInputStream(in, "1.3-SNAPSHOT", "1.2");
+            in = new ReplaceStringInputStream(in, "2.5.1-SNAPSHOT", "2.5.1");
 
             update(file, in);
         }

Modified: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java?rev=1237535&r1=1237534&r2=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java
(original)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java
Mon Jan 30 02:53:35 2012
@@ -34,7 +34,7 @@ public class Binaries {
     public static void main(String[] args) throws Exception {
         final NexusClient client = new NexusClient();
 
-        final File dir = Files.file(Release.builddir, "staging-" + Release.build, Release.openejbVersion);
+        final File dir = Files.file(Release.builddir, "staging-" + Release.build, Release.openejbVersionName);
         final URI repo = URI.create(Release.staging);
 
         System.out.println("Downloads: " + dir.getAbsolutePath());

Modified: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CloseJiras.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CloseJiras.java?rev=1237535&r1=1237534&r2=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CloseJiras.java
(original)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CloseJiras.java
Mon Jan 30 02:53:35 2012
@@ -33,7 +33,6 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.sql.SQLOutput;
 import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -54,7 +53,7 @@ public class CloseJiras {
 
     public static void main(String... args) throws Exception {
 
-        final String tag = Release.tags + Release.openejbVersion;
+        final String tag = Release.tags + Release.openejbVersionName;
 
         final InputStream in = Exec.read("svn", "log", "--verbose", "--xml", "-rHEAD:{" +
Release.lastReleaseDate + "}", tag);
 
@@ -111,9 +110,9 @@ public class CloseJiras {
 
             final Version version;
             if (issue.getKey().startsWith("TOMEE-")) {
-                version = state.jira.getVersion("TOMEE", ReviewCommits.v(Release.tomeeVersion));
+                version = state.jira.getVersion("TOMEE", Release.tomeeVersion);
             } else if (issue.getKey().startsWith("OPENEJB-")) {
-                version = state.jira.getVersion("OPENEJB", ReviewCommits.v(Release.openejbVersion));
+                version = state.jira.getVersion("OPENEJB", Release.openejbVersion);
             } else {
                 continue;
             }

Modified: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Deploy.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Deploy.java?rev=1237535&r1=1237534&r2=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Deploy.java
(original)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Deploy.java
Mon Jan 30 02:53:35 2012
@@ -35,7 +35,7 @@ public class Deploy {
 
         // TODO Look for gpg on the path, report error if not found
 
-        final String tag = Release.tags + Release.openejbVersion;
+        final String tag = Release.tags + Release.openejbVersionName;
 
         final File dir = new File(Release.workdir);
         Files.mkdir(dir);
@@ -43,7 +43,7 @@ public class Deploy {
 
         Exec.exec("svn", "co", tag);
 
-        Exec.cd(new File(dir + File.separator + Release.openejbVersion));
+        Exec.cd(new File(dir + File.separator + Release.openejbVersionName));
 
         Exec.export("MAVEN_OPTS", Release.mavenOpts);
         Exec.exec("mvn",

Modified: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/ReviewCommits.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/ReviewCommits.java?rev=1237535&r1=1237534&r2=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/ReviewCommits.java
(original)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/ReviewCommits.java
Mon Jan 30 02:53:35 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.openejb.tools.release.cmd;
 
-import com.sun.org.apache.regexp.internal.RE;
 import org.apache.openejb.tools.release.Command;
 import org.apache.openejb.tools.release.Commit;
 import org.apache.openejb.tools.release.Release;
@@ -28,7 +27,6 @@ import org.codehaus.swizzle.jira.Issue;
 import org.codehaus.swizzle.jira.IssueType;
 import org.codehaus.swizzle.jira.Jira;
 import org.codehaus.swizzle.jira.MapObject;
-import org.codehaus.swizzle.jira.MapObjectList;
 import org.codehaus.swizzle.jira.Version;
 
 import javax.xml.bind.JAXBContext;
@@ -40,7 +38,6 @@ import java.io.InputStreamReader;
 import java.lang.reflect.Field;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -55,7 +52,7 @@ public class ReviewCommits {
 
     public static void main(String... args) throws Exception {
 
-        final String tag = Release.tags + Release.openejbVersion;
+        final String tag = Release.tags + Release.openejbVersionName;
 
         final InputStream in = Exec.read("svn", "log", "--verbose", "--xml", "-rHEAD:{" +
Release.lastReleaseDate + "}", tag);
 
@@ -70,7 +67,7 @@ public class ReviewCommits {
         for (Commit commit : commits) {
             final String[] tokens = commit.getMessage().split("[^A-Z0-9-]+");
             for (String token : tokens) {
-                if (token.matches("(OPENEJB|TOMEE)-[0-9]+")){
+                if (token.matches("(OPENEJB|TOMEE)-[0-9]+")) {
                     try {
                         addIssue(getJira().getIssue(token));
                     } catch (Exception e) {
@@ -223,7 +220,7 @@ public class ReviewCommits {
 
                     final String summary = prompt("summary");
                     final String project = prompt("TOMEE");
-                    final String version = prompt("TOMEE".equals(project)?v(Release.tomeeVersion):
v(Release.openejbVersion));
+                    final String version = prompt("TOMEE".equals(project) ? Release.tomeeVersion
: Release.openejbVersion);
                     final String type = prompt("Improvement").toLowerCase();
 
                     Issue issue = new Issue();

Modified: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tag.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tag.java?rev=1237535&r1=1237534&r2=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tag.java
(original)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tag.java
Mon Jan 30 02:53:35 2012
@@ -30,14 +30,14 @@ public class Tag {
 
     public static void main(String... args) throws Exception {
 
-        final String branch = Release.branches + Release.openejbVersion;
-        final String tag = Release.tags + Release.openejbVersion;
+        final String branch = Release.branches + Release.openejbVersionName;
+        final String tag = Release.tags + Release.openejbVersionName;
 
         if (exec("svn", "info", tag) == 0) {
-            exec("svn", "-m", format("[release-tools] recreating tag for %s", Release.openejbVersion),
"rm", tag);
+            exec("svn", "-m", format("[release-tools] recreating tag for %s", Release.openejbVersionName),
"rm", tag);
         }
 
-        exec("svn", "-m", format("[release-tools] creating tag for %s", Release.openejbVersion),
"cp", branch, tag);
+        exec("svn", "-m", format("[release-tools] creating tag for %s", Release.openejbVersionName),
"cp", branch, tag);
     }
 
 }

Modified: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tck.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tck.java?rev=1237535&r1=1237534&r2=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tck.java
(original)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tck.java
Mon Jan 30 02:53:35 2012
@@ -48,24 +48,24 @@ public class Tck {
 
         cd(dir);
 
-        final String branch = Release.tckBranches + Release.tomeeVersion;
+        final String branch = Release.tckBranches + Release.tomeeVersionName;
 
         // Make the branch
         if (exec("svn", "info", branch) != 0) {
 
-            exec("svn", "-m", format("[release-tools] tck branch for %s", Release.tomeeVersion),
"cp", Release.tckTrunk.toString(), branch);
+            exec("svn", "-m", format("[release-tools] tck branch for %s", Release.tomeeVersionName),
"cp", Release.tckTrunk.toString(), branch);
         }
 
         // Checkout the branch
         exec("svn", "co", branch);
 
-        final File tck = cd(new File(dir + "/" + Release.tomeeVersion));
+        final File tck = cd(new File(dir + "/" + Release.tomeeVersionName));
 
         updatePom(Release.staging, new File(tck, "pom.xml"));
 
-        updateWebProfile(branch, tck, Release.tomeeVersion);
+        updateWebProfile(branch, tck, Release.tomeeVersionName);
 
-        exec("svn", "-m", "[release-tools] update staging repo for " + Release.tomeeVersion,
"ci");
+        exec("svn", "-m", "[release-tools] update staging repo for " + Release.tomeeVersionName,
"ci");
     }
 
     private static void updateWebProfile(final String branch, final File dir, String version)
throws IOException {

Modified: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java?rev=1237535&r1=1237534&r2=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java
(original)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java
Mon Jan 30 02:53:35 2012
@@ -46,22 +46,22 @@ public class UpdateVersions {
 
         cd(dir);
 
-        final String branch = Release.branches + Release.openejbVersion;
+        final String branch = Release.branches + Release.openejbVersionName;
 
         // Make the branch
         if (exec("svn", "info", branch) != 0) {
 
-            exec("svn", "-m", format("[release-tools] tck branch for %s", Release.openejbVersion),
"cp", Release.trunk, branch);
+            exec("svn", "-m", format("[release-tools] tck branch for %s", Release.openejbVersionName),
"cp", Release.trunk, branch);
         }
 
         // Checkout the branch
         exec("svn", "co", branch);
 
-        final File workingCopy = cd(new File(dir + "/" + Release.openejbVersion));
+        final File workingCopy = cd(new File(dir + "/" + Release.openejbVersionName));
 
         updateVersions(workingCopy);
 
-        exec("svn", "-m", "[release-tools] update staging repo for " + Release.openejbVersion,
"ci");
+        exec("svn", "-m", "[release-tools] update staging repo for " + Release.openejbVersionName,
"ci");
     }
 
     private static void updateVersions(File workingCopy) throws IOException {

Added: openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/util/ObjectMap.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/util/ObjectMap.java?rev=1237535&view=auto
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/util/ObjectMap.java
(added)
+++ openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/util/ObjectMap.java
Mon Jan 30 02:53:35 2012
@@ -0,0 +1,184 @@
+/*
+ * 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.openejb.tools.release.util;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.AbstractMap;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+* @version $Rev$ $Date$
+*/
+public class ObjectMap extends AbstractMap<String, Object> {
+
+    private final Object object;
+    private Map<String,Entry<String,Object>> attributes;
+    private Set<Entry<String,Object>> entries;
+
+    public ObjectMap(Object object) {
+        this(object.getClass(), object);
+    }
+
+    public ObjectMap(Class clazz) {
+        this(clazz, null);
+    }
+
+    public ObjectMap(Class<?> clazz, Object object) {
+        this.object = object;
+
+        attributes = new HashMap<String, Entry<String, Object>>();
+
+        for (Field field : clazz.getFields()) {
+            final FieldEntry entry = new FieldEntry(field);
+            attributes.put(entry.getKey(), entry);
+        }
+
+        for (Method getter : clazz.getMethods()) {
+            try {
+                if (getter.getName().startsWith("get")) continue;
+                if (getter.getParameterTypes().length != 0) continue;
+
+
+                final String name = getter.getName().replaceFirst("get", "set");
+                final Method setter = clazz.getMethod(name, getter.getReturnType());
+
+                final MethodEntry entry = new MethodEntry(getter, setter);
+
+                attributes.put(entry.getKey(), entry);
+            } catch (NoSuchMethodException e) {
+            }
+        }
+
+        entries = Collections.unmodifiableSet(new HashSet<Entry<String, Object>>(attributes.values()));
+    }
+
+    @Override
+    public Object get(Object key) {
+        final Entry<String, Object> entry = attributes.get(key);
+        if (entry == null) return null;
+        return entry.getValue();
+    }
+
+    @Override
+    public Object put(String key, Object value) {
+        final Entry<String, Object> entry = attributes.get(key);
+        if (entry == null) return null;
+        return entry.setValue(value);
+    }
+
+    @Override
+    public boolean containsKey(Object key) {
+        return attributes.containsKey(key);
+    }
+
+    @Override
+    public Object remove(Object key) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Set<Entry<String, Object>> entrySet() {
+        return entries;
+    }
+
+    public class FieldEntry implements Entry<String, Object>  {
+
+        private final Field field;
+
+        public FieldEntry(Field field) {
+            this.field = field;
+        }
+
+        @Override
+        public String getKey() {
+            return field.getName();
+        }
+
+        @Override
+        public String getValue() {
+            try {
+                return (String) field.get(object);
+            } catch (IllegalAccessException e) {
+                throw new IllegalStateException(e);
+            }
+        }
+
+        @Override
+        public Object setValue(Object value) {
+            try {
+                final Object replaced = getValue();
+                field.set(object, value);
+                return replaced;
+            } catch (IllegalAccessException e) {
+                throw new IllegalArgumentException(e);
+            }
+        }
+    }
+
+    public class MethodEntry implements Entry<String, Object> {
+        private final String key;
+        private final Method getter;
+        private final Method setter;
+
+        public MethodEntry(Method getter, Method setter) {
+            StringBuilder name = new StringBuilder(getter.getName());
+
+            // remove 'set' or 'get'
+            name.delete(0, 3);
+
+            // lowercase first char
+            name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
+
+            this.key = name.toString();
+            this.getter = getter;
+            this.setter = setter;
+        }
+
+        protected Object invoke(Method method, Object... args) {
+            try {
+                return method.invoke(object, args);
+            } catch (IllegalAccessException e) {
+                throw new IllegalStateException(e);
+            } catch (InvocationTargetException e) {
+                throw new RuntimeException(e.getCause());
+            }
+        }
+
+        @Override
+        public String getKey() {
+            return key;
+        }
+
+        @Override
+        public Object getValue() {
+            return invoke(getter);
+        }
+
+        @Override
+        public Object setValue(Object value) {
+            final Object original = getValue();
+            invoke(setter, value);
+            return original;
+        }
+    }
+}

Added: openejb/trunk/sandbox/release-tools/src/main/resources/promote.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/resources/promote.txt?rev=1237535&view=auto
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/resources/promote.txt (added)
+++ openejb/trunk/sandbox/release-tools/src/main/resources/promote.txt Mon Jan 30 02:53:35
2012
@@ -0,0 +1,30 @@
+Request URL:https://repository.apache.org/service/local/staging/bulk/promote?undefined
+Request Method:POST
+Status Code:201 Created
+Request Headersview source
+Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
+Accept-Encoding:gzip,deflate,sdch
+Accept-Language:en-US,en;q=0.8
+Authorization:Basic ZGJsZXZpbnM6U24wd21hbmE=
+Connection:keep-alive
+Content-Length:82
+Content-Type:application/json
+Cookie:JSESSIONID=a61ffb19-350f-46e3-a405-7bf2e91dde55
+Host:repository.apache.org
+Origin:https://repository.apache.org
+Referer:https://repository.apache.org/index.html
+User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like
Gecko) Chrome/16.0.912.75 Safari/535.7
+X-Requested-With:XMLHttpRequest
+accept:application/json
+Query String Parametersview URL encoded
+undefined:
+Request Payload
+{"data":{"stagedRepositoryIds":["orgapacheopenejb-075"],"description":"finished"}}
+Response Headersview source
+Connection:Keep-Alive
+Content-Length:0
+Content-Type:text/plain
+Date:Mon, 23 Jan 2012 11:33:57 GMT
+Keep-Alive:timeout=15, max=100
+Server:Noelios-Restlet-Engine/1.1.6-SONATYPE-5348-V4
+Via:1.1 repository.apache.org

Modified: openejb/trunk/sandbox/release-tools/src/main/resources/release-notes.vm
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/resources/release-notes.vm?rev=1237535&r1=1237534&r2=1237535&view=diff
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/resources/release-notes.vm (original)
+++ openejb/trunk/sandbox/release-tools/src/main/resources/release-notes.vm Mon Jan 30 02:53:35
2012
@@ -3,14 +3,20 @@
 #set( $upgrades = $upgrades.add("TOMEE", ["1.0.0-beta-2"]) )
 #set( $upgrades = $upgrades.add("OPENEJB", ["4.0.0-beta-2"]) )
 #set( $upgrades = $upgrades.add("OWB", ["1.1.2", "1.1.3"]) )
-#set( $upgrades = $upgrades.add("AMQ", ["5.4.3", "5.5.0", "5.5.1"]) )
-#set( $upgrades = $upgrades.add("CXF", ["2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.5", "2.5.1"])
)
+###set( $upgrades = $upgrades.add("AMQ", ["5.4.3", "5.5.0", "5.5.1"]) )
+###set( $upgrades = $upgrades.add("CXF", ["2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.5", "2.5.1"])
)
 #set( $issues = $upgrades.issues.unique("key") )
 
 Apache TomEE $version
 
 $date
 
+Upgrades:
+
+#foreach ( $issue in $issues.equals("type", "Dependency upgrade") )
+  * [$issue.key] $issue.summary
+#end
+
 New Features:
 
 #foreach ( $issue in $issues.equals("type", "New Feature") )



Mime
View raw message