continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epunza...@apache.org
Subject svn commit: r439056 - in /maven/continuum/branches/release-integration: ./ continuum-core/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/resources/META-INF/plexus/ continuum-release/ continuum-release/src/main/java/or...
Date Thu, 31 Aug 2006 21:42:47 GMT
Author: epunzalan
Date: Thu Aug 31 14:42:46 2006
New Revision: 439056

URL: http://svn.apache.org/viewvc?rev=439056&view=rev
Log:
PR: CONTINUUM-727

- added the release manager in continuum-core
- enabled prepare and perform releases in continuum release manager
- created plexus tasks and task executors (not yet used, brett said they can come in later)

Added:
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseResult.java
  (with props)
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/evaluators/
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
  (with props)
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
  (with props)
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
  (with props)
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
  (with props)
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
  (with props)
Modified:
    maven/continuum/branches/release-integration/continuum-core/pom.xml
    maven/continuum/branches/release-integration/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/branches/release-integration/continuum-core/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/branches/release-integration/continuum-release/pom.xml
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseException.java
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
    maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
    maven/continuum/branches/release-integration/continuum-release/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/branches/release-integration/continuum-release/src/test/java/org/apache/maven/continuum/ContinuumReleaseManagerTest.java
    maven/continuum/branches/release-integration/pom.xml

Modified: maven/continuum/branches/release-integration/continuum-core/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-core/pom.xml?rev=439056&r1=439055&r2=439056&view=diff
==============================================================================
--- maven/continuum/branches/release-integration/continuum-core/pom.xml (original)
+++ maven/continuum/branches/release-integration/continuum-core/pom.xml Thu Aug 31 14:42:46
2006
@@ -155,5 +155,10 @@
       <artifactId>plexus-mail-sender-simple</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.continuum</groupId>
+      <artifactId>continuum-release</artifactId>
+      <version>1.1-SNAPSHOT</version>
+    </dependency>
   </dependencies>
 </project>

Modified: maven/continuum/branches/release-integration/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=439056&r1=439055&r2=439056&view=diff
==============================================================================
--- maven/continuum/branches/release-integration/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/branches/release-integration/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Thu Aug 31 14:42:46 2006
@@ -50,6 +50,7 @@
 import org.apache.maven.continuum.utils.PlexusContainerManager;
 import org.apache.maven.continuum.utils.ProjectSorter;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
+import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.action.Action;
@@ -136,6 +137,11 @@
     private TaskQueue checkoutQueue;
 
     /**
+     * @plexus.requirement
+     */
+    private ContinuumReleaseManager releaseManager;
+
+    /**
      * @plexus.configuration
      */
     private String workingDirectory;
@@ -170,6 +176,11 @@
         } );
     }
 
