ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/proposal/sandbox/dotnet/src/etc/testcases dotnetexec.xml
Date Fri, 20 Aug 2004 10:53:18 GMT
bodewig     2004/08/20 03:53:18

  Modified:    proposal/sandbox/dotnet/src/main/org/apache/tools/ant/taskdefs/optional/dotnet
                        AbstractBuildTask.java DotNetExecTask.java
                        WixTask.java
               proposal/sandbox/dotnet build.xml
               proposal/sandbox/dotnet/src/etc/testcases dotnetexec.xml
  Log:
  small refactorings
  
  Revision  Changes    Path
  1.5       +2 -7      ant/proposal/sandbox/dotnet/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/AbstractBuildTask.java
  
  Index: AbstractBuildTask.java
  ===================================================================
  RCS file: /home/cvs/ant/proposal/sandbox/dotnet/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/AbstractBuildTask.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractBuildTask.java	24 Mar 2004 15:04:19 -0000	1.4
  +++ AbstractBuildTask.java	20 Aug 2004 10:53:17 -0000	1.5
  @@ -202,13 +202,8 @@
                                        + " same time");
           }
   
  -        DotNetExecTask exec = new DotNetExecTask();
  -        if (vm != null) {
  -            exec.setVm(vm);
  -        }
  -        exec.setProject(getProject());
  -        exec.setExecutable(getExecutable());
  -        exec.setTaskName(getTaskName());
  +        DotNetExecTask exec = DotNetExecTask.getTask(this, vm, 
  +                                                     getExecutable(), null);
           String[] args = getPropertyArguments(properties);
           for (int i = 0; i < args.length; i++) {
               exec.createArg().setValue(args[i]);
  
  
  
  1.4       +32 -0     ant/proposal/sandbox/dotnet/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotNetExecTask.java
  
  Index: DotNetExecTask.java
  ===================================================================
  RCS file: /home/cvs/ant/proposal/sandbox/dotnet/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotNetExecTask.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DotNetExecTask.java	24 Mar 2004 15:04:19 -0000	1.3
  +++ DotNetExecTask.java	20 Aug 2004 10:53:18 -0000	1.4
  @@ -18,8 +18,10 @@
   package org.apache.tools.ant.taskdefs.optional.dotnet;
   
   import org.apache.tools.ant.BuildException;
  +import org.apache.tools.ant.Task;
   import org.apache.tools.ant.taskdefs.ExecTask;
   import org.apache.tools.ant.taskdefs.condition.Os;
  +import org.apache.tools.ant.types.Environment;
   
   /**
    * Specialized <exec> that knows how to deal with Mono vs. Microsoft's
  @@ -115,4 +117,34 @@
       protected final static boolean isMono(String vm) {
           return "mono".equals(vm) || "mint".equals(vm);
       }
  +
  +    /**
  +     * Creates an instance of this task based on a different tasks settings.
  +     */
  +    public static DotNetExecTask getTask(Task t, String vm, 
  +                                         String executable,
  +                                         Environment env) {
  +        DotNetExecTask exec = new DotNetExecTask();
  +        if (vm != null) {
  +            exec.setVm(vm);
  +        }
  +        exec.setProject(t.getProject());
  +        exec.setExecutable(executable);
  +        exec.setTaskName(t.getTaskName());
  +        if (env != null) {
  +            String[] environment = env.getVariables();
  +            if (environment != null) {
  +                for (int i = 0; i < environment.length; i++) {
  +                    int idx = environment[i].indexOf("=");
  +                    Environment.Variable v = new Environment.Variable();
  +                    v.setKey(environment[i].substring(0, idx));
  +                    v.setValue(environment[i].substring(idx + 1));
  +                    exec.addEnv(v);
  +                }
  +            }
  +        }
  +        
  +        return exec;
  +    }
  +
   }
  
  
  
  1.2       +2 -7      ant/proposal/sandbox/dotnet/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WixTask.java
  
  Index: WixTask.java
  ===================================================================
  RCS file: /home/cvs/ant/proposal/sandbox/dotnet/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WixTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WixTask.java	16 Apr 2004 14:17:58 -0000	1.1
  +++ WixTask.java	20 Aug 2004 10:53:18 -0000	1.2
  @@ -211,13 +211,8 @@
        * potentially adding an /out parameter.
        */
       private void run(String executable, List s, File target) {
  -        DotNetExecTask exec = new DotNetExecTask();
  -        if (vm != null) {
  -            exec.setVm(vm);
  -        }
  -        exec.setProject(getProject());
  -        exec.setExecutable(executable);
  -        exec.setTaskName(getTaskName());
  +        DotNetExecTask exec = DotNetExecTask.getTask(this, vm, 
  +                                                     executable, null);
           Iterator iter = s.iterator();
           while (iter.hasNext()) {
               File f = (File) iter.next();
  
  
  
  1.3       +1 -0      ant/proposal/sandbox/dotnet/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ant/proposal/sandbox/dotnet/build.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build.xml	24 Mar 2004 15:04:19 -0000	1.2
  +++ build.xml	20 Aug 2004 10:53:18 -0000	1.3
  @@ -71,6 +71,7 @@
         printsummary="false"
         haltonfailure="false"
         failureproperty="tests.failed"
  +      filtertrace="false"
         >
         <classpath>
           <pathelement location="${jarname}"/>
  
  
  
  1.4       +3 -2      ant/proposal/sandbox/dotnet/src/etc/testcases/dotnetexec.xml
  
  Index: dotnetexec.xml
  ===================================================================
  RCS file: /home/cvs/ant/proposal/sandbox/dotnet/src/etc/testcases/dotnetexec.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- dotnetexec.xml	24 Mar 2004 15:04:19 -0000	1.3
  +++ dotnetexec.xml	20 Aug 2004 10:53:18 -0000	1.4
  @@ -76,8 +76,9 @@
     <target name="testCSC" depends="validate_csc">
       <csc
         destFile="${testCSC.exe}"
  -      targetType="exe"
  -      />
  +      targetType="exe">
  +      <src dir="${src.dir}" includes="ex*.cs"/>
  +    </csc>
       <available property="app.created" file="${testCSC.exe}"/>
       <fail unless="app.created">No app ${testCSC.exe} created</fail>
       <dn:dotnetexec executable="${testCSC.exe}" failonerror="true" />
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message