Ant target execution(Just execute, not wait to com

2019-08-29 16:57发布

问题:

Currently I have one build file like

 <target name="test1">
    </target>
    <target name="test2">
    </target>
    ....
    <target name="test" depends="test1,test2">
    </target>

There is one problem, when run target "test1", ant always timeout(Confirm with Dev, ant is waiting for some back-end task completed in Runtime, this is correct)。

But based on that, the whole ant execution will be interruppted by the failure of test1, test2 will not be executed.

So question is is there any way to tell ant, for test1, you only to execute it, not to wait it completed, then you can go to test2 target directly.

回答1:

ANT has a parallel task which can be used to run tasks in the background. You might have to restructure your build logic to make use of this.



回答2:

Maybe the forget task of antcontrib is useful :

The Forget task will execute a set of tasks sequentially as a background thread.
Once the thread is started, control is returned to the calling target. This is useful in being able to kick
off a background server process, such as a webserver. This allows you to not have to use the parallel task to start server processes.



标签: ant wait target