Generated ANT build script usage

1.  ANT Targets
2.  Standard Targets
3.  Built-In Special Targets
4.  Customizing Properties

1. ANT Targets

Invicta generates a standard build.xml file on which ANT can run (see ANT documentation for more information).  The file is built in a way such that the first step performed is the invocation of Invicta, which checks whether its running again is necessary in order to recreate the build.xml (because of configuration changes, for example).

To see a list of available targets, use ant -projecthelp.  The targets appear as 'methods' of component 'classes'.  For example, a JAR component named mycomp in the project myproj would have the target myproj.mycomp1.compile.

Of course, in case a component was defined as dependent of another component, the ANT targets are defined with the required dependency, meaning the required component will be compiled first.  In addition, there can also be a dependency between two targets of the same component; for example: pack depends on compile, meaning in order for packing to run, compilation must first be completed.

Return to top

2. Standard Targets 

Every component has a few targets by default.  The following list describes the actions that are performed for each target.  Note: the names are a standard; it's not obligatory to perform the actions listed in the corresponding target.

For example, running the following command will compile files associated with component mycomp1 of the myproj project.

     ant myproj.mycomp1.compile    

Return to top


3. Built-In Special Targets

The generated build.xml contains a few targets that are for the project-scope.

<project_name>.dist.all - activate the dist target of all components in order to distribute the whole project.

<project_name>.build.all - activate the build target of all components in order to build the whole project.

<project_name>.clean.all - activate the clean target of all components.

Return to top


4. Customizing Properties

All settings, such as compilation flags, names, deployment settings and more, are stored as ANT properties that can be customized in ANT run-time.  Customization can be done in one of two ways:

  1. Using the standard -D<propertyName>=<propertyValue> syntax of ANT.  
    For example, to change the value of property prop1 to val1 while invoking target tar1, run
        ant tar1 -Dprop1=val1.

  2. Editing the file. This is a standard properties file of ANT, which contains multiple property definitions. Using this file instead of '-D' is better when you want to customize multiple properties. Each line has the syntax <propertyName>=<propertyValue>.
    For example, to change the value of property prop1 to val1 while invoking target tar1, add the line:
    You may override the default file name using the property

Properties' names are a combination of a prefix and the name of the property or the type.  The prefix can be general, project or a component's full name.

There are two levels of customization: Project/General affects all components, whereas component-specific affects only one component. Some example:

-Dgeneral.compile.debug=false     - disables the debug compilation mode of all the components.

-Dmyproj.comp1.compile.debug=true - enables the debug compilation mode of comp1 only.


    # Set the URL of an application server to used by the whole project:

    # Set the vendor name of the products of all components: 

    # Set the vendor name of the products of comp1 only.

Return to top