+    public ContinuumReleaseManager getReleaseManager()
+    {
+        return releaseManager;
+    }
+
     public void setActionManager( ActionManager actionManager )
     {
         this.actionManager = actionManager;
@@ -479,7 +490,6 @@
      * fire off a build for all of the projects in a project group using their default builds
      *
      * @param projectGroupId
-     * @param trigger
      * @throws ContinuumException
      */
     public void buildProjectGroup( int projectGroupId )

Modified: maven/continuum/branches/release-integration/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=439056&r1=439055&r2=439056&view=diff
==============================================================================
--- maven/continuum/branches/release-integration/continuum-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/branches/release-integration/continuum-core/src/main/resources/META-INF/plexus/components.xml
Thu Aug 31 14:42:46 2006
@@ -22,6 +22,9 @@
         <requirement>
           <role>org.apache.maven.continuum.build.settings.SchedulesActivator</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.release.ContinuumReleaseManager</role>
+        </requirement>
         <!-- from core -->
         <requirement>
           <role>org.codehaus.plexus.taskqueue.TaskQueue</role>

Modified: maven/continuum/branches/release-integration/continuum-release/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/pom.xml?rev=439056&r1=439055&r2=439056&view=diff
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/pom.xml (original)
+++ maven/continuum/branches/release-integration/continuum-release/pom.xml Thu Aug 31 14:42:46
2006
@@ -18,5 +18,10 @@
       <artifactId>maven-release-plugin</artifactId>
       <version>2.0-beta-5-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-taskqueue</artifactId>
+      <version>1.0-alpha-3</version>
+    </dependency>
   </dependencies>
 </project>

Modified: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseException.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseException.java?rev=439056&r1=439055&r2=439056&view=diff
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseException.java
(original)
+++ maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseException.java
Thu Aug 31 14:42:46 2006
@@ -1,5 +1,21 @@
 package org.apache.maven.continuum.release;
 
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 /**
  * @author Jason van Zyl
  */

Modified: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java?rev=439056&r1=439055&r2=439056&view=diff
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
(original)
+++ maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
Thu Aug 31 14:42:46 2006
@@ -1,6 +1,25 @@
 package org.apache.maven.continuum.release;
 
-import org.apache.maven.plugins.release.model.Release;
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.settings.Settings;
+
+import java.io.File;
 
 /**
  * The Continuum Release Manager is responsible for performing releases based on a release
descriptor
@@ -16,11 +35,21 @@
     String ROLE = ContinuumReleaseManager.class.getName();
 
     /**
+     * Prepare a project for release which also updates the release descriptor
+     *
+     * @param descriptor
+     * @throws ContinuumReleaseException
+     */
+    void prepare( ReleaseDescriptor descriptor, Settings settings )
+        throws ContinuumReleaseException;
+
+    /**
      * Perform a release based on a release descriptor received by the Maven Release Plugin.
      *
-     * @param release
+     * @param descriptor
      * @throws ContinuumReleaseException
      */
-    void release( Release release )
+    void perform( ReleaseDescriptor descriptor, Settings settings, File buildDirectory,
+                  String goals, boolean useReleaseProfile )
         throws ContinuumReleaseException;
 }

Added: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseResult.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseResult.java?rev=439056&view=auto
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseResult.java
(added)
+++ maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseResult.java
Thu Aug 31 14:42:46 2006
@@ -0,0 +1,31 @@
+package org.apache.maven.continuum.release;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+
+/**
+ * @author Edwin Punzalan
+ */
+public class ContinuumReleaseResult
+{
+    private String id;
+
+    private List finishedPhases;
+
+    
+}

Propchange: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java?rev=439056&r1=439055&r2=439056&view=diff
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
(original)
+++ maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
Thu Aug 31 14:42:46 2006
@@ -1,20 +1,187 @@
 package org.apache.maven.continuum.release;
 
-import org.apache.maven.plugins.release.model.Release;
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.apache.maven.plugins.release.ReleaseManager;
+import org.apache.maven.plugins.release.ReleaseExecutionException;
+import org.apache.maven.plugins.release.ReleaseFailureException;
+import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.profiles.DefaultProfileManager;
+import org.apache.maven.profiles.ProfileManager;
+import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.DefaultArtifactRepository;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+import org.codehaus.plexus.taskqueue.TaskQueue;
+
+import java.util.Map;
+import java.util.List;
+import java.util.Iterator;
+import java.util.ArrayList;
+import java.io.File;
 
 /**
  * @author Jason van Zyl
  */
 public class DefaultContinuumReleaseManager
