ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rhino" <>
Subject Confusion with condition
Date Mon, 19 Dec 2005 17:12:13 GMT
I'm getting a bit confused about a simple condition in one of my build 
scripts. Can anyone help?

One of my targets is trying to run a couple of WinSCP3 scripts. Both scripts 
are rather trivial - for the moment - and simply connect to a server and 
list the contents of a directory. The first script contains no errors but 
the second one contains a deliberate error: the directory name that it is 
supposed to list is misspelled. My target executes both scripts in separate 
tasks; for each task, a distinct resultproperty is set if the script 
encounters an error. According to Ant (running with -debug and
-verbose), the script2.result property is set to 1 when the second script 
encounters my deliberate error. So far so good.

However, the target that I set up to do a simple echo of a message when that 
property is set, fails to execute. I'm baffled why this target, 
upload-Bongo-Script1-errors, fails to execute. The dependency on 
'upload-Bongo' is stated and the 'if' spells the property name correctly. I 
can't think of anything else that could be wrong here. (Mind you, I only 
work on Ant a few hours at a time every few months so I forget a lot between 
Ant sessions.) Can anyone enlighten me?

Here's the relevant code:

<target name="upload-Bongo" description="Upload to the Bongo server.">

<echo message="Uploading to Bongo...."/>

<exec executable="${}" os="Windows XP" output="${script1.out}" 


description="Run a trivial script that doesn't change anything, just to show 
that everything works.">

<arg line="/console /script=${}"/>


<exec executable="${}" os="Windows XP" output="${script2.out}" 


description="Upload the real files.">

<arg line="/console /script=${}"/>



<target name="upload-Bongo-Script1-errors" depends="upload-Bongo" 

<echo message="Oops, upload to Bongo failed. See ${script1.out} and/or 


<target name="upload-Bongo-Script2-errors" depends="upload-Bongo" 

<echo message="Oops, upload to Bongo failed. See ${script2.out} and/or 



No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 16/12/2005

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message