Determine which file has an error when running YUI compressor from Ant Determine which file has an error when running YUI compressor from Ant jenkins jenkins

Determine which file has an error when running YUI compressor from Ant


I don't know how the yuicompressor works, I assume that it works on one file at a time.

If this is true, you can do it with for from ant-contrib. You would need to install ant-contrib prior.

<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${global.dir}/bin_data/ant-contrib-0.6.jar"/><for param="file">  <path>    <fileset dir="${global.dir}/" includes="**/*.js">      <exclude name="*.min.js" />    </fileset>  </path>  <sequential>    <echo>youcompressor for @{file}</echo> <!-- Will output each file and help debugging -->    <exec executable="yuicompressor"> <!-- I took the args from the official documentation-->      <arg value="--type=js" />      <arg value="-o" />      <arg value="'.js$:-min.js'" />      <arg value="@{file}" />    </exec>  </sequential></for>


Try using this option:

-v, --verbose Display informational messages and warnings.

There is a nice entry in the documentation for a cases like yours:

Don't hesitate to use the -v option. Although not a replacement for JSLint, it will output some helpful hints when it senses that something might be wrong with your code.


Did you try

<applyverbose="true">

Whether to print a summary after execution or not. Since Ant 1.6.

Ideally it would print a statement before attempting to execute on the file, but having a summary afterwards at least lets you see the last successful file, which should point you to the broken file as the filesets are usually alphanumerically sequenced.