-    implements ContinuumReleaseManager
+    implements ContinuumReleaseManager, Contextualizable
 {
+    /**
+     * @plexus.requirement
+     */
+    private MavenProjectBuilder projectBuilder;
+
+    /**
+     * @plexus.requirement
+     */
     private ReleaseManager releaseManager;
 
-    public void release( Release release )
+    /**
+     * @plexus.requirement
+     */
+    private TaskQueue prepareReleaseQueue;
+
+    /**
+     * @plexus.requirement
+     */
+    private TaskQueue performReleaseQueue;
+
+    /**
+     * @plexus.configuration
+     */
+    private String localRepository;
+
+    private PlexusContainer container;
+
+    /**
+     * contains previous release:prepare descriptors; one per project
+     */
+    private Map preparedReleases;
+
+    public void prepare( ReleaseDescriptor descriptor, Settings settings )
+        throws ContinuumReleaseException
+    {
+        try
+        {
+            releaseManager.prepare( descriptor, settings, getReactorProjects( descriptor,
settings ) );
+        }
+        catch ( ReleaseExecutionException e )
+        {
+            throw new ContinuumReleaseException( "Release Manager Execution error occurred.",
e );
+        }
+        catch ( ReleaseFailureException e )
+        {
+            throw new ContinuumReleaseException( "Release Manager failure occurred.", e );
+        }
+    }
+
+    public void perform( ReleaseDescriptor descriptor, Settings settings, File buildDirectory,
+                         String goals, boolean useReleaseProfile )
         throws ContinuumReleaseException
     {
-        //TODO:JW The release manager should be taught to use the release descriptor for
the release perform.
-        //releaseManager.perform( );
+        try
+        {
+            releaseManager.perform( descriptor, settings, getReactorProjects( descriptor,
settings ),
+                                    new File( buildDirectory, "checkout" ), goals, useReleaseProfile
);
+        }
+        catch ( ReleaseExecutionException e )
+        {
+            throw new ContinuumReleaseException( "Release Manager Execution error occurred.",
e );
+        }
+        catch ( ReleaseFailureException e )
+        {
+            throw new ContinuumReleaseException( "Release Manager failure occurred.", e );
+        }
+    }
+
+    private List getReactorProjects( ReleaseDescriptor descriptor, Settings settings )
+        throws ContinuumReleaseException
+    {
+        List reactorProjects = new ArrayList();
+
+        MavenProject project;
+        try
+        {
+            project = projectBuilder.build( getProjectDescriptorFile( descriptor ),
+                                            getLocalRepository(), getProfileManager( settings
) );
+
+            reactorProjects.add( project );
+        }
+        catch ( ProjectBuildingException e )
+        {
+            throw new ContinuumReleaseException( "Failed to build project.", e );
+        }
+
+        for( Iterator modules = project.getModules().iterator(); modules.hasNext(); )
+        {
+            String moduleDir = modules.next().toString();
+
+            File pomFile = new File( project.getBasedir(), moduleDir );
+
+            try
+            {
+                projectBuilder.build( pomFile, getLocalRepository(), getProfileManager( settings
) );
+
+                reactorProjects.add( projectBuilder );
+            }
+            catch ( ProjectBuildingException e )
+            {
+                throw new ContinuumReleaseException( "Failed to build project.", e );
+            }
+        }
+
+        return reactorProjects;
+    }
+
+    private File getProjectDescriptorFile( ReleaseDescriptor descriptor )
+    {
+        String parentPath = descriptor.getWorkingDirectory();
+
+        String pomFilename = descriptor.getPomFileName();
+        if ( pomFilename == null )
+        {
+            pomFilename = "pom.xml";
+        }
+
+        return new File( parentPath, pomFilename );
+    }
+
+    private ArtifactRepository getLocalRepository()
+    {
+        return new DefaultArtifactRepository( "local-repository", "file://" + localRepository,
+                                              new DefaultRepositoryLayout() );
+    }
+
+    private ProfileManager getProfileManager( Settings settings )
+    {
+        return new DefaultProfileManager( container, settings );
+    }
+
+    public void contextualize( Context context )
+        throws ContextException
+    {
+        container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
     }
 }

Added: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java?rev=439056&view=auto
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
(added)
+++ maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
Thu Aug 31 14:42:46 2006
@@ -0,0 +1,34 @@
+package org.apache.maven.continuum.release.executors;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
+import org.codehaus.plexus.taskqueue.Task;
+
+/**
+ * @author Edwin Punzalan
+ */
+public class PerformReleaseTaskExecutor
+    implements TaskExecutor
+{
+    public void executeTask( Task task )
+        throws TaskExecutionException
+    {
+
+    }
+}

Propchange: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java?rev=439056&view=auto
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
(added)
+++ maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
Thu Aug 31 14:42:46 2006
@@ -0,0 +1,34 @@
+package org.apache.maven.continuum.release.executors;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
+import org.codehaus.plexus.taskqueue.Task;
+
+/**
+ * @author Edwin Punzalan
+ */
+public class PrepareReleaseTaskExecutor
+    implements TaskExecutor
+{
+    public void executeTask( Task task )
+        throws TaskExecutionException
+    {
+
+    }
+}

