riedquat - valueable resource for those who seek.
Home Blog Technical Reports Art Articles RapiDocs Coding Links Reviews Projects: CherBot Daimonin Gridarta

Ant Destillate

Basics

Ant Fundamental Terms

Project
  • The document element of a build.xml describes a project.
  • A project consists of one ore more targets.
  • There's a default target.
Target
  • A target is a target in the build process, e.g. compile all sources.
  • A target has a name.
  • A target can depend on other targets that must be reached before the execution of this target.
  • A target contains any amount of tasks.
Task
  • A task is a command unit of Ant.
  • File based tasks often use filesets and this way process several files at once.
  • Most file based tasks use source files and create destination files.
  • Most file based tasks only create those destination files that aren't up to date by differing the time stamp between the source files and the destination files.

Installation of Ant and Libraries

Invocation of Ant

Simple Invokation
ant (executes default target)
Invoke a specific target
ant target1 target2 (executes target1 and target2)
Print information about the build.xml used
ant -projecthelp

build.xml

Examples

Compilation of Java Sources

Create Documentation

Validate XML Files

When using document type definitions with external referenced entities from the Web it is recommended to create local copies of the external subset and all required files and use an XML Catalog:

Transformation using XSLT

Execute and Document Unit Tests with JUnit

The test classes are compiled with the normal classes. The names of the test classes end on "Test" (XYZText.java / XYZText.class).

Initialisation and Clean-Up of a Project and Updating Sandbox using CVS

These targets are well suited as depends entries at other targets.

show
 . 
..: