Dear All,
I need to compress and merge multiple JavaScript files (in a particular folder) to a single file using Shrinksafe. I'm able to merge the files to a single one using the below command.
java -jar shrinksafe.jar *.js > testMin.js
The problem with this is that, it does not put all the script in a single line. It just removes the comments.
Also I need to achieve the same task using ant build script.
I tried the below approach
I'm not sure if I can achieve my requirement using the above script. The is the dojo profile that I'm using.Code:<target name="compress-js"> <echo message="Starting JS compress Build"/> <java fork="true" dir="${shrinksafe.util.path}/buildscripts" classname="org.mozilla.javascript.tools.shell.Main"> <arg value="build.js"/> <arg line="releaseDir=../../../../../../StaticFiles/acb profile=acb_js action=clean,release *.js > acb.js" /> <classpath> <pathelement location="${shrinksafe.util.path}/shrinksafe/js.jar"/> <pathelement location="${shrinksafe.util.path}/shrinksafe/shrinksafe.jar"/> <pathelement path="${java.class.path}"/> </classpath> </java> <echo message="js build successfull." /> </target>
My JavaScript files are inside `StaticFiles/acb/homepage` folder.Code://Below code is from acb-js.profile.js file. dependencies = { layers: [ { name: "../gp-js.js", resourceName:"gp-js", dependencies: [ ] } ], prefixes: [ ["scripts", "../../StaticFiles/acb/homepage"] ] };
Please help me.Thanks in advance. Any help will be greatly appreciated.


Reply With Quote

Bookmarks