1

I want to terminate an ant script, or skip some targets, but without the fail task. I wanted to do it like this:

`

<target name="init">
   <condition property="canContinue">
         <not>
            <equals arg1="${isOffline}" arg2="1" />
         </not>
   </condition>
</target>

<target name="init-setup" depends="init" if="canContinue">
        <echo message="CanContinue: ${canContinue}"/>
</target>

<target name="doIt" depends="init-setup">
</target>

`

I would like to skip all the targets which depend on init-setup, not just init-setup.

How can I do this?

Thank you!

  • possible duplicate of [Stop ant script without failing build](http://stackoverflow.com/questions/14130315/stop-ant-script-without-failing-build) – Rebse Jul 29 '14 at 06:28

1 Answers1

0

If you're not using explicit fail tasks, you'll need to add your boolean flag to each target you want to skip.

Using your example:

<target name="doIt" depends="init-setup" if="canContinue">
</target>
mjk
  • 2,443
  • 4
  • 33
  • 33