下面的build.xml,中间那一段 应该如何写。请高人指点
<target name="GetSource">
  <property name="mytime" value=""></property>
  
  if mytime="" then mytime=now <echo message="${mytime}"/></target>

解决方案 »

  1.   

    兄弟啊 , 你是不是学糊涂了,怎么在配置文件里写控制流程啊??如果真的不懂先找本书看看ANT是个什么东西,然后遇到什么不懂的再问也不迟啊!!
      

  2.   


    <?xml version="1.0" encoding="GBK"?>
    <project name="test" default="build" basedir=".">
    <target name="build">
    <property name="mytime" value="java"></property>
    <echo message="${mytime}" />
    <condition property="result">
    <equals arg1="${mytime}" arg2="java" />
    </condition>
    <antcall target="isTrue"></antcall>
    <antcall target="isFalse"></antcall>
    </target>
    <target name="isTrue" if="result">
    <echo message="result isTrue" />
    </target>
    <target name="isFalse" unless="result">
    <echo message="result isFalse" />
    </target>
    </project>修改property 值的方法,我不知道,但是并不是说这个就无法实现了,我认为可以使用env环境变量,那个变量是可以通过ant修改的http://blog.csdn.net/sunyujia/archive/2008/05/13/2443313.aspx