Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the best practices for naming ant targets?

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.

like image 738
Alex B Avatar asked Dec 04 '08 21:12

Alex B


People also ask

How do I list all ant targets?

To show every target associated with a build. xml file, you need to run ant -p -v Also, ant -p build.

What are targets in ant?

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.

What is the difference between task and target?

Online documentation and books say that target is a stage of the entire build process, while task is the smallest unti of work.


1 Answers

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.

like image 121
david Avatar answered Oct 21 '22 08:10

david