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/15 22:53:23 UTC
svn commit: r1326422 - in /ant/ivy/core/trunk: CHANGES.txt
doc/use/retrieve.html src/java/org/apache/ivy/ant/IvyRetrieve.java
src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java
Author: maartenc
Date: Sun Apr 15 20:53:22 2012
New Revision: 1326422
URL: http://svn.apache.org/viewvc?rev=1326422&view=rev
Log:
Reverting r1062831 because the same problem can be resolved using the new [orgPath] token.
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/doc/use/retrieve.html
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRetrieve.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java
Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1326422&r1=1326421&r2=1326422&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Sun Apr 15 20:53:22 2012
@@ -145,7 +145,6 @@ for detailed view of each issue, please
- IMPROVEMENT: ivy:makepom child element dependency should support the type and classifier attributes (IVY-1262)
- IMPROVEMENT: ivy:retrieve can now create a path or fileset containing the retrieved artifacts (IVY-1235)
- IMPROVEMENT: Improve diagnostics in ssh resolver (IVY-1267) (thanks to Stepan Koltsov)
-- IMPROVEMENT: ivy:retrieve can now convert 'dotted'-organisation names into a directory tree.
- IMPROVEMENT: ivy:retrieve now accepts a nested mapper type.
- FIX: Exclude doesn't work when there is some circular dependencies (IVY-1309)
Modified: ant/ivy/core/trunk/doc/use/retrieve.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/use/retrieve.html?rev=1326422&r1=1326421&r2=1326422&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/use/retrieve.html (original)
+++ ant/ivy/core/trunk/doc/use/retrieve.html Sun Apr 15 20:53:22 2012
@@ -62,11 +62,6 @@ Possible values are:
<li><b>always</b></li> always overwrite the destination file
<li><b>never</b></li> never overwrite the destination file
</ul></td><td>No. Defaults to 'newer'.</td></tr>
- <tr><td>dirMode</td><td>option to configure how the [organisation] token in the patterns will be replaced <span class="since">(since 2.3)</span>.
-Possible values are:
-<ul><li><b>flat</b> (default)</li> don't convert the organisation name, the token will get exactly the same value as the organisation
-<li><b>tree</b></li> replace the '.' within the organisation name with '/'
-</ul>See the examples below.</td><td>No. Defaults to 'flat'.</td></tr>
<tr><td>symlink</td><td>true to create symbolic links, false to copy the artifacts. The destination of the symbolic links depends on the value of the useOrigin attribute <span class="since">(since 2.0)</span></td><td>No. Defaults to false</td></tr>
<tr><td>settingsRef</td><td>A reference to the ivy settings that must be used by this task <span class="since">(since 2.0)</span></td><td>No, 'ivy.instance' is taken by default.</td></tr></tbody>
<tr><td>log</td><td>the log setting to use during the resolve and retrieve process. <span class="since">(since 2.0)</span><br/>
@@ -142,7 +137,7 @@ lib
<hr/>
<code type="xml">
-<ivy:retrieve pattern="${lib.dir}/[organisation]/[artifact]-[revision].[ext]" dirMode="flat"/>
+<ivy:retrieve pattern="${lib.dir}/[organisation]/[artifact]-[revision].[ext]" />
</code>
Retrieves all dependencies of the last resolve call to a lib directory. The [organisation] token will get the unmodified organisation value. The resulting lib dir could look like this:
<code>
@@ -155,9 +150,9 @@ lib
</code>
<code type="xml">
-<ivy:retrieve pattern="${lib.dir}/[organisation]/[artifact]-[revision].[ext]" dirMode="tree"/>
+<ivy:retrieve pattern="${lib.dir}/[orgPath]/[artifact]-[revision].[ext]" />
</code>
-Retrieves all dependencies of the last resolve call to a lib directory. The [organisation] token will get a tree structure. The resulting lib dir could look like this:
+Retrieves all dependencies of the last resolve call to a lib directory. The [orgPath] token will get a tree structure. The resulting lib dir could look like this:
<code>
lib
org
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRetrieve.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRetrieve.java?rev=1326422&r1=1326421&r2=1326422&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRetrieve.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRetrieve.java Sun Apr 15 20:53:22 2012
@@ -43,10 +43,6 @@ public class IvyRetrieve extends IvyPost
RetrieveOptions.OVERWRITEMODE_NEWER, RetrieveOptions.OVERWRITEMODE_DIFFERENT
});
- private static final Collection DIRMODE_VALUES = Arrays.asList(new String[] {
- RetrieveOptions.DIRMODE_FLAT, RetrieveOptions.DIRMODE_TREE
- });
-
private String pattern;
private String ivypattern = null;
@@ -57,8 +53,6 @@ public class IvyRetrieve extends IvyPost
private String overwriteMode = RetrieveOptions.OVERWRITEMODE_NEWER;
- private String dirMode = RetrieveOptions.DIRMODE_FLAT;
-
private String pathId = null;
private String setId = null;
@@ -110,7 +104,6 @@ public class IvyRetrieve extends IvyPost
.setArtifactFilter(artifactFilter)
.setSync(sync)
.setOverwriteMode(getOverwriteMode())
- .setDirMode(getDirMode())
.setUseOrigin(isUseOrigin())
.setMakeSymlinks(symlink)
.setResolveId(getResolveId())
@@ -187,18 +180,6 @@ public class IvyRetrieve extends IvyPost
return overwriteMode;
}
- public void setDirMode(String dirMode) {
- if (!DIRMODE_VALUES.contains(dirMode)) {
- throw new IllegalArgumentException("invalid dirMode value '" + dirMode + "'. "
- + "Valid values are " + DIRMODE_VALUES);
- }
- this.dirMode = dirMode;
- }
-
- public String getDirMode() {
- return dirMode;
- }
-
/**
* Add a mapper to convert the file names.
*
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java?rev=1326422&r1=1326421&r2=1326422&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java Sun Apr 15 20:53:22 2012
@@ -313,21 +313,9 @@ public class RetrieveEngine {
continue; // skip this artifact, the filter didn't accept it!
}
- String destFileName;
- if (RetrieveOptions.DIRMODE_FLAT.equals(options.getDirMode())) {
- destFileName = IvyPatternHelper.substitute(destPattern,
+ String destFileName = IvyPatternHelper.substitute(destPattern,
artifact.getArtifact().getModuleRevisionId(), artifact.getArtifact(),
conf, artifact.getArtifactOrigin());
- } else if (RetrieveOptions.DIRMODE_TREE.equals(options.getDirMode())) {
- ModuleRevisionId mRevId = artifact.getArtifact().getModuleRevisionId();
- String org = mRevId.getOrganisation() == null ? null : mRevId.getOrganisation().replace('.', '/');
- destFileName = IvyPatternHelper.substitute(destPattern, org, mRevId.getName(), mRevId.getBranch(),
- mRevId.getRevision(), artifact.getName(), artifact.getType(), artifact.getExt(), conf,
- artifact.getArtifactOrigin(), mrid.getQualifiedExtraAttributes(), artifact.getArtifact().getQualifiedExtraAttributes());
- } else {
- throw new IllegalArgumentException("Unsupported dirMode: " + options.getDirMode());
- }
-
Set dest = (Set) artifactsToCopy.get(artifact);
if (dest == null) {
dest = new HashSet();
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java?rev=1326422&r1=1326421&r2=1326422&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java Sun Apr 15 20:53:22 2012
@@ -32,9 +32,6 @@ public class RetrieveOptions extends Log
public static final String OVERWRITEMODE_NEWER = "newer";
public static final String OVERWRITEMODE_DIFFERENT = "different";
- public static final String DIRMODE_FLAT = "flat";
- public static final String DIRMODE_TREE = "tree";
-
/**
* The names of configurations to retrieve. If the array consists only of '*', then all
* configurations of the module will be retrieved.
@@ -77,8 +74,6 @@ public class RetrieveOptions extends Log
*/
private boolean makeSymlinks = false;
- private String dirMode = DIRMODE_FLAT;
-
/**
* The id used to store the resolve information.
*/
@@ -99,7 +94,6 @@ public class RetrieveOptions extends Log
this.overwriteMode = options.overwriteMode;
this.useOrigin = options.useOrigin;
this.makeSymlinks = options.makeSymlinks;
- this.dirMode = options.dirMode;
this.resolveId = options.resolveId;
this.mapper = options.mapper;
}
@@ -113,15 +107,6 @@ public class RetrieveOptions extends Log
return this;
}
- public String getDirMode() {
- return dirMode == null ? DIRMODE_FLAT : dirMode;
- }
-
- public RetrieveOptions setDirMode(String dirMode) {
- this.dirMode = dirMode;
- return this;
- }
-
public Filter getArtifactFilter() {
return artifactFilter;
}