سؤال

In my ANT script - there is a input parameter 'global'.

If global=true then mkdir 'a' and create war at 'a' else if global=false then mkdir 'b' and create war at 'b'

Is there any way in ANT to achieve this?

هل كانت مفيدة؟

المحلول

A few ways...

You can use the condition task:

<condition
     property="war.dir"
     value="a"
     else="b">
    <istrue arg1="${global}"/>
</condition>

You might be able to use the new if and unless in a <property/> task. I've had problems with these.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top