ant中condition学习

<target name="test">  
            <condition property="scondition">  
                <isfalse value="false"/>
                
                <!--断言为真 设置scondition属性 否则不设置
                 isfalse value="false" 断言假值假   istrue value="true"  断言真值真  结果为真  
                 isfalse value="true"  断言假值真   istrue value="false" 断言真值假  结果为假
                 isset 检测属性是否存在 存在为真
                 available 是否可用
                 equals 是否相等
                -->  
                <!--
                  <and>  
                    <istrue value="true"/>  
                    <istrue value="false"/>           
                </and>
                    逻辑与      两个断言同为真结果才为真
                -->
                <!--
                  <or>  
                    <istrue value="true"/>  
                    <istrue value="false"/>                  
                </or>
                    逻辑与或   一个断言为真结果为真
                -->
                <!--
                  <not>  
                    <istrue value="false"/>                 
                </not>
                    逻辑非   断言为真结果为假  刚好相反
                -->
            </condition>  
           <!--在target中调用其他的target-->
            <antcall target="isTrue" ></antcall>  
            <antcall target="isFalse"></antcall>          
        </target>  
    <!--unless="scondition" 表示没有scondition属性时为真  
    if="scondition" 表示有scondition属性时为真
    真才会执行target任务
      -->
        <target name="isTrue" if="scondition">  
            <echo>is ture</echo>  
        </target>  
        <target name="isFalse" unless="scondition">  
            <echo>is false</echo>  
        </target>

猜你喜欢

转载自blog.csdn.net/ld2007081055/article/details/41620733
今日推荐