From 753a6c60f47f3ac4f270005b65e9d6481de8eb68 Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Fri, 23 Oct 2015 10:00:02 -0700 Subject: Adding maven and ant source trees Change-Id: I0a39b9add833a31b9c3f98d193983ae2f3a5a445 Signed-off-by: Ashlee Young --- .../ant/apache-ant-1.9.6/manual/projecthelper.html | 150 +++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 framework/src/ant/apache-ant-1.9.6/manual/projecthelper.html (limited to 'framework/src/ant/apache-ant-1.9.6/manual/projecthelper.html') diff --git a/framework/src/ant/apache-ant-1.9.6/manual/projecthelper.html b/framework/src/ant/apache-ant-1.9.6/manual/projecthelper.html new file mode 100644 index 00000000..fa07aea4 --- /dev/null +++ b/framework/src/ant/apache-ant-1.9.6/manual/projecthelper.html @@ -0,0 +1,150 @@ + + + + + + +The Apache Ant frontend: ProjectHelper + + + +

The Apache Ant frontend: ProjectHelper

+ +

What is a ProjectHelper?

+ +

+The ProjectHelper in Apache 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. +

+ +

+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 file named build.xml. +

+ +

+The immediate benefit of a such abstraction it that it is possible to make Ant +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). +

+ +

Since Ant 1.8.2, the import task will also +try to use the proper helper to parse the imported file. So it is possible to +write different build files in different languages and have them import each +other. +

+ +

How is Ant is selecting the proper ProjectHelper

+ +

+Ant knows about several implementations of ProjectHelper +and has to decide which to use for each build file. +

+ +

At startup Ant lists the all implementations found and keeps them +in the same order they've been found in an internal 'repository': +

+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. +

+ +

+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. +

+ +

+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 ProjectHelpers +and will select the first one that expects a default file that actually exist. +

+ +

Writing your own ProjectHelper

+ +

+The class org.apache.tools.ant.ProjectHelper is the API expected to +be implemented. So write your own ProjectHelper by extending that +abstract class. You are then expected to implement at least the function +parse(Project project, Object source). Note also that your +implementation will be instanciated by Ant, and it is expecting a default +constructor with no arguments. +

+ +

+There are some functions that will help you define what your helper is +capable of and what is is expecting: +

+

+ +

+Now that you have your implementation ready, you have to declare it to Ant. Three +solutions here: +

+

+ + + + -- cgit 1.2.3-korg