What are the best practices for naming ant targets?
For example, what would you expect the target "test" to run? All unit tests? All functional tests? Both?
What are the standard names used for running different types of tests (unit/functional/all)? Are there standards for target names to deploy software in J2SE? in J2EE?
My project uses ant for a java project with junit, Swing applications, and J2EE applications.
To show every target associated with a build. xml file, you need to run ant -p -v Also, ant -p build.
An Ant target is a sequence of tasks to be executed to perform a part (or whole) of the build process. Ant targets are defined by the user of Ant. Thus, what tasks an Ant target contains depends on what the user of Ant is trying to do in the build script.
Online documentation and books say that target is a stage of the entire build process, while task is the smallest unti of work.
See the "Naming Conventions" section on this page : The Elements of Ant Style
The following targets are common to many builds. Always avoid changing the behavior of a well-known target name. You do not need to implement all of these in a single project.
all Build and test everything; create a distribution, optionally install.
clean Delete all generated files and directories.
deploy Deploy the code, usually to a remote server.
dist Produce the distributables.
distclean Clean up the distribution files only.
docs Generate all documentation.
init Initialize the build: create directories, call <tstamp> and other common actions.
install Perform a local installation.
javadocs Generate the Javadoc pages.
printerdocs Generate printable documents.
test Run the unit tests.
uninstall Remove a local installation.
This page also provides other good guidelines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With