continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r771595 - /continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
Date Tue, 05 May 2009 07:04:12 GMT
Author: oching
Date: Tue May  5 07:04:12 2009
New Revision: 771595

URL: http://svn.apache.org/viewvc?rev=771595&view=rev
Log:
[CONTINUUM-2193]
o fix working directory service

Modified:
    continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java

Modified: continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java?rev=771595&r1=771594&r2=771595&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
Tue May  5 07:04:12 2009
@@ -22,6 +22,8 @@
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.Project;
 import org.codehaus.plexus.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import java.io.File;
@@ -39,6 +41,8 @@
 {
     @Resource
     private ConfigurationService configurationService;
+    
+    private static final Logger log = LoggerFactory.getLogger( DefaultWorkingDirectoryService.class
);
 
     public void setConfigurationService( ConfigurationService configurationService )
     {
@@ -76,11 +80,7 @@
         
         if ( project.getWorkingDirectory() == null || "".equals( project.getWorkingDirectory()
) )
         {   
-            if( !project.isCheckedOutInSingleDirectory() )
-            {
-                project.setWorkingDirectory( Integer.toString( project.getId() ) );
-            }
-            else
+            if ( project.isCheckedOutInSingleDirectory() && projectScmRoot != null
&& !"".equals( projectScmRoot ) )
             {
                 Project rootProject = project;
                 if( projects != null )
@@ -96,7 +96,7 @@
                 }                
                 
              // determine the path
-                String projectScmUrl = project.getScmUrl();                    
+                String projectScmUrl = project.getScmUrl();
                 int indexDiff = StringUtils.differenceAt( projectScmUrl, projectScmRoot );
                 
                 String pathToProject = projectScmUrl.substring( indexDiff );      
@@ -107,7 +107,11 @@
                 else
                 {
                     project.setWorkingDirectory( Integer.toString( rootProject.getId() )
+ "/" + pathToProject );
-                }
+                }                
+            }
+            else
+            {
+                project.setWorkingDirectory( Integer.toString( project.getId() ) );
             }
         }
 



Mime
View raw message