Ant if statement

Below is a snippet from my file build.xml. I want to change the file so that the jar name is set depending on the value of the variable in the assembly 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 I can call a java program to return the name jar, so something like -

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

Thanks for any suggestions,

Adrian

+3
source share
1 answer

Ant The Contrib project has a selection of custom tasks , including a task <if>that allows you to do this. This is awkward, but it works.

+3
source

Source: https://habr.com/ru/post/1768604/


All Articles