ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "W. Sean Hennessy" <shenne...@goldenhourdata.com>
Subject RE: disabling targets dynamically
Date Fri, 12 Dec 2003 22:39:34 GMT

  <!-- on windows systems ${env.COMPUTERNAME} is host name -->

    <!-- target to evaluate which host -->
    <target name="HostEvalA.tgt.nm">
        <condition property="properties.isHostA">
            <and>
            <equals arg1=${env.COMPUTERNAME} arg2="HostA" />
            ${env.COMPUTERNAME} = "HostA"
           </and>
        </condition>
        <condition property="properties.isHostB">
            <and>
            ${env.COMPUTERNAME} = "HostB"
           </and>
        </condition>
    </target>

   <target name="HostEvalB.tgt.nm">
        <condition property="properties.isHostA">
            <and>
            <equals arg1=${env.COMPUTERNAME} arg2="HostB" />
            ${env.COMPUTERNAME} = "HostA"
           </and>
        </condition>
    </target>
    <!-- use of unless to exclude if Host B -->
    <target name="target2" depends=HostEvalB.tgt.nm" unless="properties.isHostB">
    </target>

-----Original Message-----
From: Jacob, Anil - MWT [mailto:Jacob.Anil@menlolog.com] 
Sent: Friday, December 12, 2003 2:11 PM
To: Ant Users (E-mail)
Subject: disabling targets dynamically



 Is there a way to disable a target at runtime based on certain value from a property

 For example If I have - target 1, target 2, target 3 all of the are available when I run
ant on HostA, where as when I
run on Host B I want only target1 and target to be available.

Is this possible?
Anil

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message