From 62320f7892f6db35061a349c792f16ba78667ad1 Mon Sep 17 00:00:00 2001
From: Stefan Bodewig
If a target in the main file is also present in at least one of the +imported files, it takes precedence.
+ +So if I import for example a docsbuild.xml file named builddocs,
that contains a "docs" target, I can redefine it in my main
buildfile and that is the one that will be called. This makes it easy to
keep the same target name, so that the overriding target is still called
@@ -44,26 +44,26 @@ by any other targets--in either the main or imported buildfile(s)--for which
it is a dependency, with a different implementation. The original target is
made available by the name "builddocs.docs".
This enables the new implementation to call the old target, thus
-enhancing it with tasks called before or after it.
-
-Special Properties
-
-Imported files are treated as they are present in the main
+enhancing it with tasks called before or after it.
Imported files are treated as they are present in the main
buildfile. This makes it easy to understand, but it makes it impossible
for them to reference files and resources relative to their path.
Because of this, for every imported file, Ant adds a property that
contains the path to the imported buildfile. With this path, the
imported buildfile can keep resources and be able to reference them
-relative to its position.
-
-So if I import for example a docsbuild.xml file named builddocs,
+relative to its position.
So if I import for example a docsbuild.xml file named builddocs,
I can get its path as ant.file.builddocs, similarly to the ant.file
-property of the main buildfile.
-Note that "builddocs" is not the filename, but the name attribute
-present in the imported project tag.
+property of the main buildfile.
Note that "builddocs" is not the filename, but the name attribute +present in the imported project tag.
-Suppose your main build file called importing.xml
imports a build file imported.xml
, located anywhere on
@@ -134,19 +134,19 @@ project).
<import file="../common-targets.xml" />-
<import file="${deploy-platform}.xml" />-
<import file="../common-targets.xml" /> ++ +
Imports targets from the common-targets.xml file that is in a parent +directory.
+ +<import file="${deploy-platform}.xml" /> ++ +
Imports the project defined by the property deploy-platform
+Copyright © 2003-2004 The Apache Software Foundation. All rights