下面的build.xml,中间那一段 应该如何写。请高人指点

dawnming 2009-02-27 11:37:50
下面的build.xml,中间那一段 应该如何写。请高人指点


<target name="GetSource">
<property name="mytime" value=""></property>

if mytime="" then mytime=now

<echo message="${mytime}"/>

</target>
...全文
104 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
dawnming 2009-02-27
  • 打赏
  • 举报
回复
高人在哪里啊~~~
sunyujia 2009-02-27
  • 打赏
  • 举报
回复

<?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
fosjos 2009-02-27
  • 打赏
  • 举报
回复
用script?
混沌君子 2009-02-27
  • 打赏
  • 举报
回复
兄弟啊 , 你是不是学糊涂了,怎么在配置文件里写控制流程啊??如果真的不懂先找本书看看ANT是个什么东西,然后遇到什么不懂的再问也不迟啊!!
Gao_TF 2009-02-27
  • 打赏
  • 举报
回复
帮顶一下吧
我见到文档上说可以如下写,作者用的版本是1.7,但我试验没有成功!
<if>
<equals arg1="${mytime}" arg2="your value"/>
<then>
</then>
<echo message="${mytime}"/>
</if>

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