Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2007

Tip: Looking for answers? Try searching our database.

copy multiple files in ant build file

Thread view: 
wong_powah@yahoo.ca - 17 Sep 2007 15:43 GMT
My ant build file is:
...
   <target name="mybin">
       <exec executable = "make" dir = "${build.dir}/mybin/src" >
       </exec>
       <copy file="${build.dir}/mybin/src/activateContainer" todir="$
{bin.dir}"/>
       <copy file="${build.dir}/mybin/src/assignContainer" todir="$
{bin.dir}"/>
       <copy file="${build.dir}/mybin/src/copyContainer" todir="$
{bin.dir}"/>
       <copy file="${build.dir}/mybin/src/createContainer" todir="$
{bin.dir}"/>
...
   </target>

Instead of listing each binary file one by one for copying, is there a
shorter way of copying them?
zzantozz@gmail.com - 17 Sep 2007 18:43 GMT
On Sep 17, 9:43 am, wong_po...@yahoo.ca wrote:
> My ant build file is:
> ...
[quoted text clipped - 14 lines]
> Instead of listing each binary file one by one for copying, is there a
> shorter way of copying them?

Take a look at Ant's copy task and fileset type. In particular, here's
an example of using fileset with copy to copy several files without
listing them individually:
<copy todir="../dest/dir">
 <fileset dir="src_dir">
   <exclude name="**/*.java"/>
 </fileset>
</copy>

See: <http://ant.apache.org/manual/CoreTasks/copy.html>
and: <http://ant.apache.org/manual/CoreTypes/fileset.html>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.