go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  One more example
 
Subject: One more example
Author: ant
In response to: Want more controls?
Posted on: 08/11/2010 06:29:33 PM

<target name="local_config">
    <condition property="local.config.properties"  value="../conf/${local.config}">
      <and>
        <isset property="local.config"/>
        <not>
          <equals arg1="" arg2="${local.config}"/>
        </not>
      </and>
    </condition>
</target>

  <target name="echo_local_config" depends="local_config" if="local.config.properties">
      <echo message="Using local config: ${local.config.properties}"/>
  </target>


Output:
Buildfile: C:\temp\project\build.xml
local_config:
echo_local_config:
     [echo] Using local config: ../conf/config.properties-demo
BUILD SUCCESSFUL
Total time: 1 second

 

> On 08/11/2010 06:21:22 PM ant wrote:


<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)





References:

 


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