normalize file separator characters.

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@675445 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2008-07-10 05:34:43 +00:00
parent 9284388b70
commit d61c2202d7
1 changed files with 7 additions and 3 deletions

View File

@ -32,7 +32,7 @@ public class PropertyInterpolationMojo
extends AbstractMojo
{
private static final String FS = File.separator;
private static final char FS = File.separatorChar;
/** @parameter */
private String myDirectory;
@ -43,8 +43,12 @@ public class PropertyInterpolationMojo
public void execute()
throws MojoExecutionException
{
String value = project.getProperties().getProperty( "myDirectory" );
if ( !value.equals( project.getBuild().getDirectory() + FS + "foo" ) )
String value = project.getProperties().getProperty( "myDirectory" ).replace( '/', FS ).replace( '\\', FS );
String targetValue = project.getBuild().getDirectory() + FS + "foo";
targetValue = targetValue.replace( '/', FS).replace( '\\', FS );
if ( !value.equals( targetValue ) )
{
throw new MojoExecutionException( "Property value of 'myDirectory': " + value + " should equal project build directory: " + project.getBuild().getDirectory() + " + '/foo'" );
}