Currently, I am utilizing YUI compressor within an ant build process to compress CSS and JavaScript files. I would like the compressor to display the name of each file it is processing as it goes along, so that in case of an error, I can easily pinpoint which file caused it. For example:
[echo] Minifying JS files...
[echo] Trying to minify file1.js...
[echo] Trying to minify file2.js....
Every solution I have come across only seems to show all filenames once the apply instruction has been executed on every file in the fileset.
This is how my current ant build script looks:
<target name="minifyJS" depends="overwriteCSSWithMinified">
<echo message="minifying js files and saving them to fileName-min.js" />
<apply executable="java" parallel="false" dest="${toWebHome}">
<fileset dir="${toWebHome}">
<exclude name="**/*.min.js" />
<include name="**/*.js"/>
</fileset>
<arg line="-jar"/>
<arg path="yuicompressor-2.4.7.jar" />
<arg line="-v"/>
<srcfile/>
<arg line="-o"/>
<mapper type="glob" from="*.js" to="*-min.js"/>
<targetfile/>
</apply>
</target>
Perhaps there is a different approach where instead of using a fileset, a loop can be implemented to process each file individually with the apply instruction?