jvanzyl     02/04/19 07:51:57

  Modified:    src/java/org/apache/maven/reactor ReactorGenerator.java
  Log:
  Now uses the MavenUtils.getWorkspace() method.
  
  Revision  Changes    Path
  1.5       +68 -10    
jakarta-turbine-maven/src/java/org/apache/maven/reactor/ReactorGenerator.java
  
  Index: ReactorGenerator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/reactor/ReactorGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ReactorGenerator.java     18 Apr 2002 14:51:26 -0000      1.4
  +++ ReactorGenerator.java     19 Apr 2002 14:51:57 -0000      1.5
  @@ -66,6 +66,9 @@
   
   import org.apache.commons.xo.Mapper;
   
  +import org.apache.maven.MavenUtils;
  +import org.apache.maven.project.Project;
  +import org.apache.maven.project.Profile;
   import org.apache.maven.project.Workspace;
   
   import org.apache.velocity.context.Context;
  @@ -80,7 +83,7 @@
    * Task for controlling a multi-project build. 
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
  - * @version $Id: ReactorGenerator.java,v 1.4 2002/04/18 14:51:26 jvanzyl Exp $
  + * @version $Id: ReactorGenerator.java,v 1.5 2002/04/19 14:51:57 jvanzyl Exp $
    */
   public class ReactorGenerator
        extends TexenTask
  @@ -91,6 +94,16 @@
       private File workspaceDescriptor;
   
       /**
  +     * Profile descriptor used to control a build session in in Maven.
  +     */
  +    private File profileDescriptor;
  +
  +    /**
  +     * Set the maven local repo where we can find all the project descriptors.
  +     */
  +    private File mavenLocalRepo;
  +
  +    /**
        * Set the workspace that will be used with this Maven build.
        *
        * @param workspace descriptor
  @@ -110,6 +123,46 @@
           return workspaceDescriptor;
       }
   
  +    /**
  +     * Set the workspace that will be used with this Maven build.
  +     *
  +     * @param workspace descriptor
  +     */
  +    public void setProfileDescriptor(File profileDescriptor)
  +    {
  +        this.profileDescriptor = profileDescriptor;
  +    }
  +
  +    /**
  +     * Get the workspace descriptor being used with this Maven build.
  +     *
  +     * @return File workspace descriptor
  +     */
  +    public File getProfileDescriptor()
  +    {
  +        return profileDescriptor;
  +    }
  +
  +    /**
  +     * Set the maven local repo.
  +     *
  +     * @param mavenLocalRepo
  +     */
  +    public void setMavenLocalRepo(File mavenLocalRepo)
  +    {
  +        this.mavenLocalRepo = mavenLocalRepo;
  +    }
  +
  +    /**
  +     * Get the maven local repo
  +     *
  +     * @return File mavenLocalRepo
  +     */
  +    public File getMavenLocalRepo()
  +    {
  +        return mavenLocalRepo;
  +    }
  +
       protected Context context;
   
       /**
  @@ -120,18 +173,17 @@
       public Context initControlContext()
           throws Exception
       {
  +        checkPrerequisites();
  +        
           context = new VelocityContext();
           
           try
           {
  -            Mapper m = new Mapper();        
  -            
  -            m.setDebug(true);
  -            
  -            m.setInclusionRule("profile", "../profile");
  -            m.setInclusionRule("project", "../project");
  -            Workspace w = (Workspace) m.map(workspaceDescriptor, 
Workspace.class.getName());
  -            context.put("workspace", w);
  +            // Create our workspace
  +            Workspace workspace = MavenUtils.getWorkspace(workspaceDescriptor, 
  +                                                          profileDescriptor, 
  +                                                          mavenLocalRepo);
  +            context.put("workspace", workspace);
           
               return context;
           }
  @@ -150,7 +202,13 @@
           // Make sure a workspace descriptor has been specified.
           if (workspaceDescriptor == null)
           {
  -            throw new Exception("workspace attribute must be set!");
  +            throw new Exception("workspaceDescriptor attribute must be set!");
  +        }
  +        
  +        // Make sure a profile descriptor has been specified.
  +        if (profileDescriptor == null)
  +        {
  +            throw new Exception("profileDescriptor attribute must be set!");
           }
       }
   }
  
  
  


Reply via email to