How do I use a file?
Author: Deron Eriksson
Description: This tutorial describes how to use an Ant file.
Tutorial created using: Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 1.5.1

Page: < 1 2

(Continued from page 1)

The file used in this tutorial is shown below. I originally created the project-name, builder, ftp-server, ftp-userid, and ftp-password properties and placed them in my build.xml file. I removed these properties from build.xml and put them in My build.xml file contains a property pointing to the file, and the file contains the names and values of the 5 aforementioned properties. file

I can execute the 'all' target by double-clicking the tomcat-demo project's 'all' target in the AntSW view in EclipseSW.

executing 'all' target in Ant View

The execution of the 'all' target is shown in Eclipse's console.

execution of 'all' target in Console

As you can see, files are very easy to use. They offer a convenient way of extracting out properties from your build.xml files. This can be useful for things such as creating build.xml files that can be run for different projects or different environments, where the differences are contained in different versions of the files that utilize the same build.xml file.

Page: < 1 2