ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "gglefoncede gglefoncede" <gglefonc...@hotmail.com>
Subject Condition If
Date Tue, 09 Dec 2003 16:59:55 GMT
Hi all

I would like to know if it's possible to execute a task only if the task 
that it depends was succesfull ?
In fact I've got a task that create a directory on my server and another 
that upload Files in this directory. And if the directory i try to create 
already exists, there is a error but the second task is executed.
I would like that the ANT script stop when a task failed.

This is my 2 tasks:

<target name="CreateDir">
		<ftp action="mkdir"
       			server="${properties.ftp.adresseserveur}"
       			userid="${properties.ftp.utilisateur}"
       			password="${properties.ftp.password}"
       			remotedir="${properties.rep.sitemaquette}"/>
</target>

<target name="FTP" depends="CreationDir">
		<ftp server="${properties.ftp.adresseserveur}"
			remotedir="${properties.rep.sitemaquette}"
       			userid="${properties.ftp.utilisateur}"
       			password="${properties.ftp.password}">
		   <fileset dir="${properties.rep.temporaire}">
			<exclude name="scriptsql/**"/>
		   </fileset>
  		</ftp>
</target>


I would like something like

If (Directory already exists) then
     Delete the diretory
     Create the directory
     Execute the FTP task
else
     Create the directory
     Execute the FTP task
end if


How could i do that ??????


Thanks
Greg

_________________________________________________________________
MSN Messenger  http://g.msn.fr/FR1001/866 : un logiciel gratuit pour 
dialoguer avec vos amis !


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


Mime
View raw message