cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r514555 - in /incubator/cxf/trunk: distribution/src/main/release/samples/common_build.xml tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java
Date Mon, 05 Mar 2007 05:55:15 GMT
Author: mmao
Date: Sun Mar  4 21:55:14 2007
New Revision: 514555

URL: http://svn.apache.org/viewvc?view=rev&rev=514555
Log:
wsdl2java will exit with properly return code when set the exitOnFinish property, default
to false.

Modified:
    incubator/cxf/trunk/distribution/src/main/release/samples/common_build.xml
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/common_build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/common_build.xml?view=diff&rev=514555&r1=514554&r2=514555
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/common_build.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/common_build.xml Sun Mar  4
21:55:14 2007
@@ -200,6 +200,7 @@
                     <path refid="cxf.classpath" />
                 </classpath>
                 <sysproperty key="java.util.logging.config.file" value="${cxf.etc.dir}/logging.properties"/>
+                <sysproperty key="exitOnFinish" value="true"/>
                 <arg line="${package.arg.@{file}}"/>
                 <arg line="${binding.arg}"/>
                 <arg value="-verbose"/>

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java?view=diff&rev=514555&r1=514554&r2=514555
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java
Sun Mar  4 21:55:14 2007
@@ -27,6 +27,7 @@
 import java.util.Set;
 
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.tools.common.AbstractCXFToolContainer;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
@@ -93,12 +94,21 @@
             if (isVerboseOn()) {
                 ex.printStackTrace();
             }
+            if (exitOnFinish) {
+                System.exit(1);
+            }
         } catch (Exception ex) {
             System.err.println("Error : " + ex.getMessage());
             System.err.println();
             if (isVerboseOn()) {
                 ex.printStackTrace();
             }
+            if (exitOnFinish) {
+                System.exit(1);
+            }
+        }
+        if (exitOnFinish) {
+            System.exit(0);
         }
     }
 
@@ -211,14 +221,23 @@
         env.put(ToolConstants.CFG_ANT_PROP, props);
     }
 
+    private static boolean isExitOnFinish() {
+        String exit = System.getProperty("exitOnFinish");
+        if (StringUtils.isEmpty(exit)) {
+            return false;
+        }
+        return "YES".equalsIgnoreCase(exit) || "TRUE".equalsIgnoreCase(exit);
+    }
+    
     public static void main(String[] pargs) {
         args = pargs;
-
         try {
             ToolRunner.runTool(WSDLToJava.class,
                                getResourceAsStream("wsdl2java.xml"),
                                false,
-                               args);
+                               args,
+                               isExitOnFinish(),
+                               null);
         } catch (BadUsageException ex) {
             getInstance().printUsageException(TOOL_NAME, ex);
         } catch (Exception ex) {



Mime
View raw message