I'm not really familiar with Ant and i wonder how to print the name of the current processed file to the commandline.
This is what i have so far... It's a part of a macro which minifys files with the yui-compressor.
<apply executable="java" parallel="false" verbose="true" dest="@{target}">
<fileset dir="@{src}">
<include name="**/*.@{filetype}"/>
</fileset>
<arg line="-jar" />
<arg path="${yui.jar}" />
<arg value="--charset" />
<arg value="ANSI" />
<arg value="-o" />
<targetfile />
<mapper type="glob" from="*.@{filetype}" to="*.min.@{filetype}" />
</apply>
What i'm trying to get:
[echo] Start!
[apply] Processed: filename-1.min.js
[apply] Processed: filename-2.min.js
[apply] Processed: filename-3.min.js
[echo] Success!
I don't have a lot of experience with apply but you could try defining your fileset out of the apply element , getting your printed results and then referring to it into your apply element.
<fileset dir="@{src}" id="my.files">
<include name="**/*.@{filetype}"/>
</fileset>
<pathconvert pathsep="${line.separator}" property="processed.files" refid="my.files"/>
<echo>Start!</echo>
<echo message="${processed.files}"/>
<apply executable="java" parallel="false" verbose="true" dest="@{target}">
<fileset refid="my.files"/>
<arg line="-jar" />
<arg path="${yui.jar}" />
<arg value="--charset" />
<arg value="ANSI" />
<arg value="-o" />
<targetfile />
<mapper type="glob" from="*.@{filetype}" to="*.min.@{filetype}" />
</apply>
<echo>Success!</echo>
Of course this will only work if the apply executable doesn't print anything to clutter the output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With