ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1375573 - in /ant/ivy/core/trunk: src/java/org/apache/ivy/core/report/ src/java/org/apache/ivy/core/retrieve/ test/java/org/apache/ivy/core/resolve/ test/java/org/apache/ivy/core/retrieve/
Date Tue, 21 Aug 2012 14:28:32 GMT
Author: hibou
Date: Tue Aug 21 14:28:32 2012
New Revision: 1375573

URL: http://svn.apache.org/viewvc?rev=1375573&view=rev
Log:
When retrieving, the uncompressed artifact should take the place of the real artifact

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ArtifactDownloadReport.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/retrieve/RetrieveTest.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ArtifactDownloadReport.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ArtifactDownloadReport.java?rev=1375573&r1=1375572&r2=1375573&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ArtifactDownloadReport.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ArtifactDownloadReport.java Tue
Aug 21 14:28:32 2012
@@ -160,7 +160,7 @@ public class ArtifactDownloadReport {
 
     public Artifact buildUncompressedArtifact() {
         return new DefaultArtifact(artifact.getModuleRevisionId(), artifact.getPublicationDate(),
-                artifact.getName(), "_uncompressed", "");
+                artifact.getName(), artifact.getType() + "_uncompressed", "");
     }
 
     public void setUncompressedLocalDir(File uncompressedLocalDir) {

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=1375573&r1=1375572&r2=1375573&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 Tue Aug 21
14:28:32 2012
@@ -338,8 +338,9 @@ public class RetrieveEngine {
                 ArtifactDownloadReport adr = (ArtifactDownloadReport) iter.next();
 
                 Artifact artifact = adr.getArtifact();
+                String ext = artifact.getExt();
                 if (options.isUncompressed() && adr.getUncompressedLocalDir() !=
null) {
-                    artifact = adr.buildUncompressedArtifact();
+                    ext = "";
                 }
 
                 String destPattern = "ivy".equals(adr.getType()) ? destIvyPattern
@@ -350,8 +351,12 @@ public class RetrieveEngine {
                     continue; // skip this artifact, the filter didn't accept it!
                 }
 
+                ModuleRevisionId aMrid = artifact.getModuleRevisionId();
                 String destFileName = IvyPatternHelper.substitute(destPattern,
-                    artifact.getModuleRevisionId(), artifact, conf, adr.getArtifactOrigin());
+                    aMrid.getOrganisation(), aMrid.getName(), aMrid.getBranch(),
+                    aMrid.getRevision(), artifact.getName(), artifact.getType(), ext, conf,
+                    adr.getArtifactOrigin(), aMrid.getQualifiedExtraAttributes(),
+                    artifact.getQualifiedExtraAttributes());
                 Set dest = (Set) artifactsToCopy.get(adr);
                 if (dest == null) {
                     dest = new HashSet();

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=1375573&r1=1375572&r2=1375573&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java Tue Aug 21 14:28:32
2012
@@ -5448,7 +5448,7 @@ public class ResolveTest extends TestCas
         File cacheDir = ivy.getSettings().getDefaultRepositoryCacheBasedir();
         assertEquals(new File(cacheDir, "compression/module2/jars/module2-1.0.jar"),
             adr.getLocalFile());
-        assertEquals(new File(cacheDir, "compression/module2/_uncompresseds/module2-1.0"),
+        assertEquals(new File(cacheDir, "compression/module2/jar_uncompresseds/module2-1.0"),
             adr.getUncompressedLocalDir());
 
         File[] jarContents = adr.getUncompressedLocalDir().listFiles();

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/retrieve/RetrieveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/retrieve/RetrieveTest.java?rev=1375573&r1=1375572&r2=1375573&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/retrieve/RetrieveTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/retrieve/RetrieveTest.java Tue Aug 21
14:28:32 2012
@@ -319,14 +319,13 @@ public class RetrieveTest extends TestCa
         ModuleDescriptor md = report.getModuleDescriptor();
         assertNotNull(md);
 
-        String pattern = "build/test/retrieve/[organization]/[module]/[conf]/[artifact]-[revision](.[ext])";
+        String pattern = "build/test/retrieve/[organization]/[module]/[conf]/[type]s/[artifact]-[revision](.[ext])";
 
         RetrieveOptions options = getRetrieveOptions();
         options.setUncompressed(true);
         ivy.retrieve(md.getModuleRevisionId(), pattern, options);
 
-        // NB
-        File dest = new File("build/test/retrieve/compression/module2/default/module2-1.0");
+        File dest = new File("build/test/retrieve/compression/module2/default/jars/module2-1.0");
         assertTrue(dest.exists());
         assertTrue(dest.isDirectory());
         File[] jarContents = dest.listFiles();



Mime
View raw message