blob: 1f92b6d9efcfe3695320ad16bd408623080e2072 [file] [log] [blame]
<?xml version="1.0"?>
<project name="WriteOutputContractTask" default="main" basedir="..">
You can read the value of input contracts in script directly by use TaskProductionForAnt. And we will convert the value to 'String'
and set it into the porperty with the contract name, you can get the value from the porperty.
<ReadIN name="the name of the contract" type="the type of the contract"/>
=>If you didn't set the type of the contract in the script, it will find the type of the contract automaticly.
<ReadIN name="the name of the contract">
Then you can get it by use '${the name of the contract}'.
Now the TaskProductionForAnt class can support following types:
String => type="type:string"
Boolean | boolean => type="type:boolean"
Long => type="type:long"
Integer => type="type:integer"
BigInteger => type="type:bigInteger"
BigDecimal => type="type:bigDecimal"
Float => type="type:float"
Byte => type="type:byte"
Short => type="type:short"
Double => type="type:double"
Character => type="type:character"
Date => type="type:date" (Now suppoert the simple fomate: 'yyyy-MM-dd' and 'yyyy/MM/dd')
Type URI => type="type:uri" (org.eclipse.emf.common.util.URI)
If you want use ant script to read other complex type, you can write a sub task class which extends '',
and read the input contract in the execute() method. You can get the TaskProductionContext from the ant task by use getContext() method
(See 'WriteAndReadContractByTask.xml').
<!-- Define the ant tasks -->
<taskdef name="taskProductionForAnt" description="Read input contracts in script directly." classname="org.eclipse.egf.portfolio.task.ant.engine.TaskProductionForAnt">
<pathelement location="${basedir}/bin" />
<!-- Exectute the task -->
<target name="main">
<!-- Write output contracts in script directly -->
<ReadIN name="input_parameter" type="type:string" />
<!-- The read value of input contract can be used in script by property name ( ${the name of contract} ) -->
<echo message="${input_parameter}" />