parameter task
Description
parameter tasks is used to :
- document properties / paths / phases
- check if properties /paths / phases are required
- set default values if properties are not set
Arguments
| Parameter name | Description | Mandatory |
|---|---|---|
| path | specify the path id to check | One of these |
| phase | specify the phase id to check | |
| property | give a description to the property / path / phase | |
| description | specify the path id to check | true |
| required | specify if the property / path is mandatory | |
| defaultValue | specify a default value (only available for property) |
Examples
Mandatory property
<ea:parameter property="src.main.java" required="true" description="directory where sources to be compiled are" />Here the src.main.java property is mandatory and will make a build failed if this property is not set displaying the following error message :
BUILD FAILED
expected property 'src.main.java': directory where sources to be compiled are
Non mandatory property
<ea:parameter property="src.main.java" description="directory where sources to be compiled are" />Here the src.main.java property is not mandatory and no check will be done on it.
Even if no check is done, this could be usefull to document your build-script (ie. give a description to your properties)
Non mandatory property with default value
<ea:parameter property="src.main.java" default="src/main/java" description="directory where sources to be compiled are" />Here the src.main.java property is not mandatory.
If the property is not set easyant will initialise this property with a default value.
Mandatory path
<ea:parameter path="mypath" required="true" description="my path is used to ..." />Here mypath is mandatory and will make a build failed if this path is not set displaying the following error message :
BUILD FAILED
expected path 'mypath': my path is used to ...
Phase
<ea:parameter phase="myphase" description="my phase is used to ..." />Here we say that our build script should know the phase named "myphase" if not it will make a build failed with the following message :
BUILD FAILED
expected phase 'myphase': my phase is used to ...