You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Sascha Ernst <sa...@living-e.com> on 2009/06/30 15:46:12 UTC
loading ant macros from external files
Hello,
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?
In the ANT manual I only found possibilities to load properties from external files
but not macros.
Best regards
///Sascha Ernst///
Re: loading ant macros from external files
Posted by Francis GALIEGUE <fg...@one2team.com>.
On Tue, Jun 30, 2009 at 15:46, Sascha Ernst<sa...@living-e.com> wrote:
> Hello,
>
> 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?
>
> In the ANT manual I only found possibilities to load properties from external files
> but not macros.
>
> Best regards
>
The only one solution I know of is to use XML entities and load a
system entity. I've done this in the past already...
Ant has an <import> task, but it's never cut it out for me. That was
with ant pre 1.6.5, I don't know whether the situation is any better
with more recent versions since I don't use this kind of mechanism
anymore.
--
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: loading ant macros from external files
Posted by Sascha Ernst <sa...@living-e.com>.
Hello,
I use <import> an everything works fine.
Thanks to all of you ...
///sascha///
-----Ursprüngliche Nachricht-----
Von: Sascha Ernst [mailto:sascha.ernst@living-e.com]
Gesendet: Mittwoch, 1. Juli 2009 11:12
An: Ant Users List
Betreff: AW: loading ant macros from external files
Hello,
thanks for the hint.
I was just to blind to see.
I'll give it a try...
Bye
///sascha///
-----Ursprüngliche Nachricht-----
Von: Dominique Devienne [mailto:ddevienne@gmail.com]
Gesendet: Dienstag, 30. Juni 2009 15:52
An: Ant Users List
Betreff: Re: loading ant macros from external files
On Tue, Jun 30, 2009 at 8:46 AM, Sascha Ernst<sa...@living-e.com> wrote:
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: loading ant macros from external files
Posted by Sascha Ernst <sa...@living-e.com>.
Hello,
thanks for the hint.
I was just to blind to see.
I'll give it a try...
Bye
///sascha///
-----Ursprüngliche Nachricht-----
Von: Dominique Devienne [mailto:ddevienne@gmail.com]
Gesendet: Dienstag, 30. Juni 2009 15:52
An: Ant Users List
Betreff: Re: loading ant macros from external files
On Tue, Jun 30, 2009 at 8:46 AM, Sascha Ernst<sa...@living-e.com> wrote:
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: loading ant macros from external files
Posted by Ja...@rzf.fin-nrw.de.
>>> 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
>http://ant.apache.org/manual/CoreTypes/antlib.html
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"
revision="4.3"
inline="true" conf="default"
pathid="buildfile.classpath" transitive="true"/>
<taskdef uri="antlib:my" resource="..."
classpathref="buildfile.classpath"/>
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: loading ant macros from external files
Posted by Rod Mackenzie <ro...@googlemail.com>.
2009/6/30 Dominique Devienne <dd...@gmail.com>:
> On Tue, Jun 30, 2009 at 8:46 AM, Sascha Ernst<sa...@living-e.com> wrote:
>> 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
http://ant.apache.org/manual/CoreTypes/antlib.html
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: loading ant macros from external files
Posted by Dominique Devienne <dd...@gmail.com>.
On Tue, Jun 30, 2009 at 8:46 AM, Sascha Ernst<sa...@living-e.com> wrote:
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org