ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Weir (Transform Research)" <>
Subject newbie unclear on concept
Date Thu, 12 Jul 2001 17:05:05 GMT
I'm new to Ant and am apparently unclear about a few things (only a few...).

If I have a build.xml file that looks like this:

<project name="XXX" default="buildAndTest" basedir=".">
	<target name="buildAndTest" 
			depends="badTarget1, badTarget2"
			Build and Test is running...

	<target name="badTarget1">
		<copy file="X:\badfile.txt" tofile="X:\badfile2.txt" />

	<target name="badTarget2">
		<copy file="X:\badfile.txt" tofile="X:\badfile2.txt" />

I.e. the main target depends on two 'bad' targets.

I expected that the bad file copies would fail, and that the only target to
execute would be badTarget.  Instead I get this:

Ant version 1.3 compiled on March 2 2001

Buildfile: build.xml
Detected Java Version: 1.3
Detected OS: Windows 2000
parsing buildfile P:\CM_1_0\build.xml with URI = file:P:/CM_1_0/build.xml
Project base dir set to: P:\CM_1_0
Build sequence for target `buildAndTest' is [badTarget1, badTarget2,
Complete build sequence is [badTarget1, badTarget2, buildAndTest]

     [copy] Could not find file X:\badfile.txt to copy.

     [copy] Could not find file X:\badfile.txt to copy.

                        Build and Test is running...


Total time: 1 second

I assume that there's a way to tell when a target has failed, and to cause
the parent target to fail as well, I just can't seem to see how.

Any help would be appreciated.
Michael Weir

View raw message