You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2002/11/30 18:18:02 UTC

cvs commit: jakarta-turbine-maven/src/java/org/apache/maven/app PluginManager.java

jvanzyl     2002/11/30 09:18:02

  Modified:    src/java/org/apache/maven/app PluginManager.java
  Log:
  refactoring
  
  Revision  Changes    Path
  1.59      +7 -106    jakarta-turbine-maven/src/java/org/apache/maven/app/PluginManager.java
  
  Index: PluginManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/app/PluginManager.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- PluginManager.java	27 Nov 2002 01:24:00 -0000	1.58
  +++ PluginManager.java	30 Nov 2002 17:18:02 -0000	1.59
  @@ -58,12 +58,6 @@
   
   import com.werken.forehead.Forehead;
   import com.werken.werkz.Goal;
  -import org.apache.commons.grant.GrantProject;
  -import org.apache.commons.jelly.JellyContext;
  -import org.apache.commons.jelly.XMLOutput;
  -import org.apache.commons.jelly.expression.CompositeExpression;
  -import org.apache.commons.jelly.expression.Expression;
  -import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.maven.CreateDependencyClasspath;
  @@ -103,7 +97,6 @@
    *
    * @version $Id$
    *
  - * @todo Get rid of while iterator idiom.
    */
   public class PluginManager
   {
  @@ -137,21 +130,9 @@
       /** ${maven.home}/bin/plugins directory. */
       private File pluginsDir;
   
  -    /** Jelly's output. */
  -    private XMLOutput output;
  -
       /** Jelly conext. */
       private MavenJellyContext context;
   
  -    /** The Ant project. */
  -    private GrantProject antProject;
  -
  -    /** ${maven.home}/ directory. */
  -    private File mavenHome;
  -
  -    /** Project verifier */
  -    private ProjectVerifier projectVerifier;
  -
       /** Plugins cache. */
       private Properties pluginsCache;
   
  @@ -184,7 +165,7 @@
        *
        * @throws Exception If an error occurs while initializing any plugin.
        */
  -    public void initializePlugins()
  +    public void initialize()
           throws Exception
       {
           setPluginsDir( new File( (String) context.getVariable( MavenConstants.HOME ), "plugins" ) );
  @@ -573,7 +554,7 @@
           JellyUtils.runScript( projectBuildFile,
                                 projectBuildFile.getParentFile().toURL(),
                                 pluginJellyContext,
  -                              getXMLOutput() );
  +                              getContext().getXMLOutput() );
   
           Set currentGoals = new HashSet( werkzProject.getGoals() );
   
  @@ -917,8 +898,8 @@
                   log.debug( "VERIFYING PLUGIN" );
               }
               // Retrieve the dependencies that this plugin requires.
  -            getProjectVerifier().setMavenProject( pluginProject );
  -            getProjectVerifier().doExecute();
  +            //getContext().getProjectVerifier().setMavenProject( pluginProject );
  +            getContext().getProjectVerifier().execute();
   
               // Mark the plugin as processed.
               createNewFile( getPluginProcessedMarker( name ) );
  @@ -1001,7 +982,7 @@
           JellyUtils.runScript( pluginScript,
                                 getPluginDir( name ).toURL(),
                                 pluginJellyContext,
  -                              getXMLOutput() );
  +                              getContext().getXMLOutput() );
       }
   
       /**
  @@ -1090,49 +1071,9 @@
       }
   
       /**
  -     * Set Maven home.
  -     *
  -     * @param mavenHome The location of maven home in the file system.
  -     */
  -    public void setMavenHome( File mavenHome )
  -    {
  -        this.mavenHome = mavenHome;
  -    }
  -
  -    /**
  -     * Retrieve Maven home.
  -     *
  -     * @return File The location of maven home in the file system.
  -     */
  -    public File getMavenHome()
  -    {
  -        return mavenHome;
  -    }
  -
  -    /**
  -     * Set Ant project.
  -     *
  -     * @param antProject The ant project.
  -     */
  -    public void setAntProject( GrantProject antProject )
  -    {
  -        this.antProject = antProject;
  -    }
  -
  -    /**
  -     * Retrieve the Ant project.
  -     *
  -     * @return The ant project.
  -     */
  -    public GrantProject getAntProject()
  -    {
  -        return this.antProject;
  -    }
  -
  -    /**
        * Set Jelly context.
        *
  -     * @param jellyContext The maven jelly context.
  +     * @param context The maven jelly context.
        */
       public void setContext( MavenJellyContext context )
       {
  @@ -1150,26 +1091,6 @@
       }
   
       /**
  -     * Sets the XMLOutput attribute of the PluginManager object
  -     *
  -     * @param output Jelly XMLOutput.
  -     */
  -    public void setXMLOutput( XMLOutput output )
  -    {
  -        this.output = output;
  -    }
  -
  -    /**
  -     * Retrieve the XML execution output sink.
  -     *
  -     * @return The output sink.
  -     */
  -    public XMLOutput getXMLOutput()
  -    {
  -        return this.output;
  -    }
  -
  -    /**
        * Sets the pluginsDir attribute of the PluginManager object
        *
        * @param pluginsDir The maven plugin directory.
  @@ -1187,25 +1108,5 @@
       public File getPluginsDir()
       {
           return this.pluginsDir;
  -    }
  -
  -    /**
  -     * Set the project verifier.
  -     *
  -     * @param projectVerifier The maven project verifier.
  -     */
  -    public void setProjectVerifier( ProjectVerifier projectVerifier )
  -    {
  -        this.projectVerifier = projectVerifier;
  -    }
  -
  -    /**
  -     * Get the project verifier.
  -     *
  -     * @return ProjectVerifier The maven project verfier.
  -     */
  -    public ProjectVerifier getProjectVerifier()
  -    {
  -        return projectVerifier;
       }
   }