Ant build should wait for a child process to complete

669 views Asked by At

Hi I am new to ant and I have written a target which spawns a child process . Here I want the ant to wait until the child process is completed. How can I do that ? Can anyone please help me

<target name = "buildtarget" depends="load-props">
        <property name="targetname" value="build"/>
        <echo message="Hello ${targetname}"/>
        <echo message = "${lockfile.dir}"/>
        <echo message ="./../../${cwd.dir}/${targetname}"/>
         <exec executable="perl" dir = "${lockfile.dir}/" spawn = "true">
             <arg value="./acquirelock.pl"/>
            <arg value="-file"/>
            <arg value="./../../${cwd.dir}/${targetname}"/>
        </exec>

Here I am executing acquire lock.pl . So the build has to wait till the process is executed completely

1

There are 1 answers

0
rghome On BEST ANSWER

The spawn=true attribute causes ant to run the task in background.

I suppose if you remove it, then your problem will be solved.