werken      2002/06/25 06:54:50

  Modified:    src/java/org/apache/maven/app Maven.java
  Log:
  * reworking 2-phase initialization.
  
  Revision  Changes    Path
  1.14      +22 -38    jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java
  
  Index: Maven.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Maven.java        25 Jun 2002 03:07:11 -0000      1.13
  +++ Maven.java        25 Jun 2002 13:54:50 -0000      1.14
  @@ -115,14 +115,11 @@
       // ------------------------------------------------------------
   
       /** Filename of project-specific maven buildfile. */
  -    public static final String PROJECT_BUILD_FILE_NAME = "build.maven";
  +    public static final String PROJECT_BUILD_FILE_NAME = "maven.xml";
   
       /** Filename of project descriptor. */
       public static final String PROJECT_DESCRIPTOR_FILE_NAME = "project-ng.xml";
   
  -    /** Filename of project maven script. */
  -    public static final String PROJECT_MAVEN_SCRIPT_NAME = "maven.xml";
  -
       /** Plug-in main script name. */
       public static final String PLUGIN_SCRIPT_NAME = "plugin.jelly";
   
  @@ -413,16 +410,6 @@
           return this.mavenBin;
       }
   
  -    /** Retrieve the project's script file.
  -     *
  -     *  @return The project's script file.
  -     */
  -    public File getProjectScript()
  -    {
  -        return new File(getDir(),
  -                        PROJECT_MAVEN_SCRIPT_NAME);
  -    }
  -
       /** Retrieve the list of goal names.
        *
        *  @return The list of goal names.
  @@ -662,35 +649,30 @@
           System.setErr(demuxErr);
       }
   
  -    /** Initialize all plugins.
  +    /** Perform pre-build initialization.
        *
  -     *  @throws Exception If an error occurs while initializing
  -     *          any plugin.
  +     *  @throws Exception If an error occurs while performing
  +     *          runtime initialization.
        */
  -    void initializePlugins() throws Exception
  +    void runtimeInitialization() throws Exception
       {
  -        this.pluginManager = new PluginManager();
  -        this.pluginManager.setPluginDirectory(getPluginsDir().getPath());
  -
  -        List plugins = this.pluginManager.getInstalledPlugins();
  -
  -        Iterator pluginIter = plugins.iterator();
  -        Plugin   eachPlugin = null;
  -
  -        while (pluginIter.hasNext())
  -        {
  -            eachPlugin = (Plugin) pluginIter.next();
  -            // System.err.println(eachPlugin);
  -        }
  +        initializeDriver();
  +        initializePlugins();
  +        loadProjectBuildFile();
       }
   
  +    void initializeDriver() 
  +    {
  +        getJellyContext().setVariable( "pom",
  +                                       getProjectDescriptor().getProject() );
  +    }
   
  -    /** Load all plugins.
  +    /** Initialize all plugins.
        *
        *  @throws Exception If an error occurs while initializing
        *          any plugin.
        */
  -    void loadPlugins() throws Exception
  +    void initializePlugins() throws Exception
       {
           File pluginsDir = getPluginsDir();
   
  @@ -718,9 +700,11 @@
   
           if (!pluginScript.exists())
           {
  +            /*
               output.write("Unable to load plugin script: "
                            + pluginScript
                            + "\n");
  +            */
               return;
           }
   
  @@ -854,16 +838,16 @@
        *  @throws Exception if there is an error loading
        *          the project's maven.xml script.
        */
  -    void loadProjectScript() throws Exception
  +    void loadProjectBuildFile() throws Exception
       {
  -        File projectScript = getProjectScript();
  +        File projectBuildFile = getProjectBuildFile();
   
  -        if (!projectScript.exists())
  +        if (!projectBuildFile.exists())
           {
               return;
           }
   
  -        JellyUtils.runScript(projectScript,
  +        JellyUtils.runScript(projectBuildFile,
                                null,
                                getJellyContext(),
                                getXMLOutput());
  @@ -1218,7 +1202,7 @@
   
           try
           {
  -            initializePlugins();
  +            runtimeInitialization();
   
               if (this.cli.hasOption('g'))
               {
  
  
  

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

Reply via email to