You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by br...@apache.org on 2013/05/24 08:09:20 UTC
svn commit: r1485959 -
/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java
Author: brett
Date: Fri May 24 08:09:19 2013
New Revision: 1485959
URL: http://svn.apache.org/r1485959
Log:
use relative paths for resources
Modified:
incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java?rev=1485959&r1=1485958&r2=1485959&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java Fri May 24 08:09:19 2013
@@ -46,6 +46,7 @@ import org.codehaus.plexus.logging.Logge
import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.PathTool;
import java.io.File;
import java.util.ArrayList;
@@ -695,14 +696,20 @@ public final class CompilerContextImpl
{
File f = new File( basedir, file );
embeddedResources.add( f );
+
+ String executionRoot = System.getProperty( "user.dir" );
+ // TODO: ideally, all execution would happen from the project basedir, not the user.dir
+ //String executionRoot = project.getBasedir().getAbsolutePath();
+ String path = PathTool.getRelativeFilePath( executionRoot, f.getPath() );
+
if ( f.getName().endsWith( ".resources" ) )
{
- embeddedResourceArgs.add( f.getAbsolutePath() );
+ embeddedResourceArgs.add( path );
}
else
{
String resourceName = project.getArtifactId() + "." + file.replace( File.separatorChar, '.' );
- embeddedResourceArgs.add( f.getAbsolutePath() + "," + resourceName );
+ embeddedResourceArgs.add( path + "," + resourceName );
}
}
}