Integrate Ivy in a dotNet build
Luca | April 17, 2008I’m currently involved in a dotNet shop and I’m working on redesigning the build pipeline (good old CI stuff).
Ivy appeared in our brainstorming sessions as solution for the requirement of having a more defined control on the projects dependencies.
The problem is that currently (but you never know about the future
) there isn’t a dotNet native port of Ivy.
This can be solved using the exec tag from your NAnt script and using java as an external program.
Here is the bit to add to your NAnt build script:
<target name=\”dependencies\” description=\”resolves project dependencies\”>
<exec program=\”java.exe\”>
<arg value=\”-classpath\” />
<arg>
<path>
<pathelement file=\”tools/apache-ivy-2.0.0-beta2/ivy-2.0.0-beta2.jar\” />
<pathelement file=\”tools/apache-ivy-2.0.0-beta2/ivy-core-2.0.0-beta2.jar\” />
<pathelement file=\”tools/apache-ivy-2.0.0-beta2/lib/commons-cli-1.0.jar\” />
</path>
</arg>
<arg value=\”org.apache.ivy.Main\” />
<arg value=\”-settings\” />
<arg>
<path>
<pathelement file=\”ivysettings.xml\” />
</path>
</arg>
<arg value=\”-retrieve\” />
<arg>
<path>
<pathelement dir=\”lib/[module].[artifact].[ext]\” />
</path>
</arg>
</exec>
</target>





