ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Smith" <>
Subject filterchain - apply to a subset of a filelist?
Date Sun, 02 Mar 2008 09:07:25 GMT
I already solved the problem, I'd like a code review, please.

build a set of files into one, removing a token from all but the first.

Each file has namespace('APE.anim') or  namespace(APE.anim")
(double or single quotes)

I need only one APE.namespace in the built file.

create a temp file,
add to the temp file all except the first file, deleting the offending
token from each file,
concat the first file with the temp file (as a result file),
delete the temp file.

This works, but it isn't very straightforward:

<!-- concat all dom-f.js files, EXCEPT the first (style-f.js).
 Remove the APE.namespace(APE.dom) from each file (except the first)
<concat destfile="${src}/dom/_dom.js">
	<filelist dir="${src}/dom"
		 files="viewport-f.js, position-f.js, classname-f.js,
traversal-f.js, Event.js"/>
			<replacestring from='APE.namespace("APE.dom");' to=""/>
			<replacestring from="APE.namespace('APE.dom');" to=""/>

<!-- Add back in style-f.js -->
<concat destfile="${src}/dom/dom.js">
	<filelist dir="${src}/dom" files="style-f.js, _dom.js"/>
<delete file="${src}/dom/_dom.js"/>

If there's a cleaner or more straightforward way to go about doing it,
I'd like to hear any advice.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message