ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sanjay Goel" <sanjayg...@despammed.com>
Subject Re: if condition in ant
Date Wed, 23 Jul 2003 04:43:31 GMT
Thank you for the ultra quick response.. Both these approaches are great. I
will be using the second approach using <available> for my script.
Sanjay
Jan.Materne@rzf.fin-nrw.de wrote:
> Another possibility would be that your "stopserver" creates an
> artifact that you can check. E.g. create a file and check presence
> with <available>. If available
> all is ok. If not do you kill.
>
> <property name="checkfile" value="checkfile.txt"/>
> <target name="stopserver"/>
> <target name="kill" unless="stopserver.sucess"/>
> <target name="shutdown" depends="stopserver">
>     <available property="stopserver.success" file="${checkfile}"/>
>     <delete file="${checkfile}" failonerror="false"/>
>     <antcall target="kill"/>
> </target>
>
> Because properties are immutable this would work only once per ant
> run.
>
>
> Jan
>
>
>> -----Original Message-----
>> From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
>> Sent: Tuesday, July 22, 2003 4:27 PM
>> To: user@ant.apache.org
>> Subject: RE: if condition in ant
>>
>>
>> Why not "kill" after "stopserver"?
>> The "kill" should handle not existing processes.
>> And as result of the whole scenario your server is not
>> running any more.
>>
>> Maybe you have to do the <exec kill> inside a <try><catch> block
(see
>> AntContrib).
>>
>>
>> Jan
>>
>>
>>
>>> -----Original Message-----
>>> From: Sanjay Goel [mailto:sanjaygoel@despammed.com]
>>> Sent: Tuesday, July 22, 2003 4:21 PM
>>> To: user@ant.apache.org
>>> Subject: if condition in ant
>>>
>>>
>>> Hi,
>>> I have to know if the following can be implemented by ant:
>>> I want to stop my server using stopserver.bat. I give a
>>> timeout of 5 min.
>>> now if the stopserver command fails, I want to execute
>>> another command kill
>>> which will kill the server process.
>>> I dont want to run this "kill" command otherwise.
>>>
>>> Any pointers how can we achieve this ?
>>> TIA
>>> Sanjay
>>>
>>>
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message