

The main purpose of extension-points is to execute the targets in its dependency list to bring the build process to the desired state.Ģ. Extension-points are executed from the command-line. Extension-PointsĮxtension-Points are targets without tasks. Ant only executes a target once within a dependency chain so the targets are executed once and in the expected order. Fortunately when evaluating the order of targets to be executed, the depends attribute of the buildJar target depends on manifest, which depends on compile, which in turn depends on clean, which depends on init. jar file first, and perform the initialization task last). If the buildJar target is executed from the depends attribute the expected order of target execution might be: manifest –> compile –> clean –> init before executing the buildJar target, which is exactly backwards from the desired order (since it makes no sense to build the. A powerful feature of targets is the depends attribute used to ensure targets are executed in the desired order.įor example, given the following targets: Target elements are user defined containers of tasks used to bring the build process to a known state. If you use it in the implicit target (directly under the tag) the list will be empty if no target has been specified while it will contain the project’s default target in this case for tasks nested into targets. This property is set properly when the first target is executed. The name of the currently executing project’s default target it is set via the default attribute of Ī comma separated list of the targets that have been specified on the command line (the IDE, an task …) when invoking the current project. The version of Ant the name of the project that is currently executing it is set in the name attribute of

The absolute path of the project’s basedir (as set with the basedir attribute of ). To retrieve the value associated with a particular property surround the property name with $ would expand to barĪnt provides a number of built in properties (taken from User Manual): basedir The most popular syntax for defining a element takes one of these forms: There is no limit to the number of elements that can be defined. They are tasks which do not need to be enclosed within a element.

Properties simply associate names with values. However, they can be used throughout the project. Properties can be thought of as global constants that are immutable. See Ant User Manual ( ) –> Table of Contents –> Ant Tasks –> Overview of Apache Ant Tasks. The Apache Ant User manual provides tables for each of the above categories showing the task name, a brief synopsis of what the task does and a link to the complete documentation. The predefined tasks can be broken down into the following categories: Archive Tasks Ant comes with over 150 predefined tasks.
