Created
September 27, 2012 20:51
-
-
Save ojacobson/3796393 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Asadmin setup targets --> | |
<target name="ant.asadmin" depends="ant.asadmin-port"> | |
<!-- This relies on an obnoxious linked list of presetdef tasks to | |
conditionally pass the 'host' and 'port' options to asadmin if and | |
only if the associated properties are set in Ant. --> | |
<presetdef name="asadmin"> | |
<asadmin.port /> | |
</presetdef> | |
</target> | |
<target name="ant.asadmin-port" | |
depends="ant.asadmin-port.unset, ant.asadmin-port.set" /> | |
<target name="ant.asadmin-port.set" | |
depends="ant.asadmin-host" | |
if="server.port"> | |
<presetdef name="asadmin.port"> | |
<asadmin.host> | |
<arg value="--port" /> | |
<arg value="${server.port}" /> | |
</asadmin.host> | |
</presetdef> | |
</target> | |
<target name="ant.asadmin-port.unset" | |
depends="ant.asadmin-host" | |
unless="server.port"> | |
<presetdef name="asadmin.port"> | |
<asadmin.host /> | |
</presetdef> | |
</target> | |
<target name="ant.asadmin-host" | |
depends="ant.asadmin-host.unset, ant.asadmin-host.set" /> | |
<target name="ant.asadmin-host.set" | |
depends="ant.asadmin-base" | |
if="server.host"> | |
<presetdef name="asadmin.host"> | |
<asadmin.base> | |
<arg value="--host" /> | |
<arg value="${server.host}" /> | |
</asadmin.base> | |
</presetdef> | |
</target> | |
<target name="ant.asadmin-host.unset" | |
depends="ant.asadmin-base" | |
unless="server.host"> | |
<presetdef name="asadmin.host"> | |
<asadmin.base /> | |
</presetdef> | |
</target> | |
<target name="ant.asadmin-base"> | |
<presetdef name="asadmin.base"> | |
<exec executable="asadmin" failonerror="true" /> | |
</presetdef> | |
</target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment