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 xa...@apache.org on 2007/07/09 14:32:33 UTC

svn commit: r554661 - in /incubator/ivy/core/trunk: ./ doc/ doc/use/ src/example/chained-resolvers/ src/example/chained-resolvers/chainedresolvers-project/ src/example/configurations/jdbc-example/ src/example/configurations/multi-projects/filter-framew...

Author: xavier
Date: Mon Jul  9 07:32:31 2007
New Revision: 554661

URL: http://svn.apache.org/viewvc?view=rev&rev=554661
Log:
- NEW: Add cleancache task (IVY-565)
- FIX: Ant target "clean" on Ivy multi-project tutorial points to wrong cache directory. (IVY-548)

Added:
    incubator/ivy/core/trunk/doc/use/cleancache.html   (with props)
    incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCleanCache.java   (with props)
    incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyCleanCacheTest.java   (with props)
    incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-cleancache.xml   (with props)
Modified:
    incubator/ivy/core/trunk/CHANGES.txt
    incubator/ivy/core/trunk/doc/toc.json
    incubator/ivy/core/trunk/src/example/chained-resolvers/build.xml
    incubator/ivy/core/trunk/src/example/chained-resolvers/chainedresolvers-project/build.xml
    incubator/ivy/core/trunk/src/example/configurations/jdbc-example/build.xml
    incubator/ivy/core/trunk/src/example/configurations/multi-projects/filter-framework/build.xml
    incubator/ivy/core/trunk/src/example/configurations/multi-projects/myapp/build.xml
    incubator/ivy/core/trunk/src/example/dual/build.xml
    incubator/ivy/core/trunk/src/example/go-ivy/build.xml
    incubator/ivy/core/trunk/src/example/hello-ivy/build.xml
    incubator/ivy/core/trunk/src/example/ivyrep/build.xml
    incubator/ivy/core/trunk/src/example/multi-project/build.xml
    incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/antlib.xml

Modified: incubator/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/CHANGES.txt?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/CHANGES.txt (original)
+++ incubator/ivy/core/trunk/CHANGES.txt Mon Jul  9 07:32:31 2007
@@ -51,6 +51,7 @@
 
    version in SVN
 =====================================
+- NEW: Add cleancache task (IVY-565)
 - NEW: A checkstyle report is generated (IVY-483) (thanks to Jan Materne)
 - NEW: Hide private or specific conf when publishing (IVY-77)
 
@@ -67,6 +68,7 @@
 - IMPROVEMENT: Javadoc improvements (IVY-544) (with contribution from Tjeerd Verhagen)
 - IMPROVEMENT: Unit test improvements (IVY-545) (thanks to Tjeerd Verhagen)
 
+- FIX: Ant target "clean" on Ivy multi-project tutorial points to wrong cache directory. (IVY-548)
 - FIX: Variables not replaced during deliver (IVY-520) (thanks to John Williams)
 - FIX: XmlModuleDescriptorWriter does not produce matcher attribute on include and exclude rules (IVY-556)
 - FIX: pom.groupId is not recognized in maven 2 pom parser (IVY-550)