Propchange: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java?rev=439056&view=auto
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
(added)
+++ maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
Thu Aug 31 14:42:46 2006
@@ -0,0 +1,87 @@
+package org.apache.maven.continuum.release.tasks;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.settings.Settings;
+import org.codehaus.plexus.taskqueue.Task;
+
+import java.util.List;
+
+/**
+ * @author Edwin Punzalan
+ */
+public abstract class AbstractReleaseProjectTask
+    implements Task
+{
+    private int projectId;
+
+    private ReleaseDescriptor descriptor;
+
+    private Settings settings;
+
+    private List reactorProjects;
+
+    public AbstractReleaseProjectTask( int projectId, ReleaseDescriptor descriptor,
+                                       Settings settings, List reactorProjects )
+    {
+        this.projectId = projectId;
+        this.descriptor = descriptor;
+        this.settings = settings;
+        this.reactorProjects = reactorProjects;
+    }
+
+    public ReleaseDescriptor getDescriptor()
+    {
+        return descriptor;
+    }
+
+    public void setDescriptor( ReleaseDescriptor descriptor )
+    {
+        this.descriptor = descriptor;
+    }
+
+    public int getProjectId()
+    {
+        return projectId;
+    }
+
+    public void setProjectId( int projectId )
+    {
+        this.projectId = projectId;
+    }
+
+    public Settings getSettings()
+    {
+        return settings;
+    }
+
+    public void setSettings( Settings settings )
+    {
+        this.settings = settings;
+    }
+
+    public List getReactorProjects()
+    {
+        return reactorProjects;
+    }
+
+    public void setReactorProjects( List reactorProjects )
+    {
+        this.reactorProjects = reactorProjects;
+    }
+}

Propchange: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java?rev=439056&view=auto
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
(added)
+++ maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
Thu Aug 31 14:42:46 2006
@@ -0,0 +1,62 @@
+package org.apache.maven.continuum.release.tasks;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.settings.Settings;
+
+import java.util.List;
+
+/**
+ * @author Edwin Punzalan
+ */
+public class PerformReleaseProjectTask
+    extends AbstractReleaseProjectTask
+{
+    private String goals;
+
+    private boolean useReleaseProfile = true;
+
+    public PerformReleaseProjectTask( int projectId, ReleaseDescriptor descriptor,
+                                      Settings settings, List reactorProjects,
+                                      String goals, boolean useReleaseProfile )
+    {
+        super( projectId, descriptor, settings, reactorProjects );
+        this.goals = goals;
+        this.useReleaseProfile = useReleaseProfile;
+    }
+
+    public String getGoals()
+    {
+        return goals;
+    }
+
+    public void setGoals( String goals )
+    {
+        this.goals = goals;
+    }
+
+    public boolean isUseReleaseProfile()
+    {
+        return useReleaseProfile;
+    }
+
+    public void setUseReleaseProfile( boolean useReleaseProfile )
+    {
+        this.useReleaseProfile = useReleaseProfile;
+    }
+}

Propchange: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java?rev=439056&view=auto
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
(added)
+++ maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
Thu Aug 31 14:42:46 2006
@@ -0,0 +1,35 @@
+package org.apache.maven.continuum.release.tasks;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.settings.Settings;
+
+import java.util.List;
+
+/**
+ * @author Edwin Punzalan
+ */
+public class PrepareReleaseProjectTask
+    extends AbstractReleaseProjectTask
+{
+    public PrepareReleaseProjectTask( int projectId, ReleaseDescriptor descriptor,
+                                      Settings settings, List reactorProjects )
+    {
+        super( projectId, descriptor, settings, reactorProjects );
+    }
+}

Propchange: maven/continuum/branches/release-integration/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/continuum-release/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/main/resources/META-INF/plexus/components.xml?rev=439056&r1=439055&r2=439056&view=diff
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/branches/release-integration/continuum-release/src/main/resources/META-INF/plexus/components.xml
Thu Aug 31 14:42:46 2006
@@ -6,9 +6,121 @@
       <implementation>org.apache.maven.continuum.release.DefaultContinuumReleaseManager</implementation>
       <requirements>
         <requirement>
+          <role>org.apache.maven.project.MavenProjectBuilder</role>         

+        </requirement>
+        <requirement>
           <role>org.apache.maven.plugins.release.ReleaseManager</role>      
   
         </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.execution.maven.m2.MavenBuilderHelper</role>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+          <role-hint>perpare-release</role-hint>
+          <field-name>prepareReleaseQueue</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+          <role-hint>perform-release</role-hint>
+          <field-name>performReleaseQueue</field-name>
+        </requirement>
       </requirements>
