Author: thomas.diesler(a)jboss.com
Date: 2008-05-09 02:15:22 -0400 (Fri, 09 May 2008)
New Revision: 6980
Modified:
stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/tools/MetroConsumerImpl.java
Log:
Add nocompile
Modified:
stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/tools/MetroConsumerImpl.java
===================================================================
---
stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/tools/MetroConsumerImpl.java 2008-05-08
21:11:59 UTC (rev 6979)
+++
stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/tools/MetroConsumerImpl.java 2008-05-09
06:15:22 UTC (rev 6980)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.stack.metro.tools;
+// $Id$
+
import org.jboss.wsf.spi.tools.WSContractConsumer;
import java.io.File;
@@ -36,31 +38,31 @@
*
* @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
* @author <a href="heiko.braun(a)jboss.com">Heiko Braun</a>
- * @version $Revision$
*/
public class MetroConsumerImpl extends WSContractConsumer
{
- private List<File> bindingFiles = null;
- private File catalog = null;
+ private List<File> bindingFiles = null;
+ private File catalog = null;
private boolean extension;
- private boolean generateSource = false;
- private File outputDir = new File("output");
- private File sourceDir = null;
- private String targetPackage = null;
- private PrintStream messageStream = null;
- private String wsdlLocation = null;
- private List<String> additionalCompilerClassPath = new ArrayList<String>();
+ private boolean generateSource = false;
+ private File outputDir = new File("output");
+ private File sourceDir = null;
+ private String targetPackage = null;
+ private PrintStream messageStream = null;
+ private String wsdlLocation = null;
+ private List<String> additionalCompilerClassPath = new
ArrayList<String>();
private String target = "2.0";
+ private boolean nocompile;
@Override
- public void setBindingFiles(List<File> bindingFiles) {
- this.bindingFiles = bindingFiles;
- }
+ public void setBindingFiles(List<File> bindingFiles) {
+ this.bindingFiles = bindingFiles;
+ }
- @Override
- public void setCatalog(File catalog) {
- this.catalog = catalog;
- }
+ @Override
+ public void setCatalog(File catalog) {
+ this.catalog = catalog;
+ }
@Override
public void setExtension(boolean extension)
@@ -69,102 +71,113 @@
}
@Override
- public void setGenerateSource(boolean generateSource) {
- this.generateSource = generateSource;
- }
+ public void setGenerateSource(boolean generateSource) {
+ this.generateSource = generateSource;
+ }
- @Override
- public void setMessageStream(PrintStream messageStream) {
- // TODO Auto-generated method stub
- this.messageStream = messageStream;
- }
+ @Override
+ public void setMessageStream(PrintStream messageStream) {
+ // TODO Auto-generated method stub
+ this.messageStream = messageStream;
+ }
- @Override
- public void setOutputDirectory(File directory) {
- // TODO Auto-generated method stub
- outputDir = directory;
- }
+ @Override
+ public void setOutputDirectory(File directory) {
+ // TODO Auto-generated method stub
+ outputDir = directory;
+ }
- @Override
- public void setSourceDirectory(File directory) {
- sourceDir = directory;
- }
+ @Override
+ public void setSourceDirectory(File directory) {
+ sourceDir = directory;
+ }
- @Override
- public void setTargetPackage(String targetPackage) {
- this.targetPackage = targetPackage;
- }
+ @Override
+ public void setTargetPackage(String targetPackage) {
+ this.targetPackage = targetPackage;
+ }
- @Override
- public void setWsdlLocation(String wsdlLocation) {
- this.wsdlLocation = wsdlLocation;
- }
+ @Override
+ public void setWsdlLocation(String wsdlLocation) {
+ this.wsdlLocation = wsdlLocation;
+ }
- public void setAdditionalCompilerClassPath(List<String>
additionalCompilerClassPath) {
- this.additionalCompilerClassPath = additionalCompilerClassPath;
- }
+ public void setAdditionalCompilerClassPath(List<String>
additionalCompilerClassPath) {
+ this.additionalCompilerClassPath = additionalCompilerClassPath;
+ }
@Override
- public void setTarget(String target) {
- this.target = target;
- }
+ public void setTarget(String target) {
+ this.target = target;
+ }
@Override
- public void consume(URL wsdl) {
- List<String> args = new ArrayList<String>();
- if (bindingFiles != null) {
- for (File file : bindingFiles) {
- args.add("-b");
- args.add(file.getAbsolutePath());
+ public void setNoCompile(boolean nocompile)
+ {
+ this.nocompile = nocompile;
+ }
+
+ @Override
+ public void consume(URL wsdl) {
+ List<String> args = new ArrayList<String>();
+ if (bindingFiles != null) {
+ for (File file : bindingFiles) {
+ args.add("-b");
+ args.add(file.getAbsolutePath());
- }
- }
+ }
+ }
- if (catalog != null) {
- args.add("-catalog");
- args.add(catalog.getAbsolutePath());
- }
+ if (catalog != null) {
+ args.add("-catalog");
+ args.add(catalog.getAbsolutePath());
+ }
if (extension)
{
args.add("-extension");
}
- if (generateSource) {
- args.add("-keep");
- if (sourceDir != null) {
- if (!sourceDir.exists() && !sourceDir.mkdirs())
- throw new IllegalStateException("Could not make directory: " +
sourceDir.getName());
+ if (nocompile)
+ {
+ args.add("-Xnocompile");
+ }
- args.add("-s");
- args.add(sourceDir.getAbsolutePath());
- }
- }
+ if (generateSource) {
+ args.add("-keep");
+ if (sourceDir != null) {
+ if (!sourceDir.exists() && !sourceDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " +
sourceDir.getName());
- if (targetPackage != null) {
- args.add("-p");
- args.add(targetPackage);
- }
+ args.add("-s");
+ args.add(sourceDir.getAbsolutePath());
+ }
+ }
- if (wsdlLocation != null) {
- args.add("-wsdllocation");
- args.add(wsdlLocation);
- }
+ if (targetPackage != null) {
+ args.add("-p");
+ args.add(targetPackage);
+ }
- PrintStream stream = messageStream;
- if (stream != null) {
- args.add("-verbose");
- } else {
- stream = new NullPrintStream();
- }
+ if (wsdlLocation != null) {
+ args.add("-wsdllocation");
+ args.add(wsdlLocation);
+ }
- if (!outputDir.exists() && !outputDir.mkdirs())
- throw new IllegalStateException("Could not make directory: " +
outputDir.getName());
+ PrintStream stream = messageStream;
+ if (stream != null) {
+ args.add("-verbose");
+ } else {
+ stream = new NullPrintStream();
+ }
- // Always add the output directory and the wsdl location
- args.add("-d");
- args.add(outputDir.getAbsolutePath());
+ if (!outputDir.exists() && !outputDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " +
outputDir.getName());
+ // Always add the output directory and the wsdl location
+ args.add("-d");
+ args.add(outputDir.getAbsolutePath());
+
// Always set the target
if(!target.equals("2.0"))
throw new IllegalArgumentException("WSConsume (metro) only supports JAX-WS
2.0");
@@ -187,29 +200,27 @@
}
try
- {
- // enforce woodstox
- if(null == System.getProperty("javax.xml.stream.XMLInputFactory"))
- System.setProperty("javax.xml.stream.XMLInputFactory",
"com.ctc.wstx.stax.WstxInputFactory");
+ {
+ // enforce woodstox
+ if(null == System.getProperty("javax.xml.stream.XMLInputFactory"))
+ System.setProperty("javax.xml.stream.XMLInputFactory",
"com.ctc.wstx.stax.WstxInputFactory");
- WsimportTool compileTool = new WsimportTool(stream);
- boolean success = compileTool.run(args.toArray(new String[0]));
+ WsimportTool compileTool = new WsimportTool(stream);
+ boolean success = compileTool.run(args.toArray(new String[0]));
- if(!success) throw new IllegalStateException("WsImport invocation failed");
- }
- catch (Throwable t)
- {
- if (messageStream != null)
- {
- messageStream.println("Failed to invoke WsImport");
- t.printStackTrace(messageStream);
- }
- else
- {
- t.printStackTrace();
- }
- }
-
- }
-
+ if(!success) throw new IllegalStateException("WsImport invocation
failed");
+ }
+ catch (Throwable t)
+ {
+ if (messageStream != null)
+ {
+ messageStream.println("Failed to invoke WsImport");
+ t.printStackTrace(messageStream);
+ }
+ else
+ {
+ t.printStackTrace();
+ }
+ }
+ }
}
Show replies by date