ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Turkenkopf <dturk...@gmail.com>
Subject Re: Defining Properties in an Antlib
Date Sat, 07 Nov 2009 14:29:25 GMT
Thanks for the help,

I decided to use the init macro rather than bringing in another dependency
and it seems to work well.

-- Dan

On Fri, Nov 6, 2009 at 7:26 AM, Wascally Wabbit <
wascallywabbit@earthling.net> wrote:

> Dan Turkenkopf wrote:
>
>> Is there anyway to define a single set of properties that can be shared
>> across all macrodefs in a given antlib?
>>
>> I have a series of macros that all refer to the same jar files.   I'd like
>> to be able to define the locations in a single property within the antlib
>> (because the callers don't need to know the details).
>>
>> Right now, because Property doesn't extend AntlibDefinition, I can't
>> declare
>> a property outside of a macrodef.  So I'm stuck declaring the same
>> property
>> within each of the macrodefs.
>>
>> Is there a better way to accomplish the goal of DRY?
>>
>> Thanks,
>>
>> Dan Turkenkopf
>>
>>
> The init macro another user recommended is one way to do this; an
> alternative is to use AntXtras (3rd party extension) and use the <doinline>
> component like:
>
> <antlib....>
>  <doinline>
>    <property name="1st" value="v1"/>
>    <property name="2nd" value="v2"/>
>    ...
>  </doinline>
> </antlib>
>
> The difference? You won't need to do the explicit "init" call. Note that if
> you've installed AntXtras in its own namespace you'd need to account for
> that in the example shown above.
>
> -The Wabbit
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message