mirror of https://github.com/apache/activemq.git
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
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1410119 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
daae3e6530
commit
b928ccbf47
|
@ -265,7 +265,7 @@
|
||||||
<tasks>
|
<tasks>
|
||||||
<echo>Running OpenWire Generator</echo>
|
<echo>Running OpenWire Generator</echo>
|
||||||
<taskdef name="generate" classname="org.apache.activemq.openwire.tool.JavaGeneratorTask" classpathref="maven.compile.classpath" />
|
<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>
|
</tasks>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -1122,7 +1122,7 @@
|
||||||
<tasks>
|
<tasks>
|
||||||
<echo>Running OpenWire Generator</echo>
|
<echo>Running OpenWire Generator</echo>
|
||||||
<taskdef name="generate" classname="org.apache.activemq.openwire.tool.JavaGeneratorTask" classpathref="maven.compile.classpath" />
|
<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>
|
</tasks>
|
||||||
</configuration>
|
</configuration>
|
||||||
<goals>
|
<goals>
|
||||||
|
|
|
@ -26,12 +26,15 @@ import org.codehaus.jam.JamServiceFactory;
|
||||||
import org.codehaus.jam.JamServiceParams;
|
import org.codehaus.jam.JamServiceParams;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class JavaGeneratorTask extends Task {
|
public class JavaGeneratorTask extends Task {
|
||||||
|
|
||||||
int version = 2;
|
int version = 2;
|
||||||
File basedir = new File(".");
|
File basedir = new File(".");
|
||||||
|
File outputdir = null;
|
||||||
|
boolean generateMarshalers = true;
|
||||||
|
boolean generateTests = true;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
@ -51,6 +54,7 @@ public class JavaGeneratorTask extends Task {
|
||||||
generator.execute();
|
generator.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void execute() throws BuildException {
|
public void execute() throws BuildException {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
@ -66,17 +70,20 @@ public class JavaGeneratorTask extends Task {
|
||||||
params.includeSourcePattern(dirs, "**/*.java");
|
params.includeSourcePattern(dirs, "**/*.java");
|
||||||
JamService jam = jamServiceFactory.createService(params);
|
JamService jam = jamServiceFactory.createService(params);
|
||||||
|
|
||||||
{
|
File outputBase = outputdir != null ? outputdir : basedir;
|
||||||
|
|
||||||
|
if (generateMarshalers) {
|
||||||
JavaMarshallingGenerator script = new JavaMarshallingGenerator();
|
JavaMarshallingGenerator script = new JavaMarshallingGenerator();
|
||||||
script.setJam(jam);
|
script.setJam(jam);
|
||||||
script.setTargetDir(basedir + "/src/main/java");
|
script.setTargetDir(outputBase + "/src/main/java");
|
||||||
script.setOpenwireVersion(version);
|
script.setOpenwireVersion(version);
|
||||||
script.run();
|
script.run();
|
||||||
}
|
}
|
||||||
{
|
|
||||||
|
if (generateTests) {
|
||||||
JavaTestsGenerator script = new JavaTestsGenerator();
|
JavaTestsGenerator script = new JavaTestsGenerator();
|
||||||
script.setJam(jam);
|
script.setJam(jam);
|
||||||
script.setTargetDir(basedir + "/src/test/java");
|
script.setTargetDir(outputBase + "/src/test/java");
|
||||||
script.setOpenwireVersion(version);
|
script.setOpenwireVersion(version);
|
||||||
script.run();
|
script.run();
|
||||||
}
|
}
|
||||||
|
@ -102,4 +109,27 @@ public class JavaGeneratorTask extends Task {
|
||||||
this.basedir = basedir;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue