ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r661448 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/core/IvyPatternHelper.java test/java/org/apache/ivy/util/IvyPatternHelperTest.java
Date Thu, 29 May 2008 19:45:24 GMT
Author: maartenc
Date: Thu May 29 12:45:24 2008
New Revision: 661448

URL: http://svn.apache.org/viewvc?rev=661448&view=rev
Log:
FIX: Filesystem repositories can not have () in the path (IVY-797)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/util/IvyPatternHelperTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=661448&r1=661447&r2=661448&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu May 29 12:45:24 2008
@@ -81,6 +81,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more semantically correct
name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for RegexpPatternMatcher
and GlobPatternMatcher
 
+- FIX: Filesystem repositories can not have () in the path (IVY-797)
 - FIX: Type tag in poms not supported (IVY-762)
 - FIX: An empty exclusion tag results in an IllegalArgumentException (IVY-821)
 - FIX: Maven scope defined in POM dependencyManagement section not honoured (IVY-811)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java?rev=661448&r1=661447&r2=661448&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java Thu May 29 12:45:24
2008
@@ -207,6 +207,7 @@
         StringBuffer tokenBuffer = null;
         boolean insideOptionalPart = false;
         boolean insideToken = false;
+        boolean tokenSeen = false;
         boolean tokenHadValue = false;
 
         for (int i = 0; i < chars.length; i++) {
@@ -220,6 +221,7 @@
 
                     optionalPart = new StringBuffer();
                     insideOptionalPart = true;
+                    tokenSeen = false;
                     tokenHadValue = false;
                     break;
 
@@ -232,6 +234,8 @@
 
                     if (tokenHadValue) {
                         buffer.append(optionalPart.toString());
+                    } else if (!tokenSeen) {
+                        buffer.append('(').append(optionalPart.toString()).append(')');
                     }
 
                     insideOptionalPart = false;
@@ -268,6 +272,7 @@
                     }
 
                     insideToken = false;
+                    tokenSeen = true;
                     break;
 
                 default:

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/util/IvyPatternHelperTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/util/IvyPatternHelperTest.java?rev=661448&r1=661447&r2=661448&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/util/IvyPatternHelperTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/util/IvyPatternHelperTest.java Thu May 29
12:45:24 2008
@@ -62,5 +62,11 @@
         assertEquals("apache/Test/build/archives/jars/test-1.0.jar", IvyPatternHelper.substitute(
             pattern, "apache", "Test", "1.0", "test", "jar", "jar"));
     }
+    
+    public void testSpecialCharsInsidePattern() {
+        String pattern = "[organization]/[module]/build/archives (x86)/[type]s/[artifact]-[revision].[ext]";
+        assertEquals("apache/Test/build/archives (x86)/jars/test-1.0.jar", IvyPatternHelper.substitute(
+            pattern, "apache", "Test", "1.0", "test", "jar", "jar"));
+    }
 
 }



Mime
View raw message