zoqaomaha.blogg.se

Apache ant tutorial
Apache ant tutorial






apache ant tutorial

  • Ease of Use – The tool provides a wide range of tasks that almost fulfils all the build requirements of the user.
  • Both will work,because info is the default target in the build file. To run the ant build file, open up command prompt and navigate to the folder, where the build.xml resides, and then type ant info. In our example,it prints the message Hello World. The echo task in the above example is a trivial task that prints a message. An Extension Point is similar to a target, but it does not have any tasks. (optional)Īdds the target to the dependency list of the specified Extension Point. (optional)Īllows the execution of a target based on the trueness of a conditional attribute. (Optional)Ī short description of the target. The target element has the following attributes − Sr.NoĬomma separated list of all targets that this target depends on. Dependencies are denoted using the depends attribute. For example, a deploy target may have a dependency on the package target, the package target may have a dependency on the compile target and so forth. Targets can have dependencies on other targets. In our example, we have a simple target to provide an informational message to the user.

    apache ant tutorial

    (Optional)Ī target is a collection of tasks that you want to run as one unit. The base directory (or) the root folder for the project. This attribute specifies which target should be considered as the default. A project may contain any number of targets.

    apache ant tutorial

    The XML element project has three attributes which are as follows − Sr.No The processing instruction target matching "" is not allowed.Īll build files require the project element and at least one target element. If you allow them, the following error message occurs while executing the ant build − Note that there should be no blank line(s) or whitespace(s) before the xml declaration. You are free to use other file names or save the build file in some other location.įor this exercise, create a file called build.xml anywhere in your computer with the following contents − However, there is no restriction on the file name or its location. Typically, Ant's build file, called build.xml should reside in the base directory of the project.








    Apache ant tutorial