jvanzyl     2002/07/05 20:55:27

  Modified:    src/java/org/apache/maven BaseProjectTask.java
  Removed:     src/java/org/apache/maven/ant UserProperty.java
  Log:
  o Cleaning up the BaseProjectTask, it is really only used now to generate
    the xdocs from the POM.
  o Getting rid of more ant cruft.
  
  Revision  Changes    Path
  1.20      +3 -60     
jakarta-turbine-maven/src/java/org/apache/maven/BaseProjectTask.java
  
  Index: BaseProjectTask.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/BaseProjectTask.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- BaseProjectTask.java      22 Jun 2002 03:28:28 -0000      1.19
  +++ BaseProjectTask.java      6 Jul 2002 03:55:27 -0000       1.20
  @@ -57,9 +57,6 @@
    */
   
   import java.io.File;
  -import java.util.ArrayList;
  -import java.util.HashMap;
  -import java.util.Enumeration;
   
   import org.apache.tools.ant.BuildException;
   
  @@ -68,12 +65,10 @@
   import org.apache.velocity.context.Context;
   import org.apache.velocity.VelocityContext;
   import org.apache.velocity.texen.ant.TexenTask;
  -import org.apache.velocity.anakia.Escape;
  -
  -import org.apache.maven.ant.ListTask;
   
   /**
  - * An ant task for creating an xml schema from an sql schema
  + * Used for generating xdoc formatted documenation from
  + * the POM.
    *
    * @author <a href="[EMAIL PROTECTED]">Jason van Zyl</a>
    * @version $Id$
  @@ -97,12 +92,6 @@
       private Project mavenProject;
   
       /**
  -     * The list of JARs used to create the maven classpath
  -     * which is used internally by Maven.
  -     */
  -    private File listFile;
  -
  -    /**
        * Set the project descriptor file. This file must exist.
        * @param projectDescriptor the project descriptor file
        */
  @@ -112,15 +101,6 @@
       }
   
       /**
  -     * Set the list file that holds jar file names. This file must exist
  -     * @param listFile the list file
  -     */
  -    public void setListFile(File listFile)
  -    {
  -        this.listFile = listFile;
  -    }
  -
  -    /**
        * Execute the task.
        *
        * @return the velocity context for use in DVSL/Velocity
  @@ -134,21 +114,7 @@
           try
           {
               mavenProject = MavenUtils.getProject(projectDescriptor);
  -
  -            context.put("buildElements", new ArrayList());
  -            context.put("delegators", new HashMap());
               context.put("project", mavenProject);
  -
  -            if (listFile != null)
  -            {
  -                context.put("jars", ListTask.getList(listFile));
  -            }
  -
  -            context.put("callbacks", new HashMap());
  -            context.put("escape", new Escape());
  -
  -            exportMavenProperties(context);
  -
               return context;
           }
           catch (Exception e)
  @@ -157,29 +123,6 @@
               // the stacktrace will appear in the standard
               // ant output.
               throw new BuildException(e);
  -        }
  -    }
  -
  -    /**
  -     * Export all Ant Maven properties to the Velocity context (ie all
  -     * properties starting with "maven" will be exported). Exported properties
  -     * will have any "." replaced by a "-" as "." is a reserved keyword in
  -     * VTL.
  -     *
  -     * @param context the Velocity context
  -     */
  -    protected void exportMavenProperties(Context context)
  -    {
  -        Enumeration propertyNames = getProject().getProperties().keys();
  -        while (propertyNames.hasMoreElements())
  -        {
  -            String propertyName = (String) propertyNames.nextElement();
  -            if (propertyName.startsWith("maven"))
  -            {
  -                String normalizedPropertyName = propertyName.replace('.', '-');
  -                context.put(normalizedPropertyName,
  -                    getProject().getProperty(propertyName));
  -            }
           }
       }
   }
  
  
  

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

Reply via email to