I want to use ant
for js
and css
minification at time of building the project. Please find below directory structure of my project:
Here, scripts directory has multiple directories.
I want to exclude directory named "Libraries" in scripts dirctory from ant
task.
The dirctories other than "Libraries" has js
files. And I want to include these js
files in ant
minification task.
Please find below my build.xml
:
<project name="ITV" default="doMinification">
<property name="webroot.dir" value="webapp/" />
<target name="doMinification" depends="minifyjs" />
<tstamp>
<format property="TODAY_MY" pattern="yyyyMMdd-HHmmss" locale="en,UK" />
</tstamp>
<!-- Minify JS -->
<target name="minifyjs">
<apply executable="java" parallel="false" dest="webapp/scripts/" verbose="true">
<fileset id="jsFiles" dir="webapp/scripts/">
<exclude name="webapp/scripts/Libraries/" />
<include name="**/*.js"/>
</fileset>
<arg line="-jar"/>
<arg path="yuicompressor-2.4.7.jar"/>
<srcfile/>
<arg line="-o"/>
<mapper type="glob" from="**/*.js" to="*-min-${TODAY_MY}.js" />
<targetfile/>
</apply>
</target>
</project>
How to exclude a specific directory and include other directories with its files in ant
javascript minification task ?