Use apply for fileset in build.xml for example
<?xml version="1.0" encoding="UTF-8"?> <project default="build"> <fileset id="myfiles" dir="${basedir}"> <include name="**/*.java"/> <exclude name="**/Resources/**"/> <modified> <param name="cache.cachefile" value="${basedir}/cache.${project}.fileset.myfiles.properties"/> </modified> </fileset> <target name="execute-some-command"> <apply executable="javac" dir="${basedir}" failonerror="true"> <fileset refid="myfiles"/> </apply> </target> </project>
By default, the command will be executed once for each file.
If you need to use parallel to run the command only once, use maxparallel to limit the amount of parallelism by transferring at most this many source files at once (for example, set to 1000 to transfer thousands of files in one pass). For instance:
<apply executable="javac" parallel="true" maxparallel="1000" dir="${basedir}"> <fileset refid="myfiles"/> </apply>
To find out how many files you have, check the contents of the cache file (see cache.cachefile in the example above).
source share