【发布时间】:2012-08-01 13:21:34
【问题描述】:
我目前有这个命令:
copy /b *.txt newfile.txt
但我也想包含所有带有文件夹的文件。
我该怎么做?是否也可以将其添加到 Apache Ant 中? 我也考虑这样做来缩小 JS 文件。
我正在使用 windows 并且想要一个命令来运行或批处理文件但有问题。
还有什么要删除的行吗? 有没有比我目前使用的命令更好的命令?
更新:
<target name="concatenate" description="Concatenate all js files">
<concat destfile="build/application.js">
<fileset dir="js" includes="*.js" />
</concat>
</target>
<target name="compress" depends="concatenate" description="Compress application.js to application-min.js">
<apply executable="java" parallel="false">
<filelist dir="build" files="application.js" />
<arg line="-jar" />
<arg path="C:\yuicompressor-2.4.7\build\yuicompressor-2.4.7.jar" />
<srcfile />
<arg line="-o" />
<mapper type="glob" from="*.js" to="build/*-min.js" />
<targetfile />
</apply>
现在我正在使用上面的代码,但不能让它在文件夹中包含文件
【问题讨论】:
-
谢谢请看更新
-
includes="**/*.js"**/部分是包含子文件夹的蚂蚁方式
标签: file ant command-line batch-file concatenation