I already solved the problem, I'd like a code review, please.

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

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

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

Solution:
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"/>
        <filterchain>
                <tokenfilter>
                        <replacestring from='APE.namespace("APE.dom");' to=""/>
                        <replacestring from="APE.namespace('APE.dom');" to=""/>
                </tokenfilter>
        </filterchain>
</concat>

<!-- Add back in style-f.js -->
<concat destfile="${src}/dom/dom.js">
        <filelist dir="${src}/dom" files="style-f.js, _dom.js"/>
</concat>
<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.

Thanks,

Garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to