Programming and writing about it.

echo $RANDOM

Category: Ant

Quick tip: ‘copy’ task with Ant

Say, you need to copy a bunch of files from one location to another in your project structure after the JAR building is over. Add these lines to your ‘build.xml’ file: “


*copy todir="dist"#
*fileset dir="."#
*include name="*.sh"#
*/include#
*/fileset#
*/copy#
*/target#

Please replace ‘*’ with ”

If you know how to insert XML properly in blogger, please let me know!

Advertisement

Exploring the Ant build script in NetBeans

After importing my manually coded build.xml into NetBeans, I opened it to view it in the wonderful XML editor:


Looking towards the left bottom, i notice the XML view of the build script:


You may also run any of the Ant targets by a Right-click->Run Target:

Cool!