Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help - Ant script for copying specific files

807603Dec 18 2007 — edited Dec 19 2007
I need to copy only specific files using ant script. The number of files might vary and I want to configure this in the properties file.
For example, the following code copies all *.java files in ${src.dir}
<project default="compile">
	<target name="compile">
		<copy todir="c:\temp\output">
                               <fileset dir="${src.dir}" includes="*.java" />
                    </copy>
	</target>
</project>
However, if I want only 3 files lets say A.java, B.java and C.java, I can not do that. I can ofcoure hard code those 3 filenames, but the number and filenames might change every time.
Is there some way so that I can pass the file names as parameters (or read from properties file) dynamically?
Any help in this regard is appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2008
Added on Dec 18 2007
2 comments
211 views