Recent Pos

Ant build.xml File And Properties File

ant build xml commands configuration
⇒ The build.xml file is a configuration file for Ant engine to work. There is several tags and attributes are available for configurations. Few of them are described below:

Example:

⇒ Sometimes we need to frequently change directory paths and file names in the build.xml file, so in that case we need to change directory paths and file names in build.xml file wherever we are using.

⇒ If we forget to change directory path and file name in any one of the place in build.xml file then build will be failed.

⇒ To avoid these problems we need to define properties for the frequently used files names and directory paths using <property> tag.

Syntax:

⇒ If we want to use property names in the build.xml file then we need to expression language (${}).

ANT build.xml file using Property file:
⇒ Instead of defining properties in build.xml file directly we should define all the properties in separate file called “build.properties”.
⇒ We can define any name for the properties file, but we should define meaningful name, and we need to store this “build.properties” file inside where our build.xml file is exists.
⇒ If we are using properties file to define the ANT build prperties then we need to specify properties file name and path in build.xml file using tag.
Syntax:

build.properties file:
classes.dir=build/classes

<-Previous: Ant Introduction | | Next->Working with Ant using IDE

0
0