From cd8ef18058976a150028b5f88a409cdfaf279dc2 Mon Sep 17 00:00:00 2001 From: Diane Holt Date: Mon, 1 Apr 2002 07:23:13 +0000 Subject: [PATCH] Flesh out the example to show the prop's use in an "unless". (PR 5775) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272148 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/uptodate.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/manual/CoreTasks/uptodate.html b/docs/manual/CoreTasks/uptodate.html index d7ecd188a..145da9c7b 100644 --- a/docs/manual/CoreTasks/uptodate.html +++ b/docs/manual/CoreTasks/uptodate.html @@ -87,8 +87,25 @@ any of the DTD files in the ${src}/xml directory.

<mapper type="merge" to="${deploy}\xmlClasses.jar"/> </uptodate> as well. + +The xmlBuild.notRequired property can then be used in a +<target> tag's unless attribute to +conditionally run that target. For example, running the following target:

+
+<target name="xmlBuild" depends="chkXmlBuild" unless="xmlBuild.notRequired">
+  ...
+</target>
+
+will first run the chkXmlBuild target, which contains +the <uptodate> task that determines whether +xmlBuild.notRequired gets set. The property named in +the unless attribute is then checked for being set/not set. +If it did get set (ie., the jar file is up-to-date), +then the xmlBuild target won't be run.

+

The following example shows a single source file being checked +against a single target file:

  <uptodate property="isUpToDate"
             srcfile="/usr/local/bin/testit"
             targetfile="${build}/.flagfile"/>