I am using closure compiler to minify javascript via the ant task. My build file is getting cluttered. Also, I am not minifying the javascript files in dev environment. Currently I am declaring the javascript files in two places. Once inside build.xml
in Closure Compiler Ant Task and the other inside FreeMarker template page for un-minified version. I want to move the declaration of javascript files into a comma separated values in a .properties
file. How can I configure Closure Compiler Ant Task so that it reads from a properties file ?
<target name="minimize-javascript" description="Create a minified version of the various JS scripts using Closure Compiler">
<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask">
<classpath refid="jars.classpath"/>
</taskdef>
<jscomp compilationLevel="simple"
debug="false" output="${web.dir}/resources/js/minimized.js">
<sources dir="${web.dir}/resources/js/src/deps/jquery/1.8.3/">
<file name="jquery-1.8.3.js"/>
</sources>
<sources dir="${web.dir}/resources/js/src/deps/jquery/ui/1.8.24">
<file name="jquery-ui.js"/>
<file name="jquery.ui.core.js"/>
<file name="jquery.ui.widget.js"/>
<file name="jquery.ui.tabs.js"/>
<file name="jquery.ui.sortable.js"/>
<file name="jquery.ui.selectable.js"/>
<file name="jquery.ui.resizable.js"/>
<file name="jquery.ui.position.js"/>
<file name="jquery.ui.mouse.js"/>
<file name="jquery.ui.droppable.js"/>
<file name="jquery.ui.draggable.js"/>
<file name="jquery.ui.dialog.js"/>
<file name="jquery.ui.button.js"/>
<file name="jquery.effects.core.js"/>
<file name="jquery.effects.drop.js"/>
</sources>
</jscomp>
</target>