Integrate Ivy in a dotNet build

Luca | April 17, 2008

I’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>

Comments
4 Comments »
Categories
.Net
Tags
,
Comments rss Comments rss
Trackback Trackback

Ivy: how-to download dependencies to different folders

Luca |

Ivy is a dependency manager that lets you define in a declarative way directly in the build file the dependency of your project.

In order to downlaod dependencies in different folders (i.e. separate the runtime dependencies from the testing ones) you have to define configurations.

Let’s say we have this project structure:
/lib
-prod
-test

The first step is defining in your ivy.xml a configuration for each folder:

<configurations>
<conf name=\”test\” visibility=\”public\” description=\”test dependencies\” />
<conf name=\”prod\” visibility=\”public\” description=\”runtime dependencies\” />
</configurations>

and then defining the actual dependencies assigning to each one the right configuration(in these scenario all are extending the default one):

<dependencies>
<dependency org=\”org.apache\” name=\”junit\” rev=\”2.0\” conf=\”test->default\”/>
<dependency org=\”org.apache\” name=\”log4j\” rev=\”2.0\” conf=\”prod->default\”/>
</dependencies>

Finally in the build file you have to define the pattern in the ivy:retrieve tag:

<ivy:retrieve pattern=\”$ {ivy.lib.dir}/[conf]/[artifact].[ext]\”/>

is easy to see that the pattern chunk that defines the actual destination directory id the [conf] token.

Live documentation with Evernote

Luca | April 12, 2008

I recently discovered Evernote, a tool to capture and search information easily ( on the web, with a fat client or a mobile one)

The coolest thing is that the client does Optical Character Recognition on pictures.
Evernote looks really good for ToDo lists and GTD stuff but I actually see it as an incredible tool for traking info for a project.

Think at this scenario: quick meeting to clarify some bits regarding your new project Foo1(let’s say the build pipeline).

pipeline

At the end of the meeting we have a pretty good idea and everything is on the flip chart/whiteboard.

We just need to take a picture of the defined pipeline and upload it in Evernote. Now the snapshot is a live document: we can easily search it using any of the words we wrote on the flip chart !

It’s still not perfect, but it’s definitively worth to give to these guys a bit of time to improve somethings that it’s already looking pretty cool.

Essap 2008

Luca | April 9, 2008

For the third year the European Summer School of Agile Programming(Essap) is a great opportunity to learn more about Agile Methodologies.

Here the website of the school: check it out.