Modified: incubator/ivy/core/trunk/doc/toc.json
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/doc/toc.json?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/doc/toc.json (original)
+++ incubator/ivy/core/trunk/doc/toc.json Mon Jul  9 07:32:31 2007
@@ -592,6 +592,13 @@
                             ]
                         },
                         {
+                          "id":"use/cleancache",
+                          "title":"cleancache",
+                          "children": [
+
+                            ]
+                        },
+                        {
                           "id":"use/configure",
                           "title":"configure",
                           "children": [

Added: incubator/ivy/core/trunk/doc/use/cleancache.html
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/doc/use/cleancache.html?view=auto&rev=554661
==============================================================================
--- incubator/ivy/core/trunk/doc/use/cleancache.html (added)
+++ incubator/ivy/core/trunk/doc/use/cleancache.html Mon Jul  9 07:32:31 2007
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!--
+   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.    
+-->
+<html>
+<head>
+	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
+	<script type="text/javascript">var xookiConfig = {level: 1};</script>	
+	<script type="text/javascript" src="../xooki/xooki.js"></script>
+</head>
+<body>
+	<textarea id="xooki-source">
+<span class="since">since 2.0</span>
+Cleans the Ivy cache.
+
+This task is roughly equivalent to:
+<code>
+<delete dir="${ivy.cache.dir}" />
+</code>
+Using the regular Ant delete task is more flexible, since it allows to specify the files to delete. But it requires an Ivy settings to be loaded, and settings scoping is possible only by using suffixed ant property for the cache directory. 
+
+This task loads the Ivy settings as any other post settings task, and allows easy scoping with the attribute settingsRef.
+
+<h1>Attributes</h1>
+<table class="ant">
+<thead>
+    <tr><th class="ant-att">Attribute</th><th class="ant-desc">Description</th><th class="ant-req">Required</th></tr>
+</thead>
+<tbody>
+    <tr><td>settingsRef</td><td>A reference to the ivy settings that must be used by this task</td><td>No, 'ivy.instance' is taken by default.</td></tr>
+</tbody>
+</table>
+<h1>Examples</h1>
+<code type="xml">
+<ivy:cleancache />
+</code>
+Cleans the cache directory as defined in the loaded settings (by default ~/.ivy2/cache)
+
+<code type="xml">
+<ivy:cleancache settingsRef="mysettings"/>
+</code>
+Cleans the cache directory as defined in the loaded settings identified as 'mysettings'</textarea>
+<script type="text/javascript">xooki.postProcess();</script>
+</body>
+</html>

Propchange: incubator/ivy/core/trunk/doc/use/cleancache.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/ivy/core/trunk/src/example/chained-resolvers/build.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/example/chained-resolvers/build.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/example/chained-resolvers/build.xml (original)
+++ incubator/ivy/core/trunk/src/example/chained-resolvers/build.xml Mon Jul  9 07:32:31 2007
@@ -16,7 +16,7 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<project default="clean-all">
+<project default="clean-all" xmlns:ivy="antlib:org.apache.ivy.ant">
     
     <!-- ================================= 
           target: clean              
@@ -29,7 +29,9 @@
           target: clean-cache              
          ================================= -->
 	<target name="clean-cache" description="--> clean the ivy cache">
-		<delete dir="${user.home}/.ivy-cache"/>
+		<property name="ivy.settings.dir" value="config" />
+		<ivy:settings file="${ivy.settings.dir}/ivysettings.xml" />
+		<ivy:cleancache />
 	</target>
 	
 	<target name="clean-all" depends="clean, clean-cache" description="--> clean directories and ivy cache"/>

Modified: incubator/ivy/core/trunk/src/example/chained-resolvers/chainedresolvers-project/build.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/example/chained-resolvers/chainedresolvers-project/build.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/example/chained-resolvers/chainedresolvers-project/build.xml (original)
+++ incubator/ivy/core/trunk/src/example/chained-resolvers/chainedresolvers-project/build.xml Mon Jul  9 07:32:31 2007
@@ -76,6 +76,6 @@
           target: clean-cache              
          ================================= -->
 	<target name="clean-cache" description="--> clean the ivy cache">
-		<delete dir="${user.home}/.ivy-cache"/>
+		<ivy:cleancache />
 	</target>
 </project>

Modified: incubator/ivy/core/trunk/src/example/configurations/jdbc-example/build.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/example/configurations/jdbc-example/build.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/example/configurations/jdbc-example/build.xml (original)
+++ incubator/ivy/core/trunk/src/example/configurations/jdbc-example/build.xml Mon Jul  9 07:32:31 2007
@@ -92,6 +92,6 @@
           target: clean-cache              
          ================================= -->
 	<target name="clean-cache" description="--> clean the ivy cache">
-		<delete dir="${user.home}/.ivy-cache"/>
+		<ivy:cleancache />
 	</target>
 </project>

Modified: incubator/ivy/core/trunk/src/example/configurations/multi-projects/filter-framework/build.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/example/configurations/multi-projects/filter-framework/build.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/example/configurations/multi-projects/filter-framework/build.xml (original)
+++ incubator/ivy/core/trunk/src/example/configurations/multi-projects/filter-framework/build.xml Mon Jul  9 07:32:31 2007
@@ -118,7 +118,7 @@
           target: clean-cache              
          ================================= -->
 	<target name="clean-cache" description="--> clean the ivy cache">
-		<delete dir="${user.home}/.ivy/cache"/>
+		<ivy:cleancache />
 	</target>
     
     <!-- ================================= 

Modified: incubator/ivy/core/trunk/src/example/configurations/multi-projects/myapp/build.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/example/configurations/multi-projects/myapp/build.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/example/configurations/multi-projects/myapp/build.xml (original)
+++ incubator/ivy/core/trunk/src/example/configurations/multi-projects/myapp/build.xml Mon Jul  9 07:32:31 2007
@@ -88,6 +88,6 @@
           target: clean-cache              
          ================================= -->
 	<target name="clean-cache" description="--> clean the ivy cache">
-		<delete dir="${user.home}/.ivy/cache"/>
+		<ivy:cleancache />
 	</target>
 </project>

Modified: incubator/ivy/core/trunk/src/example/dual/build.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/example/dual/build.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/example/dual/build.xml (original)
+++ incubator/ivy/core/trunk/src/example/dual/build.xml Mon Jul  9 07:32:31 2007
@@ -16,7 +16,7 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<project default="clean-all">
+<project default="clean-all" xmlns:ivy="antlib:org.apache.ivy.ant">
     
     <!-- ================================= 
           target: clean              
@@ -29,7 +29,9 @@
           target: clean-cache              
          ================================= -->
 	<target name="clean-cache" description="--> clean the ivy cache">
-		<delete dir="${user.home}/.ivy-cache"/>
+		<property name="ivy.settings.dir" value="config" />
+		<ivy:settings file="${ivy.settings.dir}/ivysettings.xml" />
+		<ivy:cleancache />
 	</target>
 	
 	<target name="clean-all" depends="clean, clean-cache" description="--> clean directories and ivy cache"/>

Modified: incubator/ivy/core/trunk/src/example/go-ivy/build.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/example/go-ivy/build.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/example/go-ivy/build.xml (original)
+++ incubator/ivy/core/trunk/src/example/go-ivy/build.xml Mon Jul  9 07:32:31 2007
@@ -38,7 +38,7 @@
 	
 	<!-- here is the version of ivy we will use. change this property to try a newer 
          version if you want -->
-	<property name="ivy.install.version" value="1.4" />
+	<property name="ivy.install.version" value="2.0.0-alpha-2-incubating" />
 	<property name="ivy.jar.dir" value="${basedir}/ivy" />
 	<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
 
@@ -49,14 +49,14 @@
     <!-- ================================= 
           target: install-ivy         
             this target is not necessary if you put ivy.jar in your ant lib directory
-            if you already have ivy 1.4 in your ant lib, you can simply remove this
+            if you already have ivy in your ant lib, you can simply remove this
             target and the dependency the 'go' target has on it
          ================================= -->
     <target name="install-ivy" description="--> install ivy">
     	<mkdir dir="${ivy.jar.dir}"/>
 		<!-- download Ivy from web site so that it can be used even without any special installation -->
 		<echo message="installing ivy..."/>
-    	<get src="http://www.jayasoft.org/downloads/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
+    	<get src="http://people.apache.org/~xavier/ivy/${ivy.install.version}/ivy.jar"
     		 dest="${ivy.jar.file}" usetimestamp="true"/>
     		 
     	<!-- try to load ivy here from local ivy dir, in case the user has not already dropped
@@ -142,7 +142,8 @@
     <!-- ================================= 
           target: clean-cache              
          ================================= -->
-	<target name="clean-cache" description="--> clean the ivy cache">
-		<delete dir="${user.home}/.ivy/cache"/>
+	<target name="clean-cache" depends="install-ivy" 
+			description="--> clean the ivy cache">
+		<ivy:cleancache />
 	</target>
 </project>

Modified: incubator/ivy/core/trunk/src/example/hello-ivy/build.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/example/hello-ivy/build.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/example/hello-ivy/build.xml (original)
+++ incubator/ivy/core/trunk/src/example/hello-ivy/build.xml Mon Jul  9 07:32:31 2007
@@ -71,6 +71,6 @@
           target: clean-cache              
          ================================= -->
 	<target name="clean-cache" description="--> clean the ivy cache">
-		<delete dir="${user.home}/.ivy/cache"/>
+		<ivy:cleancache />
 	</target>
 </project>

Modified: incubator/ivy/core/trunk/src/example/ivyrep/build.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/example/ivyrep/build.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/example/ivyrep/build.xml (original)
+++ incubator/ivy/core/trunk/src/example/ivyrep/build.xml Mon Jul  9 07:32:31 2007
@@ -75,6 +75,6 @@
           target: clean-cache              
          ================================= -->
 	<target name="clean-cache" description="--> clean the ivy cache">
-		<delete dir="${user.home}/.ivy-cache"/>
+		<ivy:cleancache />
 	</target>
 </project>

Modified: incubator/ivy/core/trunk/src/example/multi-project/build.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/example/multi-project/build.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/example/multi-project/build.xml (original)
+++ incubator/ivy/core/trunk/src/example/multi-project/build.xml Mon Jul  9 07:32:31 2007
@@ -17,11 +17,11 @@
    under the License.    
 -->
 <project name="all" 
-         xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
+         xmlns:ivy="antlib:org.apache.ivy.ant">
          
 	<!-- here is the version of ivy we will use. change this property to try a newer 
          version if you want -->
-	<property name="ivy.jar.dir" value="${user.home}/.ivy/jars" />
+	<property name="ivy.jar.dir" value="${user.home}/.ivy2/jars" />
 	<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
 
     <property name="build.dir" value="build" />
@@ -42,8 +42,8 @@
     	<path id="ivy.lib.path">
     	    <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
     	</path>
-    	<taskdef resource="fr/jayasoft/ivy/ant/antlib.xml"
-    	          uri="antlib:fr.jayasoft.ivy.ant" classpathref="ivy.lib.path"/>
+    	<taskdef resource="org/apache/ivy/ant/antlib.xml"
+    	          uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
     </target>    
          
   <target name="buildlist" depends="install-ivy"> 
@@ -56,7 +56,8 @@
     <subant target="new-version" buildpathref="build-path" />
   </target>
 
-  <target name="publish-all" depends="buildlist" description="compile, jar and publish all projects in the right order">
+  <target name="publish-all" depends="buildlist" 
+  			description="compile, jar and publish all projects in the right order">
     <subant target="publish" buildpathref="build-path" />
   </target>
 
@@ -64,9 +65,10 @@
     <subant target="clean" buildpathref="build-path" />
   </target>
   
-  <target name="clean" depends="clean-all" description="clean tutorial: delete repository, ivy cache, and all projects">
+  <target name="clean" depends="clean-all, install-ivy" 
+  			description="clean tutorial: delete repository, ivy cache, and all projects">
     <delete dir="repository"/>
-    <delete dir="ivy-cache"/>
+  	<ivy:cleancache />
   </target>
   
   

Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCleanCache.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCleanCache.java?view=auto&rev=554661
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCleanCache.java (added)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCleanCache.java Mon Jul  9 07:32:31 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.
+ *
+ */
+package org.apache.ivy.ant;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.taskdefs.Delete;
+
+/**
+ * Cleans the content of Ivy cache.
+ * 
+ *  The whole directory used as Ivy cache is deleted, this is roughly equivalent to:
+ *  <pre>
+ *  &lt;delete dir="${ivy.cache.dir}" &gt;
+ *  </pre>
+ *  
+ *  Using the delete task gives more control over what is actually deleted (you can use include
+ *  and exclude filters), but requires a settings to be loaded before, while this task
+ *  ensures the settings is loaded.
+ */
+public class IvyCleanCache extends IvyTask {
+
+    public void doExecute() throws BuildException {
+        Delete delete = new Delete();
+        delete.setProject(getProject());
+        delete.setDir(getIvyInstance().getSettings().getDefaultCache());
+        delete.perform();
+    }
+}

Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCleanCache.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/antlib.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/antlib.xml?view=diff&rev=554661&r1=554660&r2=554661
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/antlib.xml (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/antlib.xml Mon Jul  9 07:32:31 2007
@@ -41,4 +41,5 @@
 	<taskdef name="listmodules" classname="org.apache.ivy.ant.IvyListModules"/>
 	<taskdef name="findrevision" classname="org.apache.ivy.ant.IvyFindRevision"/>
 	<taskdef name="buildnumber" classname="org.apache.ivy.ant.IvyBuildNumber"/>
+	<taskdef name="cleancache" classname="org.apache.ivy.ant.IvyCleanCache"/>
 </antlib>

Added: incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyCleanCacheTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyCleanCacheTest.java?view=auto&rev=554661
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyCleanCacheTest.java (added)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyCleanCacheTest.java Mon Jul  9 07:32:31 2007
@@ -0,0 +1,46 @@
+/*
+ *  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;
+
+public class IvyCleanCacheTest extends TestCase {
+    private IvyCleanCache cleanCache = new IvyCleanCache();
+    private File cacheDir;
+    
+    protected void setUp() throws Exception {
+        Project p = new Project();
+        cacheDir = new File("build/cache");
+        p.setProperty("cache", cacheDir.getAbsolutePath());
+        cleanCache.setProject(p);
+        IvyAntSettings settings = IvyAntSettings.getDefaultInstance(p);
+        settings.setUrl(
+            IvyCleanCacheTest.class.getResource("ivysettings-cleancache.xml").toExternalForm());
+    }
+    
+    public void testClean() throws Exception {
+        cacheDir.mkdirs();
+        assertTrue(cacheDir.exists());
+        cleanCache.execute();
+        assertFalse(cacheDir.exists());
+    }
+}

Propchange: incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyCleanCacheTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-cleancache.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-cleancache.xml?view=auto&rev=554661
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-cleancache.xml (added)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-cleancache.xml Mon Jul  9 07:32:31 2007
@@ -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>
+	<settings defaultCache="${cache}" />
+</ivysettings>

Propchange: incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-cleancache.xml
------------------------------------------------------------------------------
    svn:eol-style = native