![]() ![]() 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. (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. You may want to qualify (add a prefix to) your target names to avoid ambiguity if you do that. And then you can call the ant targets in that file. This attribute specifies which target should be considered as the default. You can also have import tags: .A project may contain any number of targets. 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. ![]()
0 Comments
Leave a Reply. |