ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Mawson <jeremy.maw...@qsipayments.com>
Subject Re: CopyDir: Request for additional parameter
Date Thu, 01 Jan 1970 00:00:00 GMT
There is a third (useful) option that is not catered for in core Ant.

If the copydir includes parameter ends in "/" (ie "/**") then the user may
intend to flatten the target's path to the left of the target include path,
but to retain the structure of subdirectories.

Eg.

if includes="3/**"

Then the files:
${SRC}/1/2/3/4a/file00A
${SRC}/1/2/3/4b/file00B

Will copy to:

${DEST}/3/4a/file00A
${DEST}/3/4b/file00B

Currently, these same files would copy to:

either [flatten="no"]
${DEST}/1/2/3/4a/file00A
${DEST}/1/2/3/4b/file00B

or [flatten="yes"]
${DEST}/file00A
${DEST}/file00B

Any feedback?



At 11:00 24/08/00, you wrote:
>Oh
>
>I see that this feature has been added recently.
>
>Nevermind.
>
>Jem
>
>At 10:29 24/08/00, you wrote:
>>Currently if you use copydir task in this fashion:
>>
>><copydir
>>    src="${SRC_DIR}"
>>    dest="${DEST_DIR}"
>>    includes="**/html/" />
>>
>>
>>All files in the HTML directories are copied with their relative paths.
>>Fair enough.
>>
>>What I would really like to see is an additional option (a y/n param) to
>>ascertain whether the files under the html directories should be copied to
>>${DEST_DIR} precisely (ie not into subdirectories of ${DEST_DIR}).
>>
>>Perhaps something like:
>>
>><copydir src="x" dest="y" relative="yes" /> would copy
>>
>>  x
>>  |
>>  +--001
>>     |
>>     +--002
>>     |  |
>>     |  +--file002
>>     |
>>     +--file001
>>
>>to 
>>
>>  y
>>  |
>>  +--001
>>     |
>>     +--002
>>     |  |
>>     |  +--file002
>>     |
>>     +--file001
>>
>>
>>but <copydir src="x" dest="y" relative="no" /> would copy
>>
>>  x
>>  |
>>  +--001
>>     |
>>     +--002
>>     |  |
>>     |  +--file002
>>     |
>>     +--file001
>>
>>to 
>>
>>  y
>>  |
>>  +--file001
>>  +--file002
>>
>>
>>What's the thinking out there?
>>
>>Jem
>>
>

Mime
View raw message