Skip to content

Commit

Permalink
[CONTINUUM-2193]
Browse files Browse the repository at this point in the history
o fix working directory service


git-svn-id: https://svn.apache.org/repos/asf/continuum/branches/continuum-flat-multi-module@771595 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
oching committed May 5, 2009
1 parent 356a198 commit 8cea1ec
Showing 1 changed file with 11 additions and 7 deletions.
Expand Up @@ -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;
Expand All @@ -39,6 +41,8 @@ public class DefaultWorkingDirectoryService
{
@Resource
private ConfigurationService configurationService;

private static final Logger log = LoggerFactory.getLogger( DefaultWorkingDirectoryService.class );

public void setConfigurationService( ConfigurationService configurationService )
{
Expand Down Expand Up @@ -76,11 +80,7 @@ public File getWorkingDirectory( Project project, String projectScmRoot, List<Pr

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 )
Expand All @@ -96,7 +96,7 @@ public File getWorkingDirectory( Project project, String projectScmRoot, List<Pr
}

// determine the path
String projectScmUrl = project.getScmUrl();
String projectScmUrl = project.getScmUrl();
int indexDiff = StringUtils.differenceAt( projectScmUrl, projectScmRoot );

String pathToProject = projectScmUrl.substring( indexDiff );
Expand All @@ -107,7 +107,11 @@ public File getWorkingDirectory( Project project, String projectScmRoot, List<Pr
else
{
project.setWorkingDirectory( Integer.toString( rootProject.getId() ) + "/" + pathToProject );
}
}
}
else
{
project.setWorkingDirectory( Integer.toString( project.getId() ) );
}
}

Expand Down

0 comments on commit 8cea1ec

Please sign in to comment.