开发者

Is there a way to notify ant when I reach a certain point of code?

I'm a bit new to ant, but couldn't find an answer to this at all. What I need is that the java program takes a while to load in a bunch of data (a huge xml file), and I need the ant task to wait until it is completely done. Right now I deal with this problem with a sleep. Here's some sudo of how it is now:

the j开发者_如何学运维ava code

loadBunchofDatata(); // this takes like 5 minutes
startServer();
// I would like to "notify" ant after the server has started
while(true)sleep(10000);

the ant

What I would like is something like so

The java

loadBunchofDatata(); // this takes like 5 minutes
startServer();
notifyAnt();
while(true)sleep(10000);

ant

<target name="runtests" >
     <call to the above java>
     <wait for notification flag>
     <run the test that depends on the server from the java>
</target>

Anything like this possible?


Use WaitFor task and check for a file, socket (port) or URL to become available.

http://ant.apache.org/manual/Tasks/waitfor.html

If your server doesn't have a socket or URL to check, create a file as your notification

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