ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: loading ant macros from external files
Date Wed, 01 Jul 2009 05:35:14 GMT
>>> I have a bunch of ANT macros which are currently used by 1 
>project only.
>>> In the future they should be used by more projects.
>>> So I'd like to put them in a separate ANT script and load 
>this at runtime into the
>>> project ANT scripts.
>>> Has anyone an idea how to manage this?
>> <import> works great. Not sure what Francis' issue with it 
>where :) --DD
>An alternative is to use an antlib and a typedef task to load the
>macros, have a look at the following

While <import> is easier to use, I think the antlib way scales better:
- better version control
- ability to add multiple files (like xsl, configs)
- not only macros, native java tasks are possible (better configuration
of the tasks is possible)
- in combination with Ivy you could download 'your' version from a repo
  <project xmlns:my="antlib:my" xmlns:ivy="antlib:org.apache.ivy.ant">
    <taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpath="path-to-ivy"/>
    <ivy:cachepath organisation="myOrga" module="commonBuild"
                   inline="true" conf="default"
pathid="buildfile.classpath" transitive="true"/>
    <taskdef uri="antlib:my" resource="..."


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message