activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1410119 - in /activemq/trunk: activemq-client/pom.xml activemq-core/pom.xml activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaGeneratorTask.java
Date Fri, 16 Nov 2012 00:06:03 GMT
Author: tabish
Date: Fri Nov 16 00:06:02 2012
New Revision: 1410119

URL: http://svn.apache.org/viewvc?rev=1410119&view=rev
Log:
Update the openwire generator so it can cope with the new module layout and separation of
openwire marsahaler tests in activemq-core from the actual marshaler code in activemq-client

Modified:
    activemq/trunk/activemq-client/pom.xml
    activemq/trunk/activemq-core/pom.xml
    activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaGeneratorTask.java

Modified: activemq/trunk/activemq-client/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-client/pom.xml?rev=1410119&r1=1410118&r2=1410119&view=diff
==============================================================================
--- activemq/trunk/activemq-client/pom.xml (original)
+++ activemq/trunk/activemq-client/pom.xml Fri Nov 16 00:06:02 2012
@@ -265,7 +265,7 @@
               <tasks>
                 <echo>Running OpenWire Generator</echo>
                 <taskdef name="generate" classname="org.apache.activemq.openwire.tool.JavaGeneratorTask"
classpathref="maven.compile.classpath" />
-                <generate version="9" basedir="${basedir}" />
+                <generate version="9" basedir="${basedir}" generateTests="false"/>
               </tasks>
             </configuration>
           </plugin>

Modified: activemq/trunk/activemq-core/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/pom.xml?rev=1410119&r1=1410118&r2=1410119&view=diff
==============================================================================
--- activemq/trunk/activemq-core/pom.xml (original)
+++ activemq/trunk/activemq-core/pom.xml Fri Nov 16 00:06:02 2012
@@ -1122,7 +1122,7 @@
                   <tasks>
                     <echo>Running OpenWire Generator</echo>
                     <taskdef name="generate" classname="org.apache.activemq.openwire.tool.JavaGeneratorTask"
classpathref="maven.compile.classpath" />
-                    <generate version="9" basedir="${basedir}" />
+                    <generate version="9" outputdir="${basedir}" basedir="${basedir}/../activemq-client"
generateMarshalers="false"/>
                   </tasks>
                 </configuration>
                 <goals>

Modified: activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaGeneratorTask.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaGeneratorTask.java?rev=1410119&r1=1410118&r2=1410119&view=diff
==============================================================================
--- activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaGeneratorTask.java
(original)
+++ activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaGeneratorTask.java
Fri Nov 16 00:06:02 2012
@@ -26,12 +26,15 @@ import org.codehaus.jam.JamServiceFactor
 import org.codehaus.jam.JamServiceParams;
 
 /**
- * 
+ *
  */
 public class JavaGeneratorTask extends Task {
 
     int version = 2;
     File basedir = new File(".");
+    File outputdir = null;
+    boolean generateMarshalers = true;
+    boolean generateTests = true;
 
     public static void main(String[] args) {
 
@@ -51,6 +54,7 @@ public class JavaGeneratorTask extends T
         generator.execute();
     }
 
+    @Override
     public void execute() throws BuildException {
         try {
 
@@ -66,17 +70,20 @@ public class JavaGeneratorTask extends T
             params.includeSourcePattern(dirs, "**/*.java");
             JamService jam = jamServiceFactory.createService(params);
 
-            {
+            File outputBase = outputdir != null ? outputdir : basedir;
+
+            if (generateMarshalers) {
                 JavaMarshallingGenerator script = new JavaMarshallingGenerator();
                 script.setJam(jam);
-                script.setTargetDir(basedir + "/src/main/java");
+                script.setTargetDir(outputBase + "/src/main/java");
                 script.setOpenwireVersion(version);
                 script.run();
             }
-            {
+
+            if (generateTests) {
                 JavaTestsGenerator script = new JavaTestsGenerator();
                 script.setJam(jam);
-                script.setTargetDir(basedir + "/src/test/java");
+                script.setTargetDir(outputBase + "/src/test/java");
                 script.setOpenwireVersion(version);
                 script.run();
             }
@@ -102,4 +109,27 @@ public class JavaGeneratorTask extends T
         this.basedir = basedir;
     }
 
+    public File getOutputdir() {
+        return outputdir;
+    }
+
+    public void setOutputdir(File outputdir) {
+        this.outputdir = outputdir;
+    }
+
+    public boolean isGenerateMarshalers() {
+        return generateMarshalers;
+    }
+
+    public void setGenerateMarshalers(boolean generateMarshalers) {
+        this.generateMarshalers = generateMarshalers;
+    }
+
+    public boolean isGenerateTests() {
+        return generateTests;
+    }
+
+    public void setGenerateTests(boolean generateTests) {
+        this.generateTests = generateTests;
+    }
 }



Mime
View raw message