basic elements: istrue isfalse not and or xor available isset equals  filesmatch
    1、istrue isfalse:断言 真 假
<project name="testCondition">
    <target name="test">
        <condition property="scondition">
            <istrue value="true"/>                   
        </condition>
        <antcall target="isTrue"></antcall>
        <antcall target="isFalse"></antcall>       
    </target>
    <target name="isTrue" if="scondition">
        <echo>is ture</echo>
    </target>
    <target name="isFalse" unless="scondition">
        <echo>is false</echo>
    </target>
</project>

    2、逻辑运算
    2.1、not 逻辑非 
<project name="testCondition">
    <target name="test">
        <condition property="scondition">
            <not>
                <istrue value="true"/>                   
            </not>
        </condition>
        <antcall target="isTrue"></antcall>
        <antcall target="isFalse"></antcall>       
    </target>
    <target name="isTrue" if="scondition">
        <echo>is ture</echo>
    </target>
    <target name="isFalse" unless="scondition">
        <echo>is false</echo>
    </target>
</project>
    2.2、and 逻辑与
<project name="testCondition">
    <target name="test">
        <condition property="scondition">
            <and>
                <istrue value="true"/>
                <istrue value="false"/>                   
            </and>
        </condition>
        <antcall target="isTrue"></antcall>
        <antcall target="isFalse"></antcall>       
    </target>
    <target name="isTrue" if="scondition">
        <echo>is ture</echo>
    </target>
    <target name="isFalse" unless="scondition">
        <echo>is false</echo>
    </target>
</project>
    2.3、or 逻辑或 xor异或 (语法上与and类似)

    3、available 是否可用
<project name="testCondition">
    <path >
        <echo>is false</echo>
    </target>
</project>   

相关文章:

  • 2021-11-10
  • 2021-12-28
  • 2021-07-28
  • 2021-11-29
  • 2022-01-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2021-11-01
相关资源
相似解决方案