From 5c99aa9c2a25cd551b50bb6d7c9ae3932cc90b0a Mon Sep 17 00:00:00 2001
From: Stefan Bodewig
-The
-So in Ant there is a default
The immediate benefit of a such abstraction it that it is possible to make Ant
-understand other kind of descriptive language than XML. Some experiment have
+understand other kind of descriptive languages than XML. Some experiments have
been done around a pure java frontend, and a groovy one too (ask the dev mailing
list for further info about these).
-Ant can now know about several implementations of So Ant at startup will list the found implementations and will keep it
-ordered as it finds them in an internal 'repository':
+ At startup Ant lists the all implementations found and keeps them
+in the same order they've been found in an internal 'repository':
What is a ProjectHelper?
ProjectHelper
in Ant is responsible to parse the build file
-and create java instances representing the build workflow. It also declares which
+The ProjectHelper
in Ant is responsible for parsing the build file
+and creating java instances representing the build workflow. It also signals which
kind of file it can parse, and which file name it expects as default input file.
ProjectHelper
-(org.apache.tools.ant.helper.ProjectHelper2
) which will parse the
+Ant' default ProjectHelper
+(org.apache.tools.ant.helper.ProjectHelper2
) parses the
usual build.xml files. And if no build file is specified on the command line, it
-will expect to find a build.xml file.
+will expect to find a file named build.xml
.
How is Ant is selecting the proper ProjectHelper
ProjectHelper
-and have to decide which to use for each build file.
+Ant knows about several implementations of ProjectHelper
+and has to decide which to use for each build file.
-In case of error while trying to instanciate a org.apache.tools.ant.ProjectHelper
(see
@@ -69,24 +70,24 @@ ordered as it finds them in an internal 'repository':
ProjectHelper
that can parse classical build.xml files.ProjectHelper
, Ant
-will log an error but still won't stop. If you want further debugging
-info about the ProjectHelper
internal 'repository', use the system
+In case of an error while trying to instanciate a ProjectHelper
, Ant
+will log an error but won't stop. If you want further debugging
+info about the ProjectHelper
internal 'repository', use the system
property ant.project-helper-repo.debug
and set it to
true
; the full stack trace will then also be printed.
-Then when Ant is expected to parse a file, it will ask the
-ProjectHelper
repository to found an implementation that will be
-able to parse the input file. Actually it will just iterate on the ordered list
+When Ant is expected to parse a file, it will ask the
+ProjectHelper
repository to find an implementation that will be
+able to parse the input file. Actually it will just iterate over the ordered list
and the first implementation that returns true
to
supportsBuildFile(File buildFile)
will be selected.
-And when Ant is launching and there is no input file specified, it will search for
-a default input file. It will iterate on the list of ProjectHelper
+When Ant is started and no input file has been specified, it will search for
+a default input file. It will iterate over list of ProjectHelper
s
and will select the first one that expects a default file that actually exist.
-Then there are some functions that will help you define what your helper is +There are some functions that will help you define what your helper is capable of and what is is expecting:
getDefaultBuildFile()
: defines which file name is expected if