<project basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
	<property name="using.ivy" value="true" />

	<target name="setup-ivy.properties" description="--> setup ivy properties">
		<property name="ivy.cache.dir" value="${repository}/.ivy-cache" />
		<property name="ivy.install.version" value="2.0.0" />
		<property name="ivy.jar.dir" value="${ivy.cache.dir}/ivy" />
		<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
		<property name="ivy.settings" value="ivysettings.xml" />
	</target>

	<target name="download-ivy" depends="setup-ivy.properties" unless="skip.download" description="--> download ivy from web site">
		<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://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true" />
	</target>

	<target name="install-ivy" depends="download-ivy" description="--> install ivy">
		<path id="ivy.lib.path">
			<fileset dir="${ivy.jar.dir}" includes="*.jar" />
		</path>
		<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
	</target>
	
	<target name="update-project.depends" depends="setup-ivy.properties,install-ivy,clean-ivy.cache" description="Download project dependencies">
		<ivy:settings file="${ivy.settings}" />
		<ivy:retrieve pattern="${build.root}/lib/frameworks/[artifact]-[revision].[ext]" />
	</target>
	<!-- ================================= 
          target: clean-ivy              
         ================================= -->
	<target name="clean-ivy" description="--> clean the ivy installation">
		<delete dir="${ivy.jar.dir}" />
	</target>

	<!-- ================================= 
          target: clean-cache              
         ================================= -->
	<target name="clean-ivy.cache" depends="install-ivy" description="--> clean the ivy cache">
		<ivy:cleancache />
	</target>
</project>