Reputation: 14719
So I'm using Yuicompressor to minify my javascripts/css on my ant script. This process takes a long time for my project. I'm wondering if there is any way to make it only execute on files that were modified.
<for param="file">
<path>
<fileset dir="${folder}">
<include name="*.js" />
<include name="*.css" />
</fileset>
</path>
<sequential>
<var name="file" value="@{file}"/>
<echo message="Minifying ${file}" />
<java jar="yuicompressor.jar" fork="true">
<arg value="${file}" />
<arg value="-o" />
<arg value="${outfile}" />
</java>
</sequential>
</for>
Also I'm doing some very hacky stuff to generate ${outfile} (using lots of propertyregex tags). I would like to place all my minified files in a min folder in a more elegant way. For example:
folder/source.js
goes to
min/folder/source.js
and
folder/subfolder/source.js
goes to
min/folder/subfolder/source.js
Upvotes: 1
Views: 81
Reputation: 45576
I see that you are already using antcontrib task in your script.
Because of this take a look at OutOfDate
task from the same library -> http://ant-contrib.sourceforge.net/tasks/tasks/outofdate.html
I think it will help you achieve what you are looking for.
Upvotes: 1