1. Introduction
2. invictaProject
3. projectSettings
4. componentProject Definition Files are simple XML files inside which resides the definition of the project's settings, components, dependencies between components, products and properties. From them the information needed for the creation of the output is gathered.
The project definition needn't be in one XML file. Given the project's size, it is sometimes better to divide it into many small XML files; a list of the locations of these files (the names of the files or directories in which the reside) tells Invicta where to look for them.
The structure of such a file is as follows: a single projectSettings element (name, dir, project properties, etc.) and multiple components (referencing each other), all under an invictaProject root. To view the DTD defining the structure, click here.
The Project Definition File's root. It has no attributes, and contains the following elements:
- A single projectSettings
- Multiple components
The projectSettings element is the container of all project properties required according to the Types used in the project.
Attributes:
- name - the project's name.
- dir - the relative directory in which the project resides.
- version - the project's version.
- globalComponent - an optional attribute that allows specifying a name of a global component instead of implicitly creating one. A component with the specified name must be defined.
Elements:
As mentioned earlier, the projectSettings's children are the properties. A property element is a name-value couple. There can be many properties per project. Each component type used in the project requires certain properties to be set in the Project Defintion File.
property Attributes:
- name - the property's name.
- value - the value set to this property.
- description - a short description about the property.
A component is the instantiation of a type, which is the Invicta equivalent of a class. Together, components define the project's "ingredients".
Attributes:
- name - the component's name.
- dir - the directory consisting of the component's sources. This attribute is optional; the default is the component's name.
- type - the type of the component.
Elements:
- depend - usually components maintain a dependency relation between each other. for example, for one component's classes to be compiled, first another has to be compiled. Naturally, multiple depend elements are allowed under one component.
depend Attributes:
- name - the name of the component to depend upon. This attribute is required.
- export - whether to export this depend to components depending on the current component. The default value is false.
- products - a comma-separated list of product names in the dependent component on which to depend (a component may define more than one product, and you may wish to depend only on some of them).
- property - properties function as values of class members defined by the component's type. There may be many of them defined per component.
property Attributes:
- name - the property's name.
- value - the property's value.
- description - a short description about the property.
- product - a product is a file that is the outcome of the ANT build process using the generated build.xml. Each component ma define multiple products according to its type. For example, a component of the JAR type must define a jar product.
product Attributes:
- name - the product's name (optional)
- file - the name of the output file (optional).
- static - whether this product already exists and is not created by the build process. The default of this attribute is false.
- type - the type of the product from a given list. The default of this attribute is jar.
export - whether dependent components will get this product. The default of this property is true.
- depends - a comma-separated list of names of products in the same component on which the product depends (optional).
- appName - the application name of the product.
Simple project settings:
<projectSettings name="sample" dir="." version="1.0">
<property name="dist.dir" value="dist/sample"/>
<property name="dist.product.dir" value="lib"/>
<property name="local.env.dir" value="."/>
<property name="invicta.dir" value="/home/invicta"/>
</projectSettings>
A simple Libraries component with a few products with internal dependencies:
<component name="sample.lib" type="Libraries">
<product name="servlet" static="true"
file="/servlet/servlet.jar" type="jar"/>
<product name="loglib" static="true"
file="/loglib/LogLib.jar" type="jar"/>
<product name="commonlib" static="true"
file="/commonlib/CommonLib.jar" type="jar"/>
<product name="anotherlib" static="true" depends="commonlib"
file="/anotherlib/AnotherLib.jar" type="jar"/>
</component>
A simple component of a JAR type with a single product, single depend line and no properties:
<component name="sample.utils" type="JAR">
<product file="SampleUtils.jar" type="jar"/>
<depend name="sample.lib" products="loglib" export="false"/>
</component>
A simple component of a JAR type with a single product, 2 depend lines and a property:
<component name="sample.core" type="JAR">
<product file="SampleCore.jar" type="jar"/>
<depend name="sample.utils"/>
<depend name="sample.lib" products="anotherlib, loglib" export="true"/>
<property name="manifest.additional.classpath" value="ProjectIntegration.jar"/>
</component>
A component of a WAR type with 2 products (jar & war) and 2 depend lines:
<component name="sample.ui" type="WAR">
<product type="jar" file="SampleUI.jar"/>
<product type="war" file="SampleUI.war" appName="SampleUI"/>
<depend name="sample.lib" products="servlet"/>
<depend name="sample.core"/>
</component>