////
   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.
////

[*__since 2.0__*]

Cleans the Ivy cache.

This task is roughly equivalent to:

[source,xml]
----
<delete dir="${ivy.cache.dir}"/>
----

Using the regular Ant delete task is more flexible, since it allows to specify the files to delete. But it requires Ivy settings to be loaded, and settings scoping is possible only by using a 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`.

== Attributes

[options="header",cols="15%,50%,35%"]
|=======
|Attribute|Description|Required
|settingsRef|A reference to Ivy settings that must be used by this task|No. Defaults to `ivy.instance`.
|=======

== Examples

[source,xml]
----
<ivy:cleancache/>
----

Cleans the cache directory as defined in the loaded settings (by default `~/.ivy2/cache`)

[source,xml]
----
<ivy:cleancache settingsRef="mysettings"/>
----

Cleans the cache directory as defined in the loaded settings identified as `mysettings`
