activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r680436 - /activemq/sandbox/zookeeper/zookeeper-jute-compiler/src/main/java/org/apache/zookeeper/version/util/VerGenMojo.java
Date Mon, 28 Jul 2008 18:29:45 GMT
Author: chirino
Date: Mon Jul 28 11:29:45 2008
New Revision: 680436

URL: http://svn.apache.org/viewvc?rev=680436&view=rev
Log:
fixing version # not getting put into Info file.

Modified:
    activemq/sandbox/zookeeper/zookeeper-jute-compiler/src/main/java/org/apache/zookeeper/version/util/VerGenMojo.java

Modified: activemq/sandbox/zookeeper/zookeeper-jute-compiler/src/main/java/org/apache/zookeeper/version/util/VerGenMojo.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/zookeeper/zookeeper-jute-compiler/src/main/java/org/apache/zookeeper/version/util/VerGenMojo.java?rev=680436&r1=680435&r2=680436&view=diff
==============================================================================
--- activemq/sandbox/zookeeper/zookeeper-jute-compiler/src/main/java/org/apache/zookeeper/version/util/VerGenMojo.java
(original)
+++ activemq/sandbox/zookeeper/zookeeper-jute-compiler/src/main/java/org/apache/zookeeper/version/util/VerGenMojo.java
Mon Jul 28 11:29:45 2008
@@ -107,8 +107,6 @@
         formater.setTimeZone(TimeZone.getTimeZone("GMT"));
         String date = formater.format(new Date());
 
-        VerGen.generateFile(outputDirectory, maj, min, micro, rev, date);
-
         // Use the svn command to figure out the revision number.
         String svnDir;
         try {
@@ -122,22 +120,25 @@
             cli.addArguments(new String[]{ "info",  svnDir});
             CommandLineUtils.StringStreamConsumer out=new CommandLineUtils.StringStreamConsumer();
             int rc = CommandLineUtils.executeCommandLine(cli, out, out);
-            getLog().debug("svn info '"+svnDir+"' rc="+rc);
+            getLog().debug("svn rc="+rc);
+            String output = out.getOutput();
+            getLog().debug("svn output="+output);
             if( rc == 0 ) {
-                String output = out.getOutput();
-                getLog().debug("svn output="+output);
                 String label = "Revision: ";
                 int pos = output.indexOf(label);
                 if( pos >= 0 ) {
                     StringTokenizer tok = new StringTokenizer(output.substring(pos+label.length()));
-                    rev = Integer.parseInt(tok.nextToken());
+                    String t = tok.nextToken();
+                    rev = Integer.parseInt(t);
                 }
             }
 
         } catch (Throwable e) {
-            getLog().warn("Unabled to determin svn revsion of directory: "+svnDir);
+            getLog().warn("Unabled to determin svn revsion of directory: "+svnDir, e);
         }
         
+        VerGen.generateFile(outputDirectory, maj, min, micro, rev, date);
+
         this.project.addCompileSourceRoot( outputDirectory.getAbsolutePath() );
     }
 



Mime
View raw message