ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r694036 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/settings/ src/java/org/apache/ivy/plugins/parser/m2/handlers/ test/java/org/apache/ivy/ant/
Date Wed, 10 Sep 2008 22:25:06 GMT
Author: maartenc
Date: Wed Sep 10 15:25:06 2008
New Revision: 694036

URL: http://svn.apache.org/viewvc?rev=694036&view=rev
Log:
FIX: ivy.cache.dir.${settingsRef} is set to default instead of the defaultCacheDir from the
ivysettings.xml after ivy:resolve (IVY-898)

Added:
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/handlers/
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-defaultCacheDir.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-noDefaultCacheDir.xml
Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=694036&r1=694035&r2=694036&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Sep 10 15:25:06 2008
@@ -111,6 +111,7 @@
 - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed from the cache
(IVY-883)
 - IMPROVEMENT: Improve performance (IVY-872)
 
+- FIX: ivy.cache.dir.${settingsRef} is set to default instead of the defaultCacheDir from
the ivysettings.xml after ivy:resolve (IVY-898)
 - FIX: Ivy ibiblio resolver chokes on variables while checking descriptor consistency (IVY-818)
 - FIX: Enable consistent support of the configuration negation operator (IVY-894) (thanks
to Patrick Woodworth)
 - FIX: add variable expansion in extra attributes (IVY-798)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java?rev=694036&r1=694035&r2=694036&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java Wed Sep 10 15:25:06
2008
@@ -201,6 +201,10 @@
     public void setUrl(String confUrl) throws MalformedURLException {
         this.url = new URL(confUrl);
     }
+    
+    public void setUrl(URL url) {
+        this.url = url;
+    }
 
     /*
      * This is usually not necessary to define a reference in Ant, but it's the only

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java?rev=694036&r1=694035&r2=694036&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java Wed Sep 10 15:25:06 2008
@@ -89,6 +89,13 @@
     public void setUrl(String url) throws MalformedURLException {
         settings.setUrl(url);
     }
+    
+    public void setUrl(URL url) {
+        if (url == null) {
+            throw new NullPointerException("Cannot set a null URL");
+        }
+        settings.setUrl(url);
+    }
 
     public String getRealm() {
         return settings.getRealm();

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=694036&r1=694035&r2=694036&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java Wed Sep 10 15:25:06
2008
@@ -371,7 +371,6 @@
         } else {
             getDefaultIvyUserDir();
         }
-        getDefaultCache();
 
         loadDefaultProperties();
         try {
@@ -397,7 +396,6 @@
         } else {
             getDefaultIvyUserDir();
         }
-        getDefaultCache();
 
         loadDefaultProperties();
         new XmlSettingsParser(this).parse(settingsURL);

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java?rev=694036&r1=694035&r2=694036&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java Wed Sep 10 15:25:06
2008
@@ -54,6 +54,35 @@
         task.setSettingsRef(ref);
         return task.getIvyInstance();
     }
+    
+    public void testDefaultCacheDir() {
+        // test with an URL
+        configure.setUrl(getClass().getResource("ivysettings-defaultCacheDir.xml"));
+        configure.setSettingsId("test");
+        configure.execute();
+        
+        assertEquals(new File("mycache").getAbsolutePath(), project.getProperty("ivy.cache.dir.test"));
+        
+        // test with a File
+        project = new Project();
+        configure = new IvyConfigure();
+        configure.setProject(project);
+        configure.setFile(new File("test/java/org/apache/ivy/ant/ivysettings-defaultCacheDir.xml"));
+        configure.setSettingsId("test2");
+        configure.execute();
+
+        assertEquals(new File("mycache").getAbsolutePath(), project.getProperty("ivy.cache.dir.test2"));
+        
+        // test if no defaultCacheDir is specified
+        project = new Project();
+        configure = new IvyConfigure();
+        configure.setProject(project);
+        configure.setFile(new File("test/java/org/apache/ivy/ant/ivysettings-noDefaultCacheDir.xml"));
+        configure.setSettingsId("test3");
+        configure.execute();
+
+        assertNotNull(project.getProperty("ivy.cache.dir.test3"));
+    }
 
     public void testDefault() throws Exception {
         // by default settings look in the current directory for an ivysettings.xml file...

Added: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-defaultCacheDir.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-defaultCacheDir.xml?rev=694036&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-defaultCacheDir.xml (added)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-defaultCacheDir.xml Wed Sep
10 15:25:06 2008
@@ -0,0 +1,21 @@
+<!--
+   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>
+	<caches defaultCacheDir="${ivy.basedir}/mycache"  />
+</ivysettings>

Added: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-noDefaultCacheDir.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-noDefaultCacheDir.xml?rev=694036&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-noDefaultCacheDir.xml (added)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-noDefaultCacheDir.xml Wed
Sep 10 15:25:06 2008
@@ -0,0 +1,21 @@
+<!--
+   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>
+	<caches />
+</ivysettings>



Mime
View raw message