go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Want more controls?
 
Subject: Want more controls?
Author: ant
In response to: If/unless Conditional Target
Posted on: 08/11/2010 06:21:22 PM


<target name="myTarget" depends="myTarget.check" if="myTarget.run">
    <echo>Files foo.txt and bar.txt are present.</echo>
</target>

<target name="myTarget.check">
    <condition property="myTarget.run">
        <and>
            <available file="foo.txt"/>
            <available file="bar.txt"/>
        </and>
    </condition>
</target>


Call-Graph:  myTarget.check --> maybe(myTarget)


 

> On 08/11/2010 06:19:47 PM ant wrote:


A target has the ability to perform its execution if (or unless) a property has been set.

<target name="build-module-A" if="module-A-present"/>


If the module-A-present property is set (to any value, e.g. false), the target will be run.


<target name="build-own-fake-module-A" unless="module-A-present"/>


If the module-A-present property is set (again, to any value), the target will not be run.





References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.