loading ant macros from external files

View: New views
7 Messages — Rating Filter:   Alert me  

loading ant macros from external files

by Sascha Ernst :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

by Francis Galiegue-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jun 30, 2009 at 15:46, Sascha Ernst<sascha.ernst@...> 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@...
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: loading ant macros from external files

by ddevienne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jun 30, 2009 at 8:46 AM, Sascha Ernst<sascha.ernst@...> 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@...
For additional commands, e-mail: user-help@...


Re: loading ant macros from external files

by Rod Mackenzie-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/6/30 Dominique Devienne <ddevienne@...>:
> On Tue, Jun 30, 2009 at 8:46 AM, Sascha Ernst<sascha.ernst@...> 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@...
For additional commands, e-mail: user-help@...


AW: loading ant macros from external files

by Jan.Materne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>>> 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@...
For additional commands, e-mail: user-help@...


AW: loading ant macros from external files

by Sascha Ernst :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...]
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<sascha.ernst@...> 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@...
For additional commands, e-mail: user-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


AW: loading ant macros from external files

by Sascha Ernst :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I use <import> an everything works fine.

Thanks to all of you ...

///sascha///

-----Ursprüngliche Nachricht-----
Von: Sascha Ernst [mailto:sascha.ernst@...]
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@...]
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<sascha.ernst@...> 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@...
For additional commands, e-mail: user-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...