开发者

Ant if statement

Below is a snippet from my build.xml file. I want to modify 开发者_JAVA百科the file so that the jar name is set depending on the value of a variable within the build file.

<info 
   jarName="java get"
   jarUrl="${deploy-url}${polish.jarName}"
/>

So something like -

<info
   if(${deploy-url} == "test")
      jarName="java get" 
   else
      jarName="java test" 
      jarUrl="${deploy-url}${polish.jarName}"
/>

Or can I call a java program to return the jar name, so something like -

<info
   jarName=java programToExecute 
   jarUrl="${deploy-url}${polish.jarName}"
/>

Thanks for any suggestions,

Adrian


The Ant Contrib project has a selection of custom tasks, including an <if> task that will let you do this. It's clumsy, but it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