I've got an ant build script which I should modify. Specifically I should make a subversion checkout conditional: currently only the trunk gets checked out, the new version should checkout a given branch if needed.
<target name="do-svn-checkout" depends="init"
<property name="branch" value=""/>
<exec executable="svn">
<arg value="checkout"/>
<arg value="-r"/>
<arg value="HEAD"/>
<arg value="http://t01/java/trunk"/>
<arg value="zzz"/>
<arg value="--password"/>
<arg value="xxx"/>
<arg value="--username"/>
<arg value="yyy"/>
</exec>
</target>
The property branch
will be set via the command line like for instance -Dbranch=mybranch
.
If the property branch
is empty, the trunk should be checked out, but if the property has any other value, the respective branch should be checked out, like http://t01/svn/hlfg/HLFG/java/branch/the-value-of-the-property
. So depending on the property the respective arg-value of the svn
call should be modified.
Is it possible to solve this with basic Ant or would I need to use an inline script?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…