The following patch allows the user to access the current target being executed
by using the ${ant.target.name} variable. I added this functionality in order
to include the target name in the alert e-mail sent out after a build failure.
The patch was made to the 8/28/01 nightly drop source code, and has been tested
on WinNT 4.00.1381 (Service Pack 5).
--- Project.java.old Tue Aug 28 10:10:19 2001
+++ Project.java Tue Aug 28 09:49:31 2001
@@ -598,6 +598,7 @@
do {
curtarget = (Target) sortedTargets.elementAt(curidx++);
+ this.setProperty("ant.target.name", curtarget.getName());
curtarget.performTasks();
} while (!curtarget.getName().equals(targetName));
}
|