我现在有这个命令:合并文件 - 包括文件夹中的文件
copy /b *.txt newfile.txt
但我想包括与文件夹中所有的文件。
我该怎么做?是否有可能将此添加到Apache Ant? 我也考虑这样做来缩小JS文件。
即时通讯使用Windows,并希望命令运行或批处理文件,但有问题。
反正也有删除行吗? 有没有比我目前使用的更好的命令?
UPDATE:
<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>
我现在用上面的代码,但不能得到它包含的文件夹
[蚂蚁的concat将做级联的工作](https://ant.apache.org/manual/Tasks/concat.html) – oers 2012-08-01 13:25:23
谢谢请参阅更新 – LmC 2012-08-01 13:30:31
'includes =“**/*。js”'** /'部分是包含子文件夹的蚂蚁方式 – oers 2012-08-01 13:31:52