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 CommandlineJava.java SourceFileScanner.java
Date Sun, 20 Jan 2002 02:36:21 GMT
donaldp     02/01/19 18:36:21

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        Javac.java Patch.java Rmic.java Tar.java
                        UpToDate.java Zip.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec
                        ExecTask.java ExecuteOn.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file
                        Copy.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc
                        Javadoc.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
                        Cab.java StyleBook.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        BorlandGenerateClient.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp
                        WLJspc.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers
                        JasperC.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/text
                        Native2Ascii.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix
                        Chmod.java Rpm.java
               proposal/myrmidon/src/main/org/apache/tools/ant/types
                        Commandline.java CommandlineJava.java
                        SourceFileScanner.java
  Log:
  Did some create->add munging
  
  Revision  Changes    Path
  1.26      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Javac.java	17 Jan 2002 08:04:54 -0000	1.25
  +++ Javac.java	20 Jan 2002 02:36:20 -0000	1.26
  @@ -776,7 +776,8 @@
           GlobPatternMapper m = new GlobPatternMapper();
           m.setFrom( "*.java" );
           m.setTo( "*.class" );
  -        SourceFileScanner sfs = new SourceFileScanner( this );
  +        SourceFileScanner sfs = new SourceFileScanner();
  +        setupLogger( sfs );
           File[] newFiles = sfs.restrictAsFiles( files, srcDir, destDir, m );
   
           if( newFiles.length > 0 )
  
  
  
  1.14      +0 -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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Patch.java	20 Jan 2002 02:11:42 -0000	1.13
  +++ Patch.java	20 Jan 2002 02:36:20 -0000	1.14
  @@ -67,7 +67,6 @@
        * @param file The new Patchfile value
        */
       public void setPatchfile( final File patchFile )
  -        throws TaskException
       {
           m_patchFile = patchFile;
       }
  
  
  
  1.24      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java
  
  Index: Rmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Rmic.java	17 Jan 2002 08:04:54 -0000	1.23
  +++ Rmic.java	20 Jan 2002 02:36:20 -0000	1.24
  @@ -564,8 +564,9 @@
           }
           else
           {
  -            SourceFileScanner sfs = new SourceFileScanner( this );
  -            newFiles = sfs.restrict( files, baseDir, baseDir, mapper );
  +            final SourceFileScanner scanner = new SourceFileScanner();
  +            setupLogger( scanner );
  +            newFiles = scanner.restrict( files, baseDir, baseDir, mapper );
           }
   
           for( int i = 0; i < newFiles.length; i++ )
  
  
  
  1.18      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tar.java
  
  Index: Tar.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tar.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Tar.java	20 Jan 2002 02:11:42 -0000	1.17
  +++ Tar.java	20 Jan 2002 02:36:20 -0000	1.18
  @@ -226,7 +226,8 @@
       private boolean archiveIsUpToDate( final String[] files )
           throws TaskException
       {
  -        final SourceFileScanner scanner = new SourceFileScanner( this );
  +        final SourceFileScanner scanner = new SourceFileScanner();
  +        setupLogger( scanner );
           final MergingMapper mapper = new MergingMapper();
           mapper.setTo( tarFile.getAbsolutePath() );
           return scanner.restrict( files, baseDir, null, mapper ).length == 0;
  
  
  
  1.17      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/UpToDate.java
  
  Index: UpToDate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/UpToDate.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- UpToDate.java	13 Jan 2002 05:24:36 -0000	1.16
  +++ UpToDate.java	20 Jan 2002 02:36:20 -0000	1.17
  @@ -161,7 +161,8 @@
       protected boolean scanDir( File srcDir, String files[] )
           throws TaskException
       {
  -        SourceFileScanner sfs = new SourceFileScanner( this );
  +        SourceFileScanner scanner = new SourceFileScanner();
  +        setupLogger( scanner );
           FileNameMapper mapper = null;
           File dir = srcDir;
           if( mapperElement == null )
  @@ -175,7 +176,7 @@
           {
               mapper = mapperElement.getImplementation();
           }
  -        return sfs.restrict( files, srcDir, dir, mapper ).length == 0;
  +        return scanner.restrict( files, srcDir, dir, mapper ).length == 0;
       }
   
       /**
  
  
  
  1.17      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Zip.java
  
  Index: Zip.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Zip.java	20 Jan 2002 00:03:17 -0000	1.16
  +++ Zip.java	20 Jan 2002 02:36:20 -0000	1.17
  @@ -458,12 +458,13 @@
               if( !zipFile.exists() )
                   return false;
   
  -            SourceFileScanner sfs = new SourceFileScanner( this );
  +            final SourceFileScanner scanner = new SourceFileScanner();
  +            setupLogger( scanner );
               MergingMapper mm = new MergingMapper();
               mm.setTo( zipFile.getAbsolutePath() );
               for( int i = 0; i < scanners.length; i++ )
               {
  -                if( sfs.restrict( fileNames[ i ], scanners[ i ].getBasedir(), null,
  +                if( scanner.restrict( fileNames[ i ], scanners[ i ].getBasedir(), null,
                                     mm ).length > 0 )
                   {
                       return false;
  
  
  
  1.16      +2 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/ExecTask.java
  
  Index: ExecTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/ExecTask.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ExecTask.java	20 Jan 2002 02:11:42 -0000	1.15
  +++ ExecTask.java	20 Jan 2002 02:36:20 -0000	1.16
  @@ -176,7 +176,7 @@
       public void execute()
           throws TaskException
       {
  -        checkConfiguration();
  +        validate();
           if( isValidOs() )
           {
               runExec( prepareExec() );
  @@ -250,7 +250,7 @@
        *
        * @exception TaskException Description of Exception
        */
  -    protected void checkConfiguration()
  +    protected void validate()
           throws TaskException
       {
           if( m_command.getExecutable() == null )
  
  
  
  1.4       +8 -6      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/ExecuteOn.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ExecuteOn.java	13 Jan 2002 05:24:46 -0000	1.3
  +++ ExecuteOn.java	20 Jan 2002 02:36:20 -0000	1.4
  @@ -313,8 +313,9 @@
       {
           if( mapper != null )
           {
  -            SourceFileScanner sfs = new SourceFileScanner( this );
  -            return sfs.restrict( ds.getIncludedDirectories(), baseDir, destDir,
  +            final SourceFileScanner scanner = new SourceFileScanner();
  +            setupLogger( scanner );
  +            return scanner.restrict( ds.getIncludedDirectories(), baseDir, destDir,
                                    mapper );
           }
           else
  @@ -336,8 +337,9 @@
       {
           if( mapper != null )
           {
  -            SourceFileScanner sfs = new SourceFileScanner( this );
  -            return sfs.restrict( ds.getIncludedFiles(), baseDir, destDir,
  +            final SourceFileScanner scanner = new SourceFileScanner();
  +            setupLogger( scanner );
  +            return scanner.restrict( ds.getIncludedFiles(), baseDir, destDir,
                                    mapper );
           }
           else
  @@ -346,10 +348,10 @@
           }
       }
   
  -    protected void checkConfiguration()
  +    protected void validate()
           throws TaskException
       {
  -        super.checkConfiguration();
  +        super.validate();
           if( filesets.size() == 0 )
           {
               throw new TaskException( "no filesets specified" );
  
  
  
  1.15      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Copy.java
  
  Index: Copy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Copy.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Copy.java	13 Jan 2002 05:25:08 -0000	1.14
  +++ Copy.java	20 Jan 2002 02:36:20 -0000	1.15
  @@ -305,7 +305,8 @@
           }
           else
           {
  -            final SourceFileScanner scanner = new SourceFileScanner( this );
  +            final SourceFileScanner scanner = new SourceFileScanner();
  +            setupLogger( scanner );
               return scanner.restrict( names, fromDir, toDir, mapper );
           }
       }
  
  
  
  1.16      +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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Javadoc.java	20 Jan 2002 02:11:43 -0000	1.15
  +++ Javadoc.java	20 Jan 2002 02:36:20 -0000	1.16
  @@ -96,7 +96,7 @@
       public void setAdditionalparam( String add )
           throws TaskException
       {
  -        m_command.createArgument().setLine( add );
  +        m_command.addLine( add );
       }
   
       public void setAuthor( boolean src )
  
  
  
  1.20      +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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Cab.java	20 Jan 2002 02:11:43 -0000	1.19
  +++ Cab.java	20 Jan 2002 02:36:21 -0000	1.20
  @@ -258,7 +258,7 @@
   
           if( m_options != null )
           {
  -            cmd.createArgument().setLine( m_options );
  +            cmd.addLine( m_options );
           }
   
           cmd.addArgument( "n" );
  
  
  
  1.5       +5 -4      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/StyleBook.java
  
  Index: StyleBook.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/StyleBook.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StyleBook.java	12 Jan 2002 23:36:14 -0000	1.4
  +++ StyleBook.java	20 Jan 2002 02:36:21 -0000	1.5
  @@ -10,6 +10,7 @@
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.taskdefs.Java;
  +import org.apache.tools.ant.types.Argument;
   
   /**
    * Basic task for apache stylebook.
  @@ -57,12 +58,12 @@
       {
           validate();
   
  -        createArg().setValue( "targetDirectory=" + m_targetDirectory );
  -        createArg().setValue( m_book.toString() );
  -        createArg().setValue( m_skinDirectory.toString() );
  +        addArg( new Argument( "targetDirectory=" + m_targetDirectory ) );
  +        addArg( new Argument( m_book.toString() ) );
  +        addArg( new Argument( m_skinDirectory.toString() ) );
           if( null != m_loaderConfig )
           {
  -            createArg().setValue( "loaderConfig=" + m_loaderConfig );
  +            addArg( new Argument( "loaderConfig=" + m_loaderConfig ) );
           }
   
           super.execute();
  
  
  
  1.18      +13 -11    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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- BorlandGenerateClient.java	20 Jan 2002 02:11:43 -0000	1.17
  +++ BorlandGenerateClient.java	20 Jan 2002 02:36:21 -0000	1.18
  @@ -13,6 +13,7 @@
   import org.apache.tools.ant.taskdefs.exec.Execute2;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.Argument;
   
   /**
    * BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This
  @@ -219,31 +220,32 @@
               //execTask.addClasspath( classpath.concatSystemClasspath( "last" ) );
   
               execTask.setFork( true );
  -            execTask.createArg().setValue( "generateclient" );
  +            execTask.addArg( new Argument( "generateclient" ) );
               if( debug )
               {
  -                execTask.createArg().setValue( "-trace" );
  +                execTask.addArg( new Argument( "-trace" ) );
               }// end of if ()
   
               //
  -            execTask.createArg().setValue( "-short" );
  -            execTask.createArg().setValue( "-jarfile" );
  +            execTask.addArg( new Argument( "-short" ) );
  +            execTask.addArg( new Argument( "-jarfile" ) );
               // ejb jar file
  -            execTask.createArg().setValue( ejbjarfile.getAbsolutePath() );
  +            execTask.addArg( new Argument( ejbjarfile.getAbsolutePath() ) );
               //client jar file
  -            execTask.createArg().setValue( "-single" );
  -            execTask.createArg().setValue( "-clientjarfile" );
  -            execTask.createArg().setValue( clientjarfile.getAbsolutePath() );
  +            execTask.addArg( new Argument( "-single" ) );
  +            execTask.addArg( new Argument( "-clientjarfile" ) );
  +            execTask.addArg( new Argument( clientjarfile.getAbsolutePath() ) );
   
               getLogger().debug( "Calling EJBUtilities" );
               execTask.execute();
   
           }
  -        catch( Exception e )
  +        catch( final Exception e )
           {
               // Have to catch this because of the semantics of calling main()
  -            String msg = "Exception while calling generateclient Details: " + e.toString();
  -            throw new TaskException( msg, e );
  +            final String message =
  +                "Exception while calling generateclient Details: " + e.toString();
  +            throw new TaskException( message, e );
           }
       }
   }
  
  
  
  1.18      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
  
  Index: WLJspc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- WLJspc.java	19 Jan 2002 07:26:22 -0000	1.17
  +++ WLJspc.java	20 Jan 2002 02:36:21 -0000	1.18
  @@ -16,6 +16,7 @@
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.Argument;
   
   /**
    * Class to precompile JSP's using weblogic's jsp compiler (weblogic.jspc)
  @@ -230,7 +231,7 @@
               System.out.println( "arg = " + arg );
   
               //helperTask.clearArgs();
  -            helperTask.createArg().setValue( arg );
  +            helperTask.addArg( new Argument( arg ) );
               helperTask.addClasspath( compileClasspath );
               if( helperTask.executeJava() != 0 )
               {
  
  
  
  1.10      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
  
  Index: JasperC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JasperC.java	20 Jan 2002 02:11:44 -0000	1.9
  +++ JasperC.java	20 Jan 2002 02:36:21 -0000	1.10
  @@ -11,6 +11,7 @@
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.taskdefs.optional.jsp.JspC;
   import org.apache.tools.ant.types.Commandline;
  +import org.apache.tools.ant.types.Argument;
   
   /**
    * The implementation of the jasper compiler. This is a cut-and-paste of the
  @@ -41,7 +42,7 @@
               java.setClassname( "org.apache.jasper.JspC" );
               String args[] = cmd.getArguments();
               for( int i = 0; i < args.length; i++ )
  -                java.createArg().setValue( args[ i ] );
  +                java.addArg( new Argument( args[ i ] ) );
               java.execute();
               return true;
           }
  
  
  
  1.20      +2 -2      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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- AbstractMetamataTask.java	20 Jan 2002 02:11:44 -0000	1.19
  +++ AbstractMetamataTask.java	20 Jan 2002 02:36:21 -0000	1.20
  @@ -210,8 +210,8 @@
           ArrayList options = getOptions();
           m_optionsFile = createTmpFile();
           generateOptionsFile( m_optionsFile, options );
  -        Argument args = m_cmdl.createArgument();
  -        args.setLine( "-arguments " + m_optionsFile.getAbsolutePath() );
  +        m_cmdl.addArgument( "-arguments " );
  +        m_cmdl.addArgument( m_optionsFile.getAbsolutePath() );
       }
   
       /**
  
  
  
  1.19      +2 -2      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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- MParse.java	20 Jan 2002 02:11:44 -0000	1.18
  +++ MParse.java	20 Jan 2002 02:36:21 -0000	1.19
  @@ -211,8 +211,8 @@
           String[] options = getOptions();
           m_optionsFile = createTmpFile();
           generateOptionsFile( m_optionsFile, options );
  -        Argument args = m_cmdl.createArgument();
  -        args.setLine( "-arguments " + m_optionsFile.getAbsolutePath() );
  +        m_cmdl.addArgument( "-arguments" );
  +        m_cmdl.addArgument( m_optionsFile.getAbsolutePath() );
       }
   
       /**
  
  
  
  1.15      +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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- P4Base.java	20 Jan 2002 02:11:44 -0000	1.14
  +++ P4Base.java	20 Jan 2002 02:36:21 -0000	1.15
  @@ -150,7 +150,7 @@
               {
                   cmd.addArgument( m_p4Client );
               }
  -            cmd.createArgument().setLine( command );
  +            cmd.addLine( command );
   
               String[] cmdline = cmd.getCommandline();
               String cmdl = "";
  
  
  
  1.5       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/Native2Ascii.java
  
  Index: Native2Ascii.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/Native2Ascii.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Native2Ascii.java	20 Jan 2002 02:11:45 -0000	1.4
  +++ Native2Ascii.java	20 Jan 2002 02:36:21 -0000	1.5
  @@ -113,7 +113,8 @@
           final DirectoryScanner scanner = getDirectoryScanner( m_srcDir );
           String[] files = scanner.getIncludedFiles();
   
  -        final SourceFileScanner sfs = new SourceFileScanner( this );
  +        final SourceFileScanner sfs = new SourceFileScanner();
  +        setupLogger( sfs );
           final FileNameMapper mapper = buildMapper();
           files = sfs.restrict( files, m_srcDir, m_destDir, mapper );
           int count = files.length;
  
  
  
  1.9       +34 -34    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix/Chmod.java
  
  Index: Chmod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix/Chmod.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Chmod.java	13 Jan 2002 05:38:01 -0000	1.8
  +++ Chmod.java	20 Jan 2002 02:36:21 -0000	1.9
  @@ -9,13 +9,14 @@
   
   import java.io.File;
   import java.io.IOException;
  -import org.apache.myrmidon.api.TaskException;
   import org.apache.aut.nativelib.Os;
  -import org.apache.tools.ant.taskdefs.exec.ExecuteOn;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.taskdefs.exec.Execute;
  +import org.apache.tools.ant.taskdefs.exec.ExecuteOn;
  +import org.apache.tools.ant.types.Argument;
   import org.apache.tools.ant.types.FileSet;
  -import org.apache.tools.ant.types.PatternSet;
   import org.apache.tools.ant.types.NameEntry;
  +import org.apache.tools.ant.types.PatternSet;
   
   /**
    * Chmod equivalent for unix-like environments.
  @@ -26,13 +27,12 @@
    *      mnowostawski@infoscience.otago.ac.nz</a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    */
  -
  -public class Chmod extends ExecuteOn
  +public class Chmod
  +    extends ExecuteOn
   {
  -
  -    private FileSet defaultSet = new FileSet();
  -    private boolean defaultSetDefined = false;
  -    private boolean havePerm = false;
  +    private FileSet m_defaultSet = new FileSet();
  +    private boolean m_defaultSetDefined;
  +    private boolean m_havePerm;
   
       public Chmod()
           throws TaskException
  @@ -51,14 +51,14 @@
       public void setDefaultexcludes( boolean useDefaultExcludes )
           throws TaskException
       {
  -        defaultSetDefined = true;
  -        defaultSet.setDefaultexcludes( useDefaultExcludes );
  +        m_defaultSetDefined = true;
  +        m_defaultSet.setDefaultexcludes( useDefaultExcludes );
       }
   
       public void setDir( File src )
           throws TaskException
       {
  -        defaultSet.setDir( src );
  +        m_defaultSet.setDir( src );
       }
   
       /**
  @@ -70,8 +70,8 @@
       public void setExcludes( String excludes )
           throws TaskException
       {
  -        defaultSetDefined = true;
  -        defaultSet.setExcludes( excludes );
  +        m_defaultSetDefined = true;
  +        m_defaultSet.setExcludes( excludes );
       }
   
       public void setExecutable( String e )
  @@ -98,14 +98,14 @@
       public void setIncludes( String includes )
           throws TaskException
       {
  -        defaultSetDefined = true;
  -        defaultSet.setIncludes( includes );
  +        m_defaultSetDefined = true;
  +        m_defaultSet.setIncludes( includes );
       }
   
       public void setPerm( String perm )
       {
  -        createArg().setValue( perm );
  -        havePerm = true;
  +        addArg( new Argument( perm ) );
  +        m_havePerm = true;
       }
   
       public void setSkipEmptyFilesets( final boolean skip )
  @@ -122,8 +122,8 @@
       public NameEntry createExclude()
           throws TaskException
       {
  -        defaultSetDefined = true;
  -        return defaultSet.createExclude();
  +        m_defaultSetDefined = true;
  +        return m_defaultSet.createExclude();
       }
   
       /**
  @@ -134,8 +134,8 @@
       public NameEntry createInclude()
           throws TaskException
       {
  -        defaultSetDefined = true;
  -        return defaultSet.createInclude();
  +        m_defaultSetDefined = true;
  +        return m_defaultSet.createInclude();
       }
   
       /**
  @@ -146,31 +146,31 @@
       public PatternSet createPatternSet()
           throws TaskException
       {
  -        defaultSetDefined = true;
  -        return defaultSet.createPatternSet();
  +        m_defaultSetDefined = true;
  +        return m_defaultSet.createPatternSet();
       }
   
       public void execute()
           throws TaskException
       {
  -        if( defaultSetDefined || defaultSet.getDir() == null )
  +        if( m_defaultSetDefined || m_defaultSet.getDir() == null )
           {
               super.execute();
           }
           else if( isValidOs() )
           {
               // we are chmodding the given directory
  -            createArg().setValue( defaultSet.getDir().getPath() );
  +            addArg( new Argument( m_defaultSet.getDir().getPath() ) );
               Execute execute = prepareExec();
               try
               {
                   execute.setCommandline( getCommand().getCommandline() );
                   runExecute( execute );
               }
  -            catch( IOException e )
  +            catch( final IOException ioe )
               {
  -                final String message = "Execute failed: " + e;
  -                throw new TaskException( message, e );
  +                final String message = "Execute failed: " + ioe;
  +                throw new TaskException( message, ioe );
               }
               finally
               {
  @@ -185,18 +185,18 @@
           return Os.isFamily( "unix" ) && super.isValidOs();
       }
   
  -    protected void checkConfiguration()
  +    protected void validate()
           throws TaskException
       {
  -        if( !havePerm )
  +        if( !m_havePerm )
           {
               throw new TaskException( "Required attribute perm not set in chmod" );
           }
   
  -        if( defaultSetDefined && defaultSet.getDir() != null )
  +        if( m_defaultSetDefined && m_defaultSet.getDir() != null )
           {
  -            addFileset( defaultSet );
  +            addFileset( m_defaultSet );
           }
  -        super.checkConfiguration();
  +        super.validate();
       }
   }
  
  
  
  1.8       +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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Rpm.java	20 Jan 2002 02:11:45 -0000	1.7
  +++ Rpm.java	20 Jan 2002 02:36:21 -0000	1.8
  @@ -124,7 +124,7 @@
               cmd.addArgument( "_topdir" + m_topDir );
           }
   
  -        cmd.createArgument().setLine( m_command );
  +        cmd.addLine( m_command );
   
           if( m_cleanBuildDir )
           {
  
  
  
  1.11      +9 -0      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Commandline.java	20 Jan 2002 02:11:45 -0000	1.10
  +++ Commandline.java	20 Jan 2002 02:36:21 -0000	1.11
  @@ -10,6 +10,7 @@
   import java.io.File;
   import java.util.ArrayList;
   import org.apache.avalon.excalibur.util.StringUtil;
  +import org.apache.myrmidon.api.TaskException;
   
   /**
    * Commandline objects help handling command lines specifying processes to
  @@ -130,6 +131,14 @@
       public void addArgument( final Argument argument )
       {
           m_arguments.add( argument );
  +    }
  +
  +    public void addLine( final String line )
  +        throws TaskException
  +    {
  +        final Argument argument = new Argument();
  +        argument.setLine( line );
  +        addArgument( argument );
       }
   
       /**
  
  
  
  1.19      +0 -5      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/CommandlineJava.java
  
  Index: CommandlineJava.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/CommandlineJava.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- CommandlineJava.java	20 Jan 2002 02:11:45 -0000	1.18
  +++ CommandlineJava.java	20 Jan 2002 02:36:21 -0000	1.19
  @@ -178,11 +178,6 @@
           m_sysProperties.addVariable( sysp );
       }
   
  -    public Argument createArgument()
  -    {
  -        return m_javaCommand.createArgument();
  -    }
  -
       public void addArgument( final String argument )
       {
           m_javaCommand.addArgument( argument );
  
  
  
  1.3       +0 -11     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/SourceFileScanner.java
  
  Index: SourceFileScanner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/SourceFileScanner.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SourceFileScanner.java	13 Jan 2002 04:45:01 -0000	1.2
  +++ SourceFileScanner.java	20 Jan 2002 02:36:21 -0000	1.3
  @@ -13,7 +13,6 @@
   import org.apache.avalon.excalibur.io.FileUtil;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.Task;
   import org.apache.tools.ant.util.mappers.FileNameMapper;
   
   /**
  @@ -29,16 +28,6 @@
   public class SourceFileScanner
       extends AbstractLogEnabled
   {
  -    private Task m_task;
  -
  -    /**
  -     * @param task The task we should log messages through
  -     */
  -    public SourceFileScanner( Task task )
  -    {
  -        this.m_task = task;
  -    }
  -
       /**
        * Restrict the given set of files to those that are newer than their
        * corresponding target files.
  
  
  

--
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