ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Peck <AdamP...@smarttech.com>
Subject RE: Include Macros Defined in a Single Directory
Date Mon, 22 Feb 2010 15:12:28 GMT
If it does not support fileset that means you are using a version earlier than 1.8.0. If you
use ant-contrib you can do this:

<for param="import.file">
	<path>
		<fileset dir="macrosDirectory" includes="**/*.xml" />
	</path>
	<sequential>
		<import file="@{import.file}" />
	</sequential>
</for>

-Adam

-----Original Message-----
From: James Kennard [mailto:james@webamoeba.co.uk] 
Sent: Sunday, February 21, 2010 4:11 AM
To: Ant Users List
Subject: Re: Include Macros Defined in a Single Directory

Hi Matt thanks for the suggestion.

Unfortunately import does not appear to support the <fileset> type. When 
running this I get the following error: "import doesn't support the 
nested fileset element". I had another hunt around the internet and 
found a solution (have yet to try it but it looks like it should work). 
For anyone who is interested take a look at Question 17 at 
http://wiki.apache.org/ant/AntNewbies

james.

Matt Benson wrote:
> Ant 1.8.0 shipped with the ability to nest any resourcecollection into 
> your import task:
>
> <import>
>   <fileset dir="macrosDirectory" />
> </import>
>
> Should work for you.
>
> -Matt
>
> On Feb 19, 2010, at 5:52 PM, James Kennard wrote:
>
>> Hi,
>>
>> I have been defining macros in individual files and as a result every 
>> time I add a new macro I am adding an import to a "import all macros" 
>> type file. Because I store all the macros in one directory, is it 
>> possible to import all the files located in this directory without 
>> the need to maintain a "import all macros" type file?
>>
>> I appreciate there are some good reasons not to always import all the 
>> macros, but I am only looking at doing this for relatively simple 
>> build scripts (Canoo WebTests to be precise).
>>
>> thanks :)
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
> ---
> avast! Antivirus: Inbound message clean.
> Virus Database (VPS): 100220-1, 20/02/2010
> Tested on: 21/02/2010 10:31:42
> avast! - copyright (c) 1988-2010 ALWIL Software.
> http://www.avast.com
>
>
>
>


---------------------------------------------------------------------
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


Mime
View raw message