I am using Ant
with Ivy
and so my compile
task looks like:
<target name="compile" depends="prepare, retrieve" ..
where the retrieve
task is used to resolve and fetch Ivy
dependencies. So, since my compile
task depends on the retrieve
task, the resolving of Ivy
dependencies is triggered with every compilation. Ditto for run
since the run
task depends on compile
.
This wastes time so I would like to have a dry-compile
which would not depend on the Ivy
task.
The use case would be that if no Ivy
dependency has changed I would be able to do an ant dry-compile
or even an ant dry-run
without triggering the Ivy
resolving functionality.
Is there a way to do that in Ant
without copy-pasting the targets to create variants with different depends
attributes?
My ivy.xml file is:
<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="foo" module="bar" status="integration"/>
<dependencies>
<dependency org="org.apache.commons" name="commons-lang3" rev="3.1"/>
</dependencies>
</ivy-module>
and the Ant resolve
target (on which target compile
depends) is:
<target name="test-ivy" description="Test ivy installation">
<ivy:settings />
</target>
<target name="resolve" depends="test-ivy">
<ivy:resolve/>
<ivy:retrieve sync="true" pattern="${ivylibs.dir}/[artifact]-[revision](-[classifier]).[ext]"/>
</target>