jvanzyl     02/02/12 08:51:16

  Modified:    src/tdk/task/org/apache/tdk CreatePath.java
  Log:
  - created a little task that will create a pattern set from a descriptor file.
    the patternset class has the capability to read in separate include/exclude
    files but i like keeping the whole patternset in one file. and i like
    being able to have comments in there as well.
  
  Revision  Changes    Path
  1.3       +6 -55     jakarta-turbine-tdk/src/tdk/task/org/apache/tdk/CreatePath.java
  
  Index: CreatePath.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-tdk/src/tdk/task/org/apache/tdk/CreatePath.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CreatePath.java   12 Feb 2002 14:34:13 -0000      1.2
  +++ CreatePath.java   12 Feb 2002 16:51:16 -0000      1.3
  @@ -64,7 +64,6 @@
   import org.apache.tools.ant.BuildException;
   
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   
   /**
    * Task that creates a referable path based on the contents of a descriptor
  @@ -98,7 +97,7 @@
    *
    * <pre>
    * <create-path
  - *   pathId="classpath"
  + *   id="classpath"
    *   pathDescriptor="deps.list"
    *   basedir="${lib.repo}"
    * />
  @@ -112,23 +111,13 @@
    * in subsequent tasks that can utilize references to paths.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
  - * @version $Id: CreatePath.java,v 1.2 2002/02/12 14:34:13 jvanzyl Exp $
  + * @version $Id: CreatePath.java,v 1.3 2002/02/12 16:51:16 jvanzyl Exp $
    *
    */
   public class CreatePath 
  -    extends Task
  +    extends CreateReference
   {
       /**
  -     * source file, usually null
  -     */
  -    private File pathDescriptor = null;
  -
  -    /**
  -     * what to do when it goes pear-shaped
  -     */
  -    private boolean failOnError = true;
  -
  -    /**
        * Base directory used to prefix the entries in the path descriptor.
        */
       private File baseDir;
  @@ -139,12 +128,6 @@
       private Path path;
   
       /**
  -     * The id to use when creating a reference to the created path
  -     * in the project.
  -     */
  -    private String pathId;
  -
  -    /**
        * Default constructor
        */
       public CreatePath()
  @@ -165,38 +148,6 @@
       }
   
       /**
  -     * Id to use for creating a reference to the path
  -     * in the project.
  -     *
  -     * @param pathId Reference identifier to use in the call
  -     *               to project.addReference(pathId, path).
  -     */
  -    public void setPathid(String pathId)
  -    {
  -        this.pathId = pathId;
  -    }
  -
  -    /**
  -     * Sets the pathDescriptor attribute.
  -     *
  -     * @param pathDescriptor The new pathDescriptor value
  -     */
  -    public void setPathdescriptor(File pathDescriptor)
  -    {
  -        this.pathDescriptor = pathDescriptor;
  -    }
  -
  -    /**
  -     * Sets the Failonerror attribute of the LoadFile object
  -     *
  -     * @param fail The new Failonerror value
  -     */
  -    public void setFailonerror(boolean fail)
  -    {
  -        failOnError = fail;
  -    }
  -
  -    /**
        * read in a source file to a property
        *
        * @exception BuildException if something goes wrong with the build
  @@ -205,7 +156,7 @@
           throws BuildException
       {
           // Make sure that we have a valid path descriptor.
  -        if (pathDescriptor == null)
  +        if (descriptor == null)
           {
               throw new BuildException("Path descriptor file not defined");
           }
  @@ -214,7 +165,7 @@
           BufferedReader in = null;
           try
           {
  -            in = new BufferedReader(new FileReader(pathDescriptor));
  +            in = new BufferedReader(new FileReader(descriptor));
               while ((line = in.readLine()) != null)
               {
                   line = line.trim();
  @@ -250,7 +201,7 @@
               }
               
               // Add the top-level path as a reference to the project.
  -            project.addReference(pathId, path);
  +            project.addReference(rid, path);
           }
           catch (IOException ioe)
           {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to