+      <configuration>
+        <local-repository>${plexus.home}/local-repository</local-repository>
+      </configuration>
     </component>
   </components>
-</component-set>
\ No newline at end of file
+
+  <!--
+   |
+   | Prepare Release Project Task Queue
+   |
+   |-->
+
+  <component>
+    <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+    <role-hint>prepare-release</role-hint>
+    <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
+    <lifecycle-handler>plexus-configurable</lifecycle-handler>
+    <configuration>
+      <task-entry-evaluators>
+      </task-entry-evaluators>
+      <task-exit-evaluators>
+      </task-exit-evaluators>
+      <task-viability-evaluators>
+      </task-viability-evaluators>
+    </configuration>
+  </component>
+
+  <component>
+    <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
+    <role-hint>prepare-release</role-hint>
+    <implementation>org.apache.maven.continuum.release.executors.PrepareReleaseTaskExecutor</implementation>
+  </component>
+
+  <component>
+    <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
+    <role-hint>prepare-release</role-hint>
+    <implementation>org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor</implementation>
+    <requirements>
+      <requirement>
+        <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
+        <role-hint>prepare-release</role-hint>
+      </requirement>
+      <requirement>
+        <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+        <role-hint>prepare-release</role-hint>
+      </requirement>
+    </requirements>
+    <configuration>
+      <name>prepare-release</name>
+    </configuration>
+  </component>
+
+  <!--
+   |
+   | Perform Release Project Task Queue
+   |
+   |-->
+
+  <component>
+    <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+    <role-hint>perform-release</role-hint>
+    <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
+    <lifecycle-handler>plexus-configurable</lifecycle-handler>
+    <configuration>
+      <task-entry-evaluators>
+      </task-entry-evaluators>
+      <task-exit-evaluators>
+      </task-exit-evaluators>
+      <task-viability-evaluators>
+      </task-viability-evaluators>
+    </configuration>
+  </component>
+
+  <component>
+    <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
+    <role-hint>perform-release</role-hint>
+    <implementation>org.apache.maven.continuum.release.executors.PerformReleaseTaskExecutor</implementation>
+  </component>
+
+  <component>
+    <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
+    <role-hint>perform-release</role-hint>
+    <implementation>org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor</implementation>
+    <requirements>
+      <requirement>
+        <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
+        <role-hint>perform-release</role-hint>
+      </requirement>
+      <requirement>
+        <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+        <role-hint>perform-release</role-hint>
+      </requirement>
+    </requirements>
+    <configuration>
+      <name>perform-release</name>
+    </configuration>
+  </component>
+
+</component-set>

Modified: maven/continuum/branches/release-integration/continuum-release/src/test/java/org/apache/maven/continuum/ContinuumReleaseManagerTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum-release/src/test/java/org/apache/maven/continuum/ContinuumReleaseManagerTest.java?rev=439056&r1=439055&r2=439056&view=diff
==============================================================================
--- maven/continuum/branches/release-integration/continuum-release/src/test/java/org/apache/maven/continuum/ContinuumReleaseManagerTest.java
(original)
+++ maven/continuum/branches/release-integration/continuum-release/src/test/java/org/apache/maven/continuum/ContinuumReleaseManagerTest.java
Thu Aug 31 14:42:46 2006
@@ -1,5 +1,21 @@
 package org.apache.maven.continuum;
 
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.codehaus.plexus.PlexusTestCase;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.apache.maven.plugins.release.model.Release;
@@ -17,6 +33,6 @@
 
         Release r = new Release();
 
-        crm.release( r );
+        crm.perform( r );
     }
 }

Modified: maven/continuum/branches/release-integration/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/pom.xml?rev=439056&r1=439055&r2=439056&view=diff
==============================================================================
--- maven/continuum/branches/release-integration/pom.xml (original)
+++ maven/continuum/branches/release-integration/pom.xml Thu Aug 31 14:42:46 2006
@@ -86,6 +86,7 @@
     <!-- module>continuum-web</module --> <!--Remove this when webapp will
be ready and packaged as a plexus-application -->
     <module>continuum-webapp</module>
     <module>continuum-xmlrpc</module>
+    <module>continuum-release</module>
   </modules>
   <repositories>
     <repository>



Mime
View raw message