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/05/10 22:20:58 UTC

svn commit: r537017 - in /incubator/ivy/core/trunk: ./ src/java/org/apache/ivy/core/resolve/ src/java/org/apache/ivy/core/settings/ test/java/org/apache/ivy/core/install/ test/repositories/

Author: maartenc
Date: Thu May 10 15:20:57 2007
New Revision: 537017

URL: http://svn.apache.org/viewvc?view=rev&rev=537017
Log:
FIX: install ant task: requires default resolver in ivy settings (IVY-477)

Added:
    incubator/ivy/core/trunk/test/repositories/ivysettings-nodefaultresolver.xml
Modified:
    incubator/ivy/core/trunk/CHANGES.txt
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/core/install/InstallTest.java

Modified: incubator/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/CHANGES.txt?view=diff&rev=537017&r1=537016&r2=537017
==============================================================================
--- incubator/ivy/core/trunk/CHANGES.txt (original)
+++ incubator/ivy/core/trunk/CHANGES.txt Thu May 10 15:20:57 2007
@@ -51,6 +51,7 @@
 
 - IMPROVEMENT: Allow "main" parameters to be passed directly (instead of using -args flag) (IVY-480) (thanks to Archie Cobbs)
 
+- FIX: install ant task: requires default resolver in ivy settings (IVY-477)
 - FIX: Ant project reference lost from context on multiple ant calls in single thread (IVY-497) (thanks to Jaroslaw Wypychowski)
 - FIX: EOL in the doc pages (IVY-470)
 - FIX: Cache is storing ArtifactOrigin properties with no guarantee of unicity and types telescope during resolve. (IVY-430) (thanks to Stephane Bailliez)

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java?view=diff&rev=537017&r1=537016&r2=537017
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java Thu May 10 15:20:57 2007
@@ -89,6 +89,7 @@
 
     public void setDictatorResolver(DependencyResolver dictatorResolver) {
         _dictatorResolver = dictatorResolver;
+        _settings.setDictatorResolver(dictatorResolver);
     }
 
     public ResolveReport resolve(File ivySource) throws ParseException, IOException {

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?view=diff&rev=537017&r1=537016&r2=537017
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java Thu May 10 15:20:57 2007
@@ -622,6 +622,10 @@
         }
         return _defaultCache;
     }
+    
+    public void setDictatorResolver(DependencyResolver resolver) {
+    	_dictatorResolver = resolver;
+    }
 
     public DependencyResolver getResolver(ModuleId moduleId) {
         if (_dictatorResolver != null) {

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/core/install/InstallTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/core/install/InstallTest.java?view=diff&rev=537017&r1=537016&r2=537017
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/core/install/InstallTest.java (original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/core/install/InstallTest.java Thu May 10 15:20:57 2007
@@ -41,6 +41,17 @@
         assertTrue(new File("build/test/install/org1/mod1.2/mod1.2-2.0.jar").exists());
     }
 
+    public void testSimpleWithoutDefaultResolver() throws Exception {
+        Ivy ivy = Ivy.newInstance();
+        ivy.configure(new File("test/repositories/ivysettings-nodefaultresolver.xml"));
+        
+        ivy.install(ModuleRevisionId.newInstance("org1", "mod1.2", "2.0"), 
+                "test", "install", true, true, true, null, _cache, PatternMatcher.EXACT);
+        
+        assertTrue(new File("build/test/install/org1/mod1.2/ivy-2.0.xml").exists());
+        assertTrue(new File("build/test/install/org1/mod1.2/mod1.2-2.0.jar").exists());
+    }
+
     public void testDependencies() throws Exception {
         Ivy ivy = Ivy.newInstance();
         ivy.configure(new File("test/repositories/ivysettings.xml"));

Added: incubator/ivy/core/trunk/test/repositories/ivysettings-nodefaultresolver.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/ivysettings-nodefaultresolver.xml?view=auto&rev=537017
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/ivysettings-nodefaultresolver.xml (added)
+++ incubator/ivy/core/trunk/test/repositories/ivysettings-nodefaultresolver.xml Thu May 10 15:20:57 2007
@@ -0,0 +1,43 @@
+<!--
+   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.    
+-->
+<ivysettings>
+	<properties file="${ivy.settings.dir}/ivysettings.properties" />
+	<settings defaultCache="${cache.dir}"/>
+	<resolvers>
+		<chain name="test">
+			<filesystem name="1">
+				<ivy pattern="${ivy.settings.dir}/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
+				<artifact pattern="${ivy.settings.dir}/1/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
+			</filesystem>
+			<dual name="2">
+				<filesystem name="2-ivy">
+					<ivy pattern="${ivy.settings.dir}/2/[module]/ivy-[revision].xml"/>
+				</filesystem>
+				<filesystem name="2-artifact">
+					<artifact pattern="${ivy.settings.dir}/2/[module]/[artifact]-[revision].[ext]"/>
+					<artifact pattern="${ivy.settings.dir}/2/[module]/[artifact].[ext]"/>
+				</filesystem>
+			</dual>
+		</chain>
+		<filesystem name="install">
+			<ivy pattern="build/test/install/[organisation]/[module]/[artifact]-[revision].[ext]"/>
+			<artifact pattern="build/test/install/[organisation]/[module]/[artifact]-[revision].[ext]"/>
+		</filesystem>
+	</resolvers>
+</ivysettings>