Mark Derricutt's Disturbing Thoughts

IntelliJ IDEA Library Generation From Ant Path

posted Sunday, 18 June 2006

For the last few months I've been using the Ivy dependency manager on one of my ${work} projects, Ivy's been working great and I've now got 2-3 other projects publishing their dependencies via Ivy for my use.

An annoying offshoot of this is that whenever an update triggers in these other applications, I get a new binary with a new/different version number included. This likes to break IDEA and trigger lots of evil red error lines from the missing (old) library.

This morning I decided to put an end to it and whipped up a small Ant task to regenerate a project's library definitions based on an Ant path object.

Now I have in my build.xml:

<target name="update-library">
  <taskdef resource="ideatasks" classpathref="path.ivy.libs"/>
  <idealibrary projectFile="mobilemail.ipr">
    <libraryPath name="ivy-dependencies" refid="path.ivy.libs"/>
  </idealibrary>
</target>

The task is a simple, quick hack - but it does the trick nicely.

binary - source - bazaar-ng repository

tags:          

links: digg this    del.icio.us    technorati    reddit




1. Jason Carreira left...
Monday, 19 June 2006 2:15 pm :: http://jroller.com/page/jcarreira

Does it update for the 3rd party library dependencies, so I could use it to update my IDEA project files' project libraries which point at my Ivy cache?


2. Philipp Meier left...
Monday, 21 August 2006 10:29 pm :: http://fnogol.de

Access on bazaar-ng repository is denied.