You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ma...@apache.org on 2012/04/13 23:29:46 UTC

svn commit: r1325961 - in /ant/ivy/core/trunk: CHANGES.txt doc/concept.html src/java/org/apache/ivy/core/IvyPatternHelper.java

Author: maartenc
Date: Fri Apr 13 21:29:46 2012
New Revision: 1325961

URL: http://svn.apache.org/viewvc?rev=1325961&view=rev
Log:
NEW: [orgPath] can now be used as token in ivy/artifact patterns

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/doc/concept.html
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1325961&r1=1325960&r2=1325961&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Fri Apr 13 21:29:46 2012
@@ -131,6 +131,7 @@ for detailed view of each issue, please 
 - DOCUMENTATION: wrong default resolver documented on the 'How does it work' page (IVY-1265)
 - DOCUMENTATION: Correct outdated links to configuration pages (IVY-1266)
 
+- NEW: [orgPath] can now be used as token in ivy/artifact patterns
 - NEW: New Ant datatype ivy:resources, an Ant resource collection like ivy:cachepath or ivy:cachefileset (IVY-334)
 - NEW: ivy:resolve and post resole task can now have inlined dependencies declaration.
 - NEW: Import Bushel into Ivy core (IVY-1241)

Modified: ant/ivy/core/trunk/doc/concept.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/concept.html?rev=1325961&r1=1325960&r2=1325961&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/concept.html (original)
+++ ant/ivy/core/trunk/doc/concept.html Fri Apr 13 21:29:46 2012
@@ -94,6 +94,7 @@ The tokens available depends on where th
 But here are all the tokens currently available:
 <ul>
 <li>[organisation]</li> the organisation name
+<li>[orgPath] <span class="since">(since 2.3)</span></li> the organisation name where '.' has been replaced by '/'. This can be used to configure maven2-like repositories. 
 <li>[module]</li> the module name
 <li>[branch]</li> the branch name
 <li>[revision]</li> the revision name

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=1325961&r1=1325960&r2=1325961&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 Fri Apr 13 21:29:46 2012
@@ -61,6 +61,8 @@ public final class IvyPatternHelper {
 
     public static final String ORGANISATION_KEY2 = "organization";
 
+    public static final String ORGANISATION_PATH_KEY = "orgPath";
+
     public static final String ORIGINAL_ARTIFACTNAME_KEY = "originalname";
 
     private static final Pattern PARAM_PATTERN = Pattern.compile("\\@\\{(.*?)\\}");
@@ -148,6 +150,7 @@ public final class IvyPatternHelper {
         }
         tokens.put(ORGANISATION_KEY, org == null ? "" : org);
         tokens.put(ORGANISATION_KEY2, org == null ? "" : org);
+        tokens.put(ORGANISATION_PATH_KEY, org == null ? "" : org.replace('.', '/'));
         tokens.put(MODULE_KEY, module == null ? "" : module);
         tokens.put(BRANCH_KEY, branch == null ? "" : branch);
         tokens.put(REVISION_KEY, revision == null ? "" : revision);
@@ -222,6 +225,10 @@ public final class IvyPatternHelper {
         if (tokensCopy.containsKey(ORGANISATION_KEY) && !tokensCopy.containsKey(ORGANISATION_KEY2)) {
             tokensCopy.put(ORGANISATION_KEY2, tokensCopy.get(ORGANISATION_KEY));
         }
+        if (tokensCopy.containsKey(ORGANISATION_KEY) && !tokensCopy.containsKey(ORGANISATION_PATH_KEY)) {
+            String org = (String) tokensCopy.get(ORGANISATION_KEY);
+            tokensCopy.put(ORGANISATION_PATH_KEY, org == null ? "" : org.replace('.', '/'));
+        }
         
         StringBuffer buffer = new StringBuffer();