You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/01/29 04:00:54 UTC

cvs commit: ws-axis/java/tools/org/apache/axis/tools/ant/wsdl Java2WsdlAntTask.java Wsdl2javaAntTask.java

dims        2005/01/28 19:00:54

  Modified:    java/tools/org/apache/axis/tools/ant/wsdl
                        Java2WsdlAntTask.java Wsdl2javaAntTask.java
  Log:
  allow <sysproperty> for setting for example the new axis.ws-i.bp11.compatibility flag.
  
  Revision  Changes    Path
  1.26      +20 -0     ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Java2WsdlAntTask.java
  
  Index: Java2WsdlAntTask.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Java2WsdlAntTask.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Java2WsdlAntTask.java	27 Jan 2005 00:35:36 -0000	1.25
  +++ Java2WsdlAntTask.java	29 Jan 2005 03:00:54 -0000	1.26
  @@ -24,6 +24,8 @@
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.Reference;
  +import org.apache.tools.ant.types.Environment;
  +import org.apache.tools.ant.types.CommandlineJava;
   
   import java.io.File;
   import java.io.PrintWriter;
  @@ -82,6 +84,7 @@
       private Path classpath = null;
       private String soapAction = null;
       private List complexTypes = new LinkedList();
  +    private CommandlineJava commandline = new CommandlineJava();
   
       /**
        * trace out parameters
  @@ -152,6 +155,11 @@
               }
           }
   
  +        CommandlineJava.SysProperties sysProperties =
  +                commandline.getSystemProperties();
  +        if (sysProperties != null) {
  +            sysProperties.setSystem();
  +        }
           try {
               traceParams(Project.MSG_VERBOSE);
               validate();
  @@ -241,6 +249,10 @@
               t.printStackTrace(new PrintWriter(writer));
               log(writer.getBuffer().toString(), Project.MSG_ERR);
               throw new BuildException("Error while running " + getClass().getName(), t);
  +        } finally {
  +            if (sysProperties != null) {
  +                sysProperties.restoreSystem();
  +            }
           }
       }
   
  @@ -510,4 +522,12 @@
       public void setClasspathRef(Reference r) {
           createClasspath().setRefid(r);
       }
  +
  +    /**
  +     * Adds a system property that tests can access.
  +     * @param sysp environment variable to add
  +     */
  +    public void addSysproperty(Environment.Variable sysp) {
  +        commandline.addSysproperty(sysp);
  +    }
   }
  
  
  
  1.27      +21 -0     ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java
  
  Index: Wsdl2javaAntTask.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Wsdl2javaAntTask.java	18 Jan 2005 03:38:03 -0000	1.26
  +++ Wsdl2javaAntTask.java	29 Jan 2005 03:00:54 -0000	1.27
  @@ -33,6 +33,8 @@
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.AntClassLoader;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.CommandlineJava;
  +import org.apache.tools.ant.types.Environment;
   
   /*
    * IMPORTANT: see Java2WsdlAntTask on how to javadoc this task and rebuild
  @@ -104,6 +106,7 @@
       private List nsExcludes = new ArrayList();
       private List properties = new ArrayList();
   	private String implementationClassName = null;
  +    private CommandlineJava commandline = new CommandlineJava();
   
       /**
        * do we print a stack trace when something goes wrong?
  @@ -195,6 +198,12 @@
   
           traceParams(Project.MSG_VERBOSE);
           validate();
  +        CommandlineJava.SysProperties sysProperties =
  +                commandline.getSystemProperties();
  +        if (sysProperties != null) {
  +            sysProperties.setSystem();
  +        }
  +        
           try {
               // Instantiate the emitter
               Emitter emitter = createEmitter();
  @@ -291,6 +300,10 @@
               //now throw an exception that includes the error text of the caught exception.
               throw new BuildException("WSDL processing error for "
                       + url +" :\n "+t.getMessage() , t);
  +        } finally {
  +            if (sysProperties != null) {
  +                sysProperties.restoreSystem();
  +            }
           }
   
       }
  @@ -605,5 +618,13 @@
           traceSystemSetting("socks.proxyHost", logLevel);
           traceSystemSetting("socks.proxyPort", logLevel);
       }
  +
  +    /**
  +     * Adds a system property that tests can access.
  +     * @param sysp environment variable to add
  +     */
  +    public void addSysproperty(Environment.Variable sysp) {
  +        commandline.addSysproperty(sysp);
  +    }
   }