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/taskdefs/optional/ide VAJExport.java
Date Fri, 25 Jan 2002 23:21:21 GMT
donaldp     02/01/25 15:21:21

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/types
                        FileSet.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/unix
                        Chmod.java
               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
  Added:       proposal/myrmidon/src/java/org/apache/myrmidon/framework
                        PatternSet.java
  Removed:     proposal/myrmidon/src/main/org/apache/tools/ant/types
                        PatternSet.java
  Log:
  Migrate patternset to framework package
  
  Revision  Changes    Path
  1.17      +1 -0      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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- FileSet.java	23 Jan 2002 10:21:54 -0000	1.16
  +++ FileSet.java	25 Jan 2002 23:21:21 -0000	1.17
  @@ -11,6 +11,7 @@
   import java.util.ArrayList;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.Pattern;
  +import org.apache.myrmidon.framework.PatternSet;
   import org.apache.tools.ant.ProjectComponent;
   
   /**
  
  
  
  1.12      +1 -1      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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Chmod.java	23 Jan 2002 10:21:54 -0000	1.11
  +++ Chmod.java	25 Jan 2002 23:21:21 -0000	1.12
  @@ -16,7 +16,7 @@
   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.myrmidon.framework.PatternSet;
   
   /**
    * Chmod equivalent for unix-like environments.
  
  
  
  1.17      +1 -1      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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Expand.java	24 Jan 2002 11:38:05 -0000	1.16
  +++ Expand.java	25 Jan 2002 23:21:21 -0000	1.17
  @@ -21,7 +21,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.types.DirectoryScanner;
   import org.apache.tools.ant.types.FileSet;
  -import org.apache.tools.ant.types.PatternSet;
  +import org.apache.myrmidon.framework.PatternSet;
   import org.apache.tools.ant.types.ScannerUtil;
   
   /**
  
  
  
  1.14      +1 -1      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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- MatchingTask.java	23 Jan 2002 10:21:53 -0000	1.13
  +++ MatchingTask.java	25 Jan 2002 23:21:21 -0000	1.14
  @@ -13,7 +13,7 @@
   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.PatternSet;
  +import org.apache.myrmidon.framework.PatternSet;
   
   /**
    * This is an abstract task that should be used by all those tasks that require
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/PatternSet.java
  
  Index: PatternSet.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.framework;
  
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.StringTokenizer;
  import org.apache.myrmidon.api.TaskContext;
  import org.apache.myrmidon.api.TaskException;
  
  /**
   * Named collection of include/exclude tags. <p>
   *
   * @author <a href="mailto:ajkuiper@wxs.nl">Arnout J. Kuiper</a>
   * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
   * @author <a href="mailto:rubys@us.ibm.com">Sam Ruby</a>
   * @author <a href="mailto:jon@clearink.com">Jon S. Stevens</a>
   * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public class PatternSet
  {
      private ArrayList m_includeList = new ArrayList();
      private ArrayList m_excludeList = new ArrayList();
  
      /**
       * Sets the set of exclude patterns. Patterns may be separated by a comma or
       * a space.
       *
       * @param excludes the string containing the exclude patterns
       */
      public void setExcludes( final String excludes )
      {
          final Pattern[] patterns = parsePatterns( excludes );
          for( int i = 0; i < patterns.length; i++ )
          {
              addExclude( patterns[ i ] );
          }
      }
  
      /**
       * Sets the set of include patterns. Patterns may be separated by a comma or
       * a space.
       *
       * @param includes the string containing the include patterns
       */
      public void setIncludes( final String includes )
      {
          final Pattern[] patterns = parsePatterns( includes );
          for( int i = 0; i < patterns.length; i++ )
          {
              addInclude( patterns[ i ] );
          }
      }
  
      /**
       * add a name entry on the exclude list
       */
      public void addExclude( final Pattern pattern )
      {
          m_excludeList.add( pattern );
      }
  
      /**
       * add a name entry on the include list
       */
      public void addInclude( final Pattern pattern )
      {
          m_includeList.add( pattern );
      }
  
      public String[] getExcludePatterns( final TaskContext context )
          throws TaskException
      {
          return toArray( m_excludeList, context );
      }
  
      /**
       * Returns the filtered include patterns.
       */
      public String[] getIncludePatterns( final TaskContext context )
          throws TaskException
      {
          return toArray( m_includeList, context );
      }
  
      /**
       * Adds the patterns of the other instance to this set.
       */
      protected void append( final PatternSet other )
      {
          m_includeList.addAll( other.m_includeList );
          m_excludeList.addAll( other.m_excludeList );
      }
  
      public String toString()
      {
          return "PatternSet [ includes: " + m_includeList +
              " excludes: " + m_excludeList + " ]";
      }
  
      private Pattern[] parsePatterns( final String patternString )
      {
          final ArrayList patterns = new ArrayList();
          if( patternString != null && patternString.length() > 0 )
          {
              StringTokenizer tok = new StringTokenizer( patternString, ", ", false );
              while( tok.hasMoreTokens() )
              {
                  final Pattern pattern = new Pattern( tok.nextToken() );
                  patterns.add( pattern );
              }
          }
  
          return (Pattern[])patterns.toArray( new Pattern[ patterns.size() ] );
      }
  
      /**
       * Convert a vector of Pattern elements into an array of Strings.
       */
      private String[] toArray( final ArrayList list, final TaskContext context )
      {
          if( list.size() == 0 )
          {
              return null;
          }
  
          final ArrayList names = new ArrayList();
          final Iterator e = list.iterator();
          while( e.hasNext() )
          {
              final Pattern pattern = (Pattern)e.next();
              final String result = pattern.evaluateName( context );
              if( null != result && result.length() > 0 )
              {
                  names.add( result );
              }
          }
  
          return (String[])names.toArray( new String[ names.size() ] );
      }
  }
  
  
  
  1.8       +1 -1      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- VAJExport.java	23 Jan 2002 10:21:54 -0000	1.7
  +++ VAJExport.java	25 Jan 2002 23:21:21 -0000	1.8
  @@ -10,7 +10,7 @@
   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.myrmidon.framework.PatternSet;
   
   /**
    * Export packages from the Visual Age for Java workspace. The packages are
  
  
  

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