
我不知道yuicompressor的工作方式,我假设它一次只能处理一个文件。
如果是这样,则可以使用ant-contrib中的for来实现。您需要先安装ant-contrib。
<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>欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)