You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by ma...@apache.org on 2007/04/30 23:07:08 UTC

svn commit: r533873 - in /incubator/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyPostResolveTask.java test/java/org/apache/ivy/ant/IvyArtifactReportTest.java

Author: maartenc
Date: Mon Apr 30 16:07:07 2007
New Revision: 533873

URL: http://svn.apache.org/viewvc?view=rev&rev=533873
Log:
FIX: Post-Resolve task shouldn't set the 'resolveid' (IVY-489)

Added:
    incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyArtifactReportTest.java
Modified:
    incubator/ivy/core/trunk/CHANGES.txt
    incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java

Modified: incubator/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/CHANGES.txt?view=diff&rev=533873&r1=533872&r2=533873
==============================================================================
--- incubator/ivy/core/trunk/CHANGES.txt (original)
+++ incubator/ivy/core/trunk/CHANGES.txt Mon Apr 30 16:07:07 2007
@@ -50,6 +50,7 @@
 
 - FIX: ivy:install ant task does not fail on error (IVY-475) (thanks to Jeffrey Blatttman)
 - FIX: Credentials are shown in build log even if debug is not enabled (IVY-486) (thanks to Gilles Scokart)
+- FIX: Post-Resolve task shouldn't set the 'resolveid' (IVY-489)
 
    2.0.0-alpha1-incubating
 =====================================

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java?view=diff&rev=533873&r1=533872&r2=533873
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java Mon Apr 30 16:07:07 2007
@@ -96,9 +96,6 @@
             if (_module == null) {
                 throw new BuildException("no module name provided for ivy cache task in inline mode: It can either be set explicitely via the attribute 'module' or via 'ivy.module' property");
             }
-            if (_resolveId == null) {
-            	_resolveId = ResolveOptions.getDefaultResolveId(getResolvedModuleId());
-            }
         	String[] toResolve = getConfsToResolve(getOrganisation(), getModule()+"-caller", _conf, true);
         	if (toResolve.length > 0) {        		
         		Message.verbose("using inline mode to resolve "+getOrganisation()+" "+getModule()+" "+getRevision()+" ("+StringUtils.join(toResolve, ", ")+")");
@@ -109,7 +106,7 @@
         		resolve.setInline(true);
         		resolve.setConf(_conf);
         		resolve.setCache(_cache);
-//        		resolve.setResolveId(_resolveId);  TODO
+        		resolve.setResolveId(_resolveId);
         		resolve.execute();
         	} else {
         		Message.verbose("inline resolve already done for "+getOrganisation()+" "+getModule()+" "+getRevision()+" ("+_conf+")");
@@ -146,9 +143,6 @@
         }
         if (_conf == null) {
             throw new BuildException("no conf provided for ivy cache task: It can either be set explicitely via the attribute 'conf' or via 'ivy.resolved.configurations' property or a prior call to <resolve/>");
-        }
-        if (_resolveId == null) {
-        	_resolveId = ResolveOptions.getDefaultResolveId(getResolvedModuleId());
         }
         
         _artifactFilter = FilterHelper.getArtifactTypeFilter(_type);

Added: incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyArtifactReportTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyArtifactReportTest.java?view=auto&rev=533873
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyArtifactReportTest.java (added)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyArtifactReportTest.java Mon Apr 30 16:07:07 2007
@@ -0,0 +1,65 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivy.ant;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Delete;
+
+public class IvyArtifactReportTest extends TestCase {
+    private File _cache;
+    private IvyArtifactReport _prop;
+    private Project _project;
+    
+    protected void setUp() throws Exception {
+        createCache();
+        _project = new Project();
+        _project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");
+
+        _prop = new IvyArtifactReport();
+        _prop.setProject(_project);
+        _prop.setCache(_cache);
+    }
+
+    private void createCache() {
+        _cache = new File("build/cache");
+        _cache.mkdirs();
+    }
+    
+    protected void tearDown() throws Exception {
+        cleanCache();
+    }
+
+    private void cleanCache() {
+        Delete del = new Delete();
+        del.setProject(new Project());
+        del.setDir(_cache);
+        del.execute();
+    }
+
+    public void testSimple() throws Exception {
+        _prop.setTofile(new File("build/test-artifact-report.xml"));
+        _prop.setFile(new File("test/java/org/apache/ivy/ant/ivy-simple.xml"));
+        _prop.execute();
+        
+        assertTrue(new File("build/test-artifact-report.xml").exists());
+    }
+}