3

I have about 50-60 js files and there are dependencies among them so I need to maintain an order while cocatenating. Writing all the names in "files" attribute would make the build.xml messy and any addition of js files in future would need to added accordingly. So, I wanted to write the order in a separate txt file and just copy the contents using Ant following that order. Is it possible ?

2 Answers 2

1

You can do what you want using a resourcelist, for example:

<concat destfile="concatenated.js">
    <resourcelist>
        <file file="js.files.txt"/>
        <filterchain>
            <striplinecomments>
                <comment value="#"/>
            </striplinecomments>
        </filterchain>
    </resourcelist>
</concat>

The filterchain isn't required, but is useful as you can then include comment lines in your list-of-files.

Sign up to request clarification or add additional context in comments.

Comments

0

You can use order independent declarations like these:

// in every file
if(!("myLib" in window))myLib = {};
if(!("canvas" in myLib))myLib.canvas = { .... };

//next file
if(!("myLib" in window))myLib = {};
myLib = $.extend(myLib, true, {
   init: function(){},
   move: function(){}
});
//in index
myLib.init();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.