maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r675460 - in /maven/components/branches/maven-2.0.x/maven-project/src: main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java test/java/org/apache/maven/project/MavenProjectDynamismTest.java
Date Thu, 10 Jul 2008 06:25:23 GMT
Author: jdcasey
Date: Wed Jul  9 23:25:22 2008
New Revision: 675460

URL: http://svn.apache.org/viewvc?rev=675460&view=rev
Log:
improve restoration of build paths, especially on windows.

Modified:
    maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
    maven/components/branches/maven-2.0.x/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java

Modified: maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=675460&r1=675459&r2=675460&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Wed Jul  9 23:25:22 2008
@@ -2143,18 +2143,24 @@
                                                                      project.getBasedir(),
                                                                      config,
                                                                      debugMessages );
+        
+        interpolatedOriginal = pathTranslator.unalignFromBaseDirectory( interpolatedOriginal,
project.getBasedir() );
 
         String interpolatedOriginal2 = modelInterpolator.interpolate( originalInterpolatedString,
                                                                       model,
                                                                       project.getBasedir(),
                                                                       config,
                                                                       debugMessages );
+        
+        interpolatedOriginal2 = pathTranslator.alignToBaseDirectory( interpolatedOriginal2,
project.getBasedir() );
 
         String interpolatedChanged = modelInterpolator.interpolate( changedString,
                                                                     model,
                                                                     project.getBasedir(),
                                                                     config,
                                                                     debugMessages );
+        
+        interpolatedChanged = pathTranslator.alignToBaseDirectory( interpolatedChanged, project.getBasedir()
);
 
         String relativeInterpolatedChanged = modelInterpolator.interpolate( relativeChangedString,
                                                                             model,
@@ -2162,16 +2168,15 @@
                                                                             config,
                                                                             debugMessages
);
 
-        if ( interpolatedOriginal.equals( interpolatedChanged )
-             || interpolatedOriginal2.equals( interpolatedChanged ) )
+        if ( interpolatedOriginal.equals( interpolatedChanged ) || interpolatedOriginal2.equals(
interpolatedChanged ) )
         {
             return originalString;
         }
         else if ( interpolatedOriginal.equals( relativeInterpolatedChanged )
-                        || interpolatedOriginal2.equals( relativeInterpolatedChanged ) )
-       {
-           return originalString;
-       }
+            || interpolatedOriginal2.equals( relativeInterpolatedChanged ) )
+        {
+            return originalString;
+        }
 
         return relativeChangedString;
     }
@@ -2200,7 +2205,7 @@
         {
             String[] permutations = new String[2];
 
-            permutations[0] = (String) originalInterpolatedStrings.get( idx );
+            permutations[0] = pathTranslator.alignToBaseDirectory( (String) originalInterpolatedStrings.get(
idx ), project.getBasedir() );
             permutations[1] = (String) originalStrings.get( idx );
 
             orig.put( permutations[0], permutations );
@@ -2224,13 +2229,15 @@
                                                                  project.getBasedir(),
                                                                  config,
                                                                  debugMessages );
+            
+            interpolated = pathTranslator.alignToBaseDirectory( interpolated, project.getBasedir()
);
 
             String relativeInterpolated = modelInterpolator.interpolate( relativeChangedString,
                                                                          project.getModel(),
                                                                          project.getBasedir(),
                                                                          config,
                                                                          debugMessages );
-
+            
             String[] original = (String[]) orig.get( interpolated );
             if ( original == null )
             {

Modified: maven/components/branches/maven-2.0.x/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java?rev=675460&r1=675459&r2=675460&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java
(original)
+++ maven/components/branches/maven-2.0.x/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java
Wed Jul  9 23:25:22 2008
@@ -231,7 +231,7 @@
 
         build = project.getBuild();
 
-        assertEquals( "Restored source directory should be expressed in terms of the basedir.",
+        assertEquals( "Restored source directory should be expressed in terms of the basedir.\nWas:
" + build.getSourceDirectory() + "\nShould be: " + basedirExpr + "/src/main/java\n",
                       basedirExpr + "/src/main/java",
                       build.getSourceDirectory() );
 



Mime
View raw message