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 FileSet.java PatternSet.java NameEntry.java
Date Tue, 22 Jan 2002 12:14:58 GMT
donaldp     02/01/22 04:14:58

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        Expand.java MatchingTask.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide
                        VAJExport.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix
                        Chmod.java
               proposal/myrmidon/src/main/org/apache/tools/ant/types
                        FileSet.java PatternSet.java
  Removed:     proposal/myrmidon/src/main/org/apache/tools/ant/types
                        NameEntry.java
  Log:
  Replace NameEntry class with Pattern class
  
  Revision  Changes    Path
  1.15      +2 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Expand.java
  
  Index: Expand.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Expand.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Expand.java	13 Jan 2002 00:00:15 -0000	1.14
  +++ Expand.java	22 Jan 2002 12:14:58 -0000	1.15
  @@ -200,7 +200,7 @@
               for( int v = 0; v < patternsets.size(); v++ )
               {
                   PatternSet p = (PatternSet)patternsets.get( v );
  -                String[] incls = p.getIncludePatterns( null );
  +                String[] incls = p.getIncludePatterns( getContext() );
                   if( incls != null )
                   {
                       for( int w = 0; w < incls.length; w++ )
  @@ -213,7 +213,7 @@
                           }
                       }
                   }
  -                String[] excls = p.getExcludePatterns( null );
  +                String[] excls = p.getExcludePatterns( getContext() );
                   if( excls != null )
                   {
                       for( int w = 0; w < excls.length; w++ )
  
  
  
  1.12      +5 -5      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java
  
  Index: MatchingTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MatchingTask.java	13 Jan 2002 05:42:09 -0000	1.11
  +++ MatchingTask.java	22 Jan 2002 12:14:58 -0000	1.12
  @@ -9,10 +9,10 @@
   
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.framework.Pattern;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.DirectoryScanner;
   import org.apache.tools.ant.types.FileSet;
  -import org.apache.tools.ant.types.NameEntry;
   import org.apache.tools.ant.types.PatternSet;
   
   /**
  @@ -93,7 +93,7 @@
        *
        * @return Description of the Returned Value
        */
  -    public NameEntry createExclude()
  +    public Pattern createExclude()
           throws TaskException
       {
           return m_fileset.createExclude();
  @@ -104,7 +104,7 @@
        *
        * @return Description of the Returned Value
        */
  -    public NameEntry createExcludesFile()
  +    public Pattern createExcludesFile()
           throws TaskException
       {
           return m_fileset.createExcludesFile();
  @@ -115,7 +115,7 @@
        *
        * @return Description of the Returned Value
        */
  -    public NameEntry createInclude()
  +    public Pattern createInclude()
           throws TaskException
       {
           return m_fileset.createInclude();
  @@ -126,7 +126,7 @@
        *
        * @return Description of the Returned Value
        */
  -    public NameEntry createIncludesFile()
  +    public Pattern createIncludesFile()
           throws TaskException
       {
           return m_fileset.createIncludesFile();
  
  
  
  1.6       +5 -5      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJExport.java
  
  Index: VAJExport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJExport.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- VAJExport.java	13 Jan 2002 05:38:01 -0000	1.5
  +++ VAJExport.java	22 Jan 2002 12:14:58 -0000	1.6
  @@ -9,8 +9,8 @@
   
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.framework.Pattern;
   import org.apache.tools.ant.types.PatternSet;
  -import org.apache.tools.ant.types.NameEntry;
   
   /**
    * Export packages from the Visual Age for Java workspace. The packages are
  @@ -144,7 +144,7 @@
        *
        * @return Description of the Returned Value
        */
  -    public NameEntry createExclude()
  +    public Pattern createExclude()
       {
           return patternSet.createExclude();
       }
  @@ -154,7 +154,7 @@
        *
        * @return Description of the Returned Value
        */
  -    public NameEntry createInclude()
  +    public Pattern createInclude()
       {
           return patternSet.createInclude();
       }
  @@ -175,8 +175,8 @@
   
           // delegate the export to the VAJUtil object.
           getUtil().exportPackages( destDir,
  -                                  patternSet.getIncludePatterns( null ),
  -                                  patternSet.getExcludePatterns( null ),
  +                                  patternSet.getIncludePatterns( getContext() ),
  +                                  patternSet.getExcludePatterns( getContext() ),
                                     exportClasses, exportDebugInfo,
                                     exportResources, exportSources,
                                     useDefaultExcludes, overwrite );
  
  
  
  1.10      +3 -3      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Chmod.java	20 Jan 2002 02:36:21 -0000	1.9
  +++ Chmod.java	22 Jan 2002 12:14:58 -0000	1.10
  @@ -11,11 +11,11 @@
   import java.io.IOException;
   import org.apache.aut.nativelib.Os;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.framework.Pattern;
   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.NameEntry;
   import org.apache.tools.ant.types.PatternSet;
   
   /**
  @@ -119,7 +119,7 @@
        *
        * @return Description of the Returned Value
        */
  -    public NameEntry createExclude()
  +    public Pattern createExclude()
           throws TaskException
       {
           m_defaultSetDefined = true;
  @@ -131,7 +131,7 @@
        *
        * @return Description of the Returned Value
        */
  -    public NameEntry createInclude()
  +    public Pattern createInclude()
           throws TaskException
       {
           m_defaultSetDefined = true;
  
  
  
  1.15      +12 -15    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileSet.java
  
  Index: FileSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileSet.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- FileSet.java	13 Jan 2002 05:38:01 -0000	1.14
  +++ FileSet.java	22 Jan 2002 12:14:58 -0000	1.15
  @@ -10,6 +10,7 @@
   import java.io.File;
   import java.util.ArrayList;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.framework.Pattern;
   import org.apache.tools.ant.ProjectComponent;
   
   /**
  @@ -34,10 +35,6 @@
       private boolean m_isCaseSensitive = true;
       private File m_dir;
   
  -    public FileSet()
  -    {
  -    }
  -
       /**
        * Sets case sensitivity of the file system
        */
  @@ -76,9 +73,9 @@
        *
        * @param excl The file to fetch the exclude patterns from.
        */
  -    public void setExcludesfile( final File excl )
  +    public void setExcludesfile( final File excludesfile )
       {
  -        m_defaultPatterns.setExcludesfile( excl );
  +        m_defaultPatterns.setExcludesfile( excludesfile );
       }
   
       /**
  @@ -87,7 +84,7 @@
        *
        * @param includes the string containing the include patterns
        */
  -    public void setIncludes( String includes )
  +    public void setIncludes( final String includes )
       {
           m_defaultPatterns.setIncludes( includes );
       }
  @@ -97,9 +94,9 @@
        *
        * @param incl The file to fetch the include patterns from.
        */
  -    public void setIncludesfile( File incl )
  +    public void setIncludesfile( final File includesfile )
       {
  -        m_defaultPatterns.setIncludesfile( incl );
  +        m_defaultPatterns.setIncludesfile( includesfile );
       }
   
       public void setupDirectoryScanner( final FileScanner ds )
  @@ -124,8 +121,8 @@
               m_dir + " with " + m_defaultPatterns;
           getLogger().debug( message );
   
  -        ds.setIncludes( m_defaultPatterns.getIncludePatterns( null ) );
  -        ds.setExcludes( m_defaultPatterns.getExcludePatterns( null ) );
  +        ds.setIncludes( m_defaultPatterns.getIncludePatterns( getContext() ) );
  +        ds.setExcludes( m_defaultPatterns.getExcludePatterns( getContext() ) );
           if( m_useDefaultExcludes )
           {
               ds.addDefaultExcludes();
  @@ -167,7 +164,7 @@
       /**
        * add a name entry on the exclude list
        */
  -    public NameEntry createExclude()
  +    public Pattern createExclude()
       {
           return m_defaultPatterns.createExclude();
       }
  @@ -175,7 +172,7 @@
       /**
        * add a name entry on the include files list
        */
  -    public NameEntry createExcludesFile()
  +    public Pattern createExcludesFile()
       {
           return m_defaultPatterns.createExcludesFile();
       }
  @@ -183,7 +180,7 @@
       /**
        * add a name entry on the include list
        */
  -    public NameEntry createInclude()
  +    public Pattern createInclude()
       {
           return m_defaultPatterns.createInclude();
       }
  @@ -191,7 +188,7 @@
       /**
        * add a name entry on the include files list
        */
  -    public NameEntry createIncludesFile()
  +    public Pattern createIncludesFile()
       {
           return m_defaultPatterns.createIncludesFile();
       }
  
  
  
  1.12      +32 -37    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/PatternSet.java
  
  Index: PatternSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/PatternSet.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PatternSet.java	20 Jan 2002 17:35:00 -0000	1.11
  +++ PatternSet.java	22 Jan 2002 12:14:58 -0000	1.12
  @@ -14,7 +14,9 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.StringTokenizer;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.framework.Pattern;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.ProjectComponent;
   
  @@ -93,36 +95,27 @@
   
       /**
        * Sets the name of the file containing the includes patterns.
  -     *
  -     * @param includesFile The file to fetch the include patterns from.
  -     * @exception TaskException Description of Exception
        */
       public void setIncludesfile( File includesFile )
       {
           createIncludesFile().setName( includesFile.getAbsolutePath() );
       }
   
  -    /**
  -     * Returns the filtered include patterns.
  -     */
  -    public String[] getExcludePatterns( Project p )
  +    public String[] getExcludePatterns( final TaskContext context )
           throws TaskException
       {
  -        readFiles( p );
  -        return makeArray( m_excludeList );
  +        readFiles( context );
  +        return makeArray( m_excludeList, context );
       }
   
       /**
        * Returns the filtered include patterns.
  -     *
  -     * @param p Description of Parameter
  -     * @return The IncludePatterns value
        */
  -    public String[] getIncludePatterns( Project p )
  +    public String[] getIncludePatterns( final TaskContext context )
           throws TaskException
       {
  -        readFiles( p );
  -        return makeArray( m_includeList );
  +        readFiles( context );
  +        return makeArray( m_includeList, context );
       }
   
       /**
  @@ -131,7 +124,7 @@
       protected void append( PatternSet other )
           throws TaskException
       {
  -        String[] incl = other.getIncludePatterns( null );
  +        String[] incl = other.getIncludePatterns( (TaskContext)null );
           if( incl != null )
           {
               for( int i = 0; i < incl.length; i++ )
  @@ -140,7 +133,7 @@
               }
           }
   
  -        String[] excl = other.getExcludePatterns( null );
  +        String[] excl = other.getExcludePatterns( (TaskContext)null );
           if( excl != null )
           {
               for( int i = 0; i < excl.length; i++ )
  @@ -155,7 +148,7 @@
        *
        * @return Description of the Returned Value
        */
  -    public NameEntry createExclude()
  +    public Pattern createExclude()
       {
           return addPatternToList( m_excludeList );
       }
  @@ -165,7 +158,7 @@
        *
        * @return Description of the Returned Value
        */
  -    public NameEntry createExcludesFile()
  +    public Pattern createExcludesFile()
       {
           return addPatternToList( m_excludesFileList );
       }
  @@ -173,7 +166,7 @@
       /**
        * add a name entry on the include list
        */
  -    public NameEntry createInclude()
  +    public Pattern createInclude()
       {
           return addPatternToList( m_includeList );
       }
  @@ -181,7 +174,7 @@
       /**
        * add a name entry on the include files list
        */
  -    public NameEntry createIncludesFile()
  +    public Pattern createIncludesFile()
       {
           return addPatternToList( m_includesFileList );
       }
  @@ -204,17 +197,17 @@
       /**
        * add a name entry to the given list
        */
  -    private NameEntry addPatternToList( final ArrayList list )
  +    private Pattern addPatternToList( final ArrayList list )
       {
  -        final NameEntry result = new NameEntry( this );
  +        final Pattern result = new Pattern();
           list.add( result );
           return result;
       }
   
       /**
  -     * Convert a vector of NameEntry elements into an array of Strings.
  +     * Convert a vector of Pattern elements into an array of Strings.
        */
  -    private String[] makeArray( final ArrayList list )
  +    private String[] makeArray( final ArrayList list, final TaskContext context )
       {
           if( list.size() == 0 )
           {
  @@ -224,8 +217,8 @@
           final ArrayList tmpNames = new ArrayList();
           for( Iterator e = list.iterator(); e.hasNext(); )
           {
  -            final NameEntry ne = (NameEntry)e.next();
  -            final String pattern = ne.evalName( null );
  +            final Pattern ne = (Pattern)e.next();
  +            final String pattern = ne.evaluateName( context );
               if( pattern != null && pattern.length() > 0 )
               {
                   tmpNames.add( pattern );
  @@ -239,7 +232,7 @@
       /**
        * Read includesfile ot excludesfile if not already done so.
        */
  -    private void readFiles( Project p )
  +    private void readFiles( final TaskContext context )
           throws TaskException
       {
           if( m_includesFileList.size() > 0 )
  @@ -247,17 +240,18 @@
               Iterator e = m_includesFileList.iterator();
               while( e.hasNext() )
               {
  -                NameEntry ne = (NameEntry)e.next();
  -                String fileName = ne.evalName( p );
  +                Pattern ne = (Pattern)e.next();
  +                String fileName = ne.evaluateName( (TaskContext)null );
                   if( fileName != null )
                   {
                       File inclFile = resolveFile( fileName );
  -                    if( !inclFile.exists() ) {
  +                    if( !inclFile.exists() )
  +                    {
                           throw new TaskException( "Includesfile "
                                                    + inclFile.getAbsolutePath()
                                                    + " not found." );
                       }
  -                    readPatterns( inclFile, m_includeList, p );
  +                    readPatterns( inclFile, m_includeList, null );
                   }
               }
               m_includesFileList.clear();
  @@ -268,17 +262,18 @@
               Iterator e = m_excludesFileList.iterator();
               while( e.hasNext() )
               {
  -                NameEntry ne = (NameEntry)e.next();
  -                String fileName = ne.evalName( p );
  +                Pattern ne = (Pattern)e.next();
  +                String fileName = ne.evaluateName( null );
                   if( fileName != null )
                   {
                       File exclFile = resolveFile( fileName );
  -                    if( !exclFile.exists() ) {
  +                    if( !exclFile.exists() )
  +                    {
                           throw new TaskException( "Excludesfile "
                                                    + exclFile.getAbsolutePath()
                                                    + " not found." );
                       }
  -                    readPatterns( exclFile, m_excludeList, p );
  +                    readPatterns( exclFile, m_excludeList, null );
                   }
               }
               m_excludesFileList.clear();
  @@ -305,7 +300,7 @@
               patternReader =
                   new BufferedReader( new FileReader( patternfile ) );
   
  -            // Create one NameEntry in the appropriate pattern list for each
  +            // Create one Pattern in the appropriate pattern list for each
               // line in the file.
               String line = patternReader.readLine();
               while( line != null )
  
  
  

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