ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types Commandline.java
Date Sun, 27 Jan 2002 02:31:49 GMT
donaldp     02/01/26 18:31:49

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        Java.java Patch.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers
                        DefaultCompilerAdapter.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec
                        Execute2.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc
                        Javadoc.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
                        ANTLR.java Cab.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ccm
                        Continuus.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/clearcase
                        ClearCase.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet
                        NetCommand.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        BorlandDeploymentTool.java
                        BorlandGenerateClient.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc
                        JJTree.java JavaCC.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend
                        JDependTask.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTask.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata
                        AbstractMetamataTask.java MParse.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce
                        P4Base.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/pvcs
                        Pvcs.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka
                        CovMerge.java CovReport.java Coverage.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss
                        MSVSS.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix
                        Rpm.java
               proposal/myrmidon/src/main/org/apache/tools/ant/types
                        Commandline.java
  Log:
  Made Execute2 only take Commandlin objects rather than an arrya of strings
  
  Revision  Changes    Path
  1.26      +4 -4      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java
  
  Index: Java.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Java.java	20 Jan 2002 17:35:00 -0000	1.25
  +++ Java.java	27 Jan 2002 02:31:47 -0000	1.26
  @@ -11,11 +11,11 @@
   import java.io.IOException;
   import java.io.PrintStream;
   import java.util.ArrayList;
  -import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.AbstractTask;
  -
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.taskdefs.exec.Execute2;
   import org.apache.tools.ant.types.Argument;
  +import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.EnvironmentVariable;
   import org.apache.tools.ant.types.Path;
  @@ -159,7 +159,7 @@
           {
               getLogger().debug( "Forking " + m_cmdl.toString() );
   
  -            return run( m_cmdl.getCommandline() );
  +            return run( new Commandline( m_cmdl.getCommandline() ) );
           }
           else
           {
  @@ -214,7 +214,7 @@
       /**
        * Executes the given classname with the given arguments in a separate VM.
        */
  -    private int run( final String[] command )
  +    private int run( final Commandline command )
           throws TaskException
       {
           final Execute2 exe = new Execute2();
  
  
  
  1.15      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Patch.java
  
  Index: Patch.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Patch.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Patch.java	20 Jan 2002 02:36:20 -0000	1.14
  +++ Patch.java	27 Jan 2002 02:31:47 -0000	1.15
  @@ -113,7 +113,7 @@
           setupLogger( exe );
   
           final Commandline cmd = buildCommand();
  -        exe.setCommandline( cmd.getCommandline() );
  +        exe.setCommandline( cmd );
   
           try
           {
  
  
  
  1.27      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- DefaultCompilerAdapter.java	20 Jan 2002 09:52:38 -0000	1.26
  +++ DefaultCompilerAdapter.java	27 Jan 2002 02:31:47 -0000	1.27
  @@ -363,7 +363,8 @@
                   final Execute2 exe = new Execute2();
                   setupLogger( exe );
                   exe.setWorkingDirectory( m_baseDir );
  -                exe.setCommandline( commandArray );
  +                final String[] commandline = commandArray;
  +                exe.setCommandline( new Commandline( commandline ) );
                   return exe.execute();
               }
               catch( IOException e )
  
  
  
  1.4       +7 -9      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute2.java
  
  Index: Execute2.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute2.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Execute2.java	26 Jan 2002 04:53:53 -0000	1.3
  +++ Execute2.java	27 Jan 2002 02:31:47 -0000	1.4
  @@ -19,6 +19,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.factorys.ExecManagerFactory;
   import org.apache.myrmidon.services.ServiceException;
  +import org.apache.tools.ant.types.Commandline;
   
   /**
    * Runs an external program.
  @@ -28,18 +29,13 @@
   public class Execute2
       extends AbstractLogEnabled
   {
  -    private String[] m_command;
  +    private Commandline m_command;
       private Properties m_environment = new Properties();
       private File m_workingDirectory = new File( "." );
       private boolean m_newEnvironment;
       private ExecOutputHandler m_handler;
       private long m_timeout;
   
  -    /**
  -     * Controls whether the VM is used to launch commands, where possible
  -     */
  -    private boolean m_useVMLauncher = true;
  -
       public void setTimeout( final long timeout )
       {
           m_timeout = timeout;
  @@ -55,9 +51,9 @@
        *
        * @param commandline the commandline of the subprocess to launch
        */
  -    public void setCommandline( final String[] commandline )
  +    public void setCommandline( final Commandline command )
       {
  -        m_command = commandline;
  +        m_command = command;
       }
   
       public void setEnvironment( final Properties environment )
  @@ -109,8 +105,10 @@
               final ExecManagerFactory factory = new ExecManagerFactory();
               final ExecManager manager = (ExecManager)factory.createService();
   
  +            final String[] command = m_command.getCommandline();
  +
               final ExecMetaData metaData =
  -                new ExecMetaData( m_command, m_environment,
  +                new ExecMetaData( command, m_environment,
                                     m_workingDirectory, m_newEnvironment );
   
               return manager.execute( metaData, m_handler, m_timeout );
  
  
  
  1.20      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java
  
  Index: Javadoc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Javadoc.java	26 Jan 2002 02:08:10 -0000	1.19
  +++ Javadoc.java	27 Jan 2002 02:31:47 -0000	1.20
  @@ -824,7 +824,7 @@
           exe.setWorkingDirectory( null );
           try
           {
  -            exe.setCommandline( cmd.getCommandline() );
  +            exe.setCommandline( cmd );
               final int ret = exe.execute();
               if( ret != 0 )
               {
  
  
  
  1.20      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  
  Index: ANTLR.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- ANTLR.java	20 Jan 2002 02:11:43 -0000	1.19
  +++ ANTLR.java	27 Jan 2002 02:31:47 -0000	1.20
  @@ -19,6 +19,7 @@
   import org.apache.tools.ant.types.Argument;
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.Commandline;
   
   /**
    * ANTLR task.
  @@ -129,7 +130,7 @@
               if( fork )
               {
                   getLogger().debug( "Forking " + commandline.toString() );
  -                int err = run( commandline.getCommandline() );
  +                int err = run( commandline );
                   if( err == 1 )
                   {
                       throw new TaskException( "ANTLR returned: " + err );
  @@ -222,7 +223,7 @@
        * @return Description of the Returned Value
        * @exception TaskException Description of Exception
        */
  -    private int run( String[] command )
  +    private int run( final Commandline command )
           throws TaskException
       {
           final Execute2 exe = new Execute2();
  
  
  
  1.23      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java
  
  Index: Cab.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Cab.java	26 Jan 2002 02:08:10 -0000	1.22
  +++ Cab.java	27 Jan 2002 02:31:47 -0000	1.23
  @@ -138,7 +138,7 @@
                   setupLogger( exe );
                   exe.setWorkingDirectory( m_baseDir );
                   final Commandline cmd = createCommand( listFile );
  -                exe.setCommandline( cmd.getCommandline() );
  +                exe.setCommandline( cmd );
                   exe.execute();
   
                   listFile.delete();
  
  
  
  1.17      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java
  
  Index: Continuus.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Continuus.java	12 Jan 2002 04:58:40 -0000	1.16
  +++ Continuus.java	27 Jan 2002 02:31:47 -0000	1.17
  @@ -118,7 +118,7 @@
                   exe.setExecOutputHandler( handler );
               }
               exe.setWorkingDirectory( getBaseDirectory() );
  -            exe.setCommandline( cmd.getCommandline() );
  +            exe.setCommandline( cmd );
               return exe.execute();
           }
           catch( final IOException ioe )
  
  
  
  1.14      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
  
  Index: ClearCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ClearCase.java	6 Jan 2002 02:25:35 -0000	1.13
  +++ ClearCase.java	27 Jan 2002 02:31:48 -0000	1.14
  @@ -110,7 +110,7 @@
               final Execute2 exe = new Execute2();
               setupLogger( exe );
               exe.setWorkingDirectory( getBaseDirectory() );
  -            exe.setCommandline( cmd.getCommandline() );
  +            exe.setCommandline( cmd );
               return exe.execute();
           }
           catch( IOException e )
  
  
  
  1.17      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
  
  Index: NetCommand.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- NetCommand.java	20 Jan 2002 02:11:43 -0000	1.16
  +++ NetCommand.java	27 Jan 2002 02:31:48 -0000	1.17
  @@ -151,7 +151,7 @@
                   //in verbose mode we always log stuff
                   logVerbose( _commandLine.toString() );
               }
  -            _exe.setCommandline( _commandLine.getCommandline() );
  +            _exe.setCommandline( _commandLine );
               err = _exe.execute();
               if( err != 0 )
               {
  
  
  
  1.17      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
  
  Index: BorlandDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- BorlandDeploymentTool.java	20 Jan 2002 02:11:43 -0000	1.16
  +++ BorlandDeploymentTool.java	27 Jan 2002 02:31:48 -0000	1.17
  @@ -365,7 +365,7 @@
           exe.setWorkingDirectory( getTask().getBaseDirectory() );
   
           final Commandline cmd = buildCommandline( ithomes );
  -        exe.setCommandline( cmd.getCommandline() );
  +        exe.setCommandline( cmd );
   
           getLogger().debug( "Calling java2iiop" );
           getLogger().debug( cmd.toString() );
  
  
  
  1.19      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java
  
  Index: BorlandGenerateClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- BorlandGenerateClient.java	20 Jan 2002 02:36:21 -0000	1.18
  +++ BorlandGenerateClient.java	27 Jan 2002 02:31:48 -0000	1.19
  @@ -163,7 +163,7 @@
               final Execute2 exe = new Execute2();
               setupLogger( exe );
               exe.setWorkingDirectory( new File( "." ) );
  -            exe.setCommandline( cmd.getCommandline() );
  +            exe.setCommandline( cmd );
               exe.execute();
           }
           catch( Exception e )
  
  
  
  1.22      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
  
  Index: JJTree.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JJTree.java	20 Jan 2002 17:35:02 -0000	1.21
  +++ JJTree.java	27 Jan 2002 02:31:48 -0000	1.22
  @@ -18,6 +18,7 @@
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.PathUtil;
  +import org.apache.tools.ant.types.Commandline;
   
   /**
    * Taskdef for the JJTree compiler compiler.
  @@ -184,7 +185,7 @@
           setupLogger( exe );
   
           getLogger().debug( cmdl.toString() );
  -        exe.setCommandline( cmdl.getCommandline() );
  +        exe.setCommandline( new Commandline( cmdl.getCommandline() ) );
   
           try
           {
  
  
  
  1.17      +8 -6      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
  
  Index: JavaCC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JavaCC.java	20 Jan 2002 17:35:02 -0000	1.16
  +++ JavaCC.java	27 Jan 2002 02:31:48 -0000	1.17
  @@ -19,6 +19,7 @@
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.PathUtil;
  +import org.apache.tools.ant.types.Commandline;
   import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
  @@ -234,27 +235,28 @@
           cmdl.addVmArgument( "-mx140M" );
           cmdl.addVmArgument( "-Dinstall.root=" + javaccHome.getAbsolutePath() );
   
  -        runCommand( cmdl.getCommandline() );
  +        runCommand( cmdl );
       }
   
  -    private void runCommand( final String[] cmdline )
  +    private void runCommand( final CommandlineJava cmdline )
           throws TaskException
       {
           try
           {
  -            getLogger().debug( StringUtil.join( cmdline, " " ) );
  +            getLogger().debug( cmdline.toString() );
               final Execute2 exe = new Execute2();
               setupLogger( exe );
  -            exe.setCommandline( cmdline );
  +            final String[] commandline = cmdline.getCommandline();
  +            exe.setCommandline( new Commandline( commandline ) );
               int retval = exe.execute();
               if( retval != 0 )
               {
  -                throw new TaskException( cmdline[ 0 ] + " failed with return code " + retval
);
  +                throw new TaskException( cmdline + " failed with return code " + retval
);
               }
           }
           catch( final IOException ioe )
           {
  -            throw new TaskException( "Could not launch " + cmdline[ 0 ] + ": " + ioe );
  +            throw new TaskException( "Could not launch " + cmdline + ": " + ioe );
           }
       }
   
  
  
  
  1.21      +3 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- JDependTask.java	20 Jan 2002 17:35:02 -0000	1.20
  +++ JDependTask.java	27 Jan 2002 02:31:48 -0000	1.21
  @@ -17,6 +17,7 @@
   
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.util.FileUtils;
   
   /**
  @@ -241,7 +242,8 @@
           final Execute2 exe = new Execute2();
           setupLogger( exe );
   
  -        exe.setCommandline( commandline.getCommandline() );
  +        final String[] commandline1 = commandline.getCommandline();
  +        exe.setCommandline( new Commandline( commandline1 ) );
           if( m_dir != null )
           {
               exe.setWorkingDirectory( m_dir );
  
  
  
  1.31      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- JUnitTask.java	20 Jan 2002 17:35:00 -0000	1.30
  +++ JUnitTask.java	27 Jan 2002 02:31:48 -0000	1.31
  @@ -30,6 +30,7 @@
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.SysProperties;
   import org.apache.tools.ant.types.PathUtil;
  +import org.apache.tools.ant.types.Commandline;
   
   /**
    * Ant task to run JUnit tests. <p>
  @@ -647,7 +648,7 @@
   
           final Execute2 exe = new Execute2();
           setupLogger( exe );
  -        exe.setCommandline( cmd.getCommandline() );
  +        exe.setCommandline( new Commandline( cmd.getCommandline() ) );
           if( dir != null )
           {
               exe.setWorkingDirectory( dir );
  
  
  
  1.23      +3 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java
  
  Index: AbstractMetamataTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- AbstractMetamataTask.java	26 Jan 2002 02:08:11 -0000	1.22
  +++ AbstractMetamataTask.java	27 Jan 2002 02:31:48 -0000	1.23
  @@ -24,6 +24,7 @@
   import org.apache.tools.ant.types.FileSet;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.ScannerUtil;
  +import org.apache.tools.ant.types.Commandline;
   
   /**
    * Somewhat abstract framework to be used for other metama 2.0 tasks. This
  @@ -280,7 +281,8 @@
           final Execute2 exe = new Execute2();
           setupLogger( exe );
           getLogger().debug( m_cmdl.toString() );
  -        exe.setCommandline( m_cmdl.getCommandline() );
  +        final String[] commandline = m_cmdl.getCommandline();
  +        exe.setCommandline( new Commandline( commandline ) );
           try
           {
               if( 0 != exe.execute() )
  
  
  
  1.21      +5 -12     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java
  
  Index: MParse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- MParse.java	20 Jan 2002 17:34:59 -0000	1.20
  +++ MParse.java	27 Jan 2002 02:31:48 -0000	1.21
  @@ -19,6 +19,8 @@
   import org.apache.tools.ant.types.Argument;
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.Commandline;
  +import org.apache.avalon.excalibur.io.IOUtil;
   
   /**
    * Simple Metamata MParse task based on the original written by <a
  @@ -287,7 +289,8 @@
           final Execute2 exe = new Execute2();
           setupLogger( exe );
           getLogger().debug( m_cmdl.toString() );
  -        exe.setCommandline( m_cmdl.getCommandline() );
  +        final String[] commandline = m_cmdl.getCommandline();
  +        exe.setCommandline( new Commandline( commandline ) );
           try
           {
               if( exe.execute() != 0 )
  @@ -386,17 +389,7 @@
           }
           finally
           {
  -            if( fw != null )
  -            {
  -                try
  -                {
  -                    fw.close();
  -                }
  -                catch( IOException ignored )
  -                {
  -                }
  -            }
  +            IOUtil.shutdownWriter( fw );
           }
       }
  -
   }
  
  
  
  1.16      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java
  
  Index: P4Base.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- P4Base.java	20 Jan 2002 02:36:21 -0000	1.15
  +++ P4Base.java	27 Jan 2002 02:31:48 -0000	1.16
  @@ -167,7 +167,7 @@
   
               final Execute2 exe = new Execute2();
               exe.setExecOutputHandler( handler );
  -            exe.setCommandline( cmd.getCommandline() );
  +            exe.setCommandline( cmd );
   
               try
               {
  
  
  
  1.17      +2 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
  
  Index: Pvcs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Pvcs.java	20 Jan 2002 03:20:06 -0000	1.16
  +++ Pvcs.java	27 Jan 2002 02:31:48 -0000	1.17
  @@ -193,7 +193,7 @@
               final Execute2 exe = new Execute2();
               setupLogger( exe );
               exe.setWorkingDirectory( getBaseDirectory() );
  -            exe.setCommandline( cmd.getCommandline() );
  +            exe.setCommandline( cmd );
               result = exe.execute();
               checkResultCode( result, cmd );
           }
  @@ -276,7 +276,7 @@
               exe.setExecOutputHandler( this );
               m_output = new FileOutputStream( tmp );
               exe.setWorkingDirectory( getBaseDirectory() );
  -            exe.setCommandline( cmd.getCommandline() );
  +            exe.setCommandline( cmd );
               final int result = exe.execute();
               checkResultCode( result, cmd );
   
  
  
  
  1.17      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java
  
  Index: CovMerge.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- CovMerge.java	26 Jan 2002 02:08:11 -0000	1.16
  +++ CovMerge.java	27 Jan 2002 02:31:48 -0000	1.17
  @@ -117,7 +117,7 @@
               final Execute2 exe = new Execute2();
               setupLogger( exe );
               getLogger().debug( cmdl.toString() );
  -            exe.setCommandline( cmdl.getCommandline() );
  +            exe.setCommandline( cmdl );
   
               // JProbe process always return 0 so  we will not be
               // able to check for failure ! :-(
  
  
  
  1.18      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
  
  Index: CovReport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- CovReport.java	20 Jan 2002 02:11:44 -0000	1.17
  +++ CovReport.java	27 Jan 2002 02:31:48 -0000	1.18
  @@ -249,7 +249,7 @@
               final Execute2 exe = new Execute2();
               setupLogger( exe );
               getLogger().debug( cmdl.toString() );
  -            exe.setCommandline( cmdl.getCommandline() );
  +            exe.setCommandline( cmdl );
               int exitValue = exe.execute();
               if( exitValue != 0 )
               {
  
  
  
  1.18      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java
  
  Index: Coverage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Coverage.java	20 Jan 2002 02:11:44 -0000	1.17
  +++ Coverage.java	27 Jan 2002 02:31:48 -0000	1.18
  @@ -253,7 +253,7 @@
               final Execute2 exe = new Execute2();
               setupLogger( exe );
               getLogger().debug( cmdl.toString() );
  -            exe.setCommandline( cmdl.getCommandline() );
  +            exe.setCommandline( cmdl );
               int exitValue = exe.execute();
               if( exitValue != 0 )
               {
  
  
  
  1.18      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
  
  Index: MSVSS.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- MSVSS.java	20 Jan 2002 02:11:44 -0000	1.17
  +++ MSVSS.java	27 Jan 2002 02:31:48 -0000	1.18
  @@ -217,7 +217,7 @@
               }
   
               exe.setWorkingDirectory( getBaseDirectory() );
  -            exe.setCommandline( cmd.getCommandline() );
  +            exe.setCommandline( cmd );
               return exe.execute();
           }
           catch( IOException e )
  
  
  
  1.10      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix/Rpm.java
  
  Index: Rpm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix/Rpm.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Rpm.java	20 Jan 2002 17:35:02 -0000	1.9
  +++ Rpm.java	27 Jan 2002 02:31:49 -0000	1.10
  @@ -98,7 +98,7 @@
           }
           exe.setWorkingDirectory( m_topDir );
   
  -        exe.setCommandline( cmd.getCommandline() );
  +        exe.setCommandline( cmd );
           try
           {
               final String message = "Building the RPM based on the " + m_specFile + " file";
  
  
  
  1.13      +21 -16    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Commandline.java
  
  Index: Commandline.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Commandline.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Commandline.java	20 Jan 2002 17:35:00 -0000	1.12
  +++ Commandline.java	27 Jan 2002 02:31:49 -0000	1.13
  @@ -37,6 +37,24 @@
       protected final ArrayList m_arguments = new ArrayList();
       private String m_executable;
   
  +    public Commandline()
  +    {
  +    }
  +
  +    public Commandline( final String[] command )
  +    {
  +        if( 0 == command.length )
  +        {
  +            throw new IllegalArgumentException( "command" );
  +        }
  +
  +        m_executable = command[ 0 ];
  +        for( int i = 1; i < command.length; i++ )
  +        {
  +            addArgument( command[ i ] );
  +        }
  +    }
  +
       /**
        * Sets the executable to run.
        *
  @@ -98,25 +116,12 @@
           return m_executable;
       }
   
  -    public void addArguments( String[] line )
  +    public void addArguments( final String[] args )
       {
  -        for( int i = 0; i < line.length; i++ )
  +        for( int i = 0; i < args.length; i++ )
           {
  -            addArgument( line[ i ] );
  +            addArgument( args[ i ] );
           }
  -    }
  -
  -    /**
  -     * Creates an argument object. Each commandline object has at most one
  -     * instance of the argument class.
  -     *
  -     * @return the argument object.
  -     */
  -    public Argument createArgument()
  -    {
  -        final Argument argument = new Argument();
  -        m_arguments.add( argument );
  -        return argument;
       }
   
       public void addArgument( final File argument )
  
  
  

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


Mime
View raw message