Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Apache Ant/Best Practices/Standard Targets

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Standard Targets One of the things that you learn is that if you name things consistently between projects, it is much easier to find things you are looking for. When you work with other people, you also want to have targets that you both are familiar with. build.xml Place your main build in a file called build.xml in the main directory of your project. Do not put references to local file systems (Windows C:\ etc.) in your build file. Isolate these all in a local.properties file in the main directory. Folder standards src - the location of your source code build - the output of a build process Standard ant targets init This target should create all temporary directories within the build folder. clean This target should remove all compiled and intermediate files leaving only source files. It should remove anything that can be derived from other files. This would be run just prior to creating a zip file of the project, and in case of gremlins occurring during the build process. build This target should compile sources and perform transforms of raw data. install The install target should be used to copy files to a testing or production system. Other Standards Use the <description> element to describe what your target does. If you have more than around 100 targets in your build file, it becomes unwieldy. You could consider calling a separate build file, but that adds other complications such as the dependency between targets.