continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r554668 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/configuration/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/configuration/ conti...
Date Mon, 09 Jul 2007 14:57:14 GMT
Author: evenisse
Date: Mon Jul  9 07:57:13 2007
New Revision: 554668

URL: http://svn.apache.org/viewvc?view=rev&rev=554668
Log:
[CONTINUUM-1339] Delete build output directories when deleting a project group/project

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-wagon/src/test/java/org/apache/maven/continuum/wagon/MockConfigurationService.java

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java?view=diff&rev=554668&r1=554667&r2=554668
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
Mon Jul  9 07:57:13 2007
@@ -58,6 +58,8 @@
     String getBuildOutput( int buildId, int projectId )
         throws ConfigurationException;
 
+    File getBuildOutputDirectory( int projectId );
+
     File getBuildOutputFile( int buildId, int projectId )
         throws ConfigurationException;
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=554668&r1=554667&r2=554668
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Mon Jul  9 07:57:13 2007
@@ -266,7 +266,7 @@
             }
         }
 
-        getLogger().info( "Remove project group" + projectGroup.getName() + "(" + projectGroup.getId()
+ ")" );
+        getLogger().info( "Remove project group " + projectGroup.getName() + "(" + projectGroup.getId()
+ ")" );
 
         Map context = new HashMap();
         context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, new Integer( projectGroup.getId()
) );
@@ -555,6 +555,10 @@
             File workingDirectory = getWorkingDirectory( projectId );
 
             FileUtils.deleteDirectory( workingDirectory );
+
+            File buildOutputDirectory = configurationService.getBuildOutputDirectory( projectId
);
+
+            FileUtils.deleteDirectory( buildOutputDirectory );
 
             store.removeProject( store.getProject( projectId ) );
         }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?view=diff&rev=554668&r1=554667&r2=554668
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
Mon Jul  9 07:57:13 2007
@@ -167,8 +167,7 @@
     //
     // ----------------------------------------------------------------------
 
-    public File getBuildOutputFile( int buildId, int projectId )
-        throws ConfigurationException
+    public File getBuildOutputDirectory( int projectId )
     {
         File dir = new File( getBuildOutputDirectory(), Integer.toString( projectId ) );
 
@@ -179,6 +178,14 @@
         catch ( IOException e )
         {
         }
+
+        return dir;
+    }
+
+    public File getBuildOutputFile( int buildId, int projectId )
+        throws ConfigurationException
+    {
+        File dir = getBuildOutputDirectory( projectId );
 
         if ( !dir.exists() && !dir.mkdirs() )
         {

Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-wagon/src/test/java/org/apache/maven/continuum/wagon/MockConfigurationService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-notifiers/continuum-notifier-wagon/src/test/java/org/apache/maven/continuum/wagon/MockConfigurationService.java?view=diff&rev=554668&r1=554667&r2=554668
==============================================================================
--- maven/continuum/trunk/continuum-notifiers/continuum-notifier-wagon/src/test/java/org/apache/maven/continuum/wagon/MockConfigurationService.java
(original)
+++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-wagon/src/test/java/org/apache/maven/continuum/wagon/MockConfigurationService.java
Mon Jul  9 07:57:13 2007
@@ -19,47 +19,53 @@
  * under the License.
  */
 
-import java.io.File;
-import java.util.Map;
-
 import org.apache.maven.continuum.configuration.ConfigurationException;
 import org.apache.maven.continuum.configuration.ConfigurationLoadingException;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.configuration.ConfigurationStoringException;
 
+import java.io.File;
+import java.util.Map;
+
 /**
  * Mock class for testing WagonContinuumNotifier's call to ConfigurationService.getBuildOutputFile()
- * 
- * @author <a href="mailto:nramirez@exist">Napoleon Esmundo C. Ramirez</a>
  *
+ * @author <a href="mailto:nramirez@exist">Napoleon Esmundo C. Ramirez</a>
  */
-public class MockConfigurationService implements ConfigurationService
+public class MockConfigurationService
+    implements ConfigurationService
 {
     private String basedir;
-    
+
     public MockConfigurationService()
     {
         basedir = System.getProperty( "basedir" );
     }
-    
+
     public File getBuildOutputDirectory()
     {
         return new File( basedir, "src/test/resources" + "/" + "build-output-directory" );
     }
-    
+
+    public File getBuildOutputDirectory( int projectId )
+    {
+        return new File( getBuildOutputDirectory(), Integer.toString( projectId ) );
+    }
+
     public File getBuildOutputFile( int buildId, int projectId )
         throws ConfigurationException
     {
-        File dir = new File( getBuildOutputDirectory(), Integer.toString( projectId ) );
-        
+        File dir = getBuildOutputDirectory( projectId );
+
         if ( !dir.exists() && !dir.mkdirs() )
         {
-            throw new ConfigurationException( "Could not make the build output directory:
" + "'" + dir.getAbsolutePath() + "'." );
+            throw new ConfigurationException(
+                "Could not make the build output directory: " + "'" + dir.getAbsolutePath()
+ "'." );
         }
-        
+
         return new File( dir, buildId + ".log.txt" );
     }
-    
+
     public File getWorkingDirectory()
     {
         return new File( basedir, "src/test/resources" + "/" + "working-directory" );



Mime
View raw message