1

I'm new to ANT Scripting. I need the ANT Script to achieve the below functionality.

C:\dojo-release-1.4.2-shrinksafe>java -jar shrinksafe.jar  C:\Build\JS\*.js  >  testMin.js

Above command merges all JS files in that folder to a single one.

<java jar="shrinksafe.jar" fork="true" output="testMin.js">
    <arg value="*C:\Build\JS\*.js"/>
    <classpath>
        <pathelement location="js.jar"/>
    </classpath>
</java>

I'm not sure if this is the correct implementation of this. I'm getting the error

js: Couldn't open file "C:\Build\JS\*.js"

Can someone please help me to fix this?

1 Answer 1

1

The asterisk in "*.js" is sent literally to the Java class and not expanded as it might have been when entered on the command line.

I suggest you join the files first using the concat task and then run shrinksafe on the resulting file.

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

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.