ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: <import> enhancement, it's done, but do you like how it works ?
Date Mon, 15 Jul 2002 19:01:21 GMT

Dominique Devienne wrote:
> No, it's not in 1.5 as released. The patch is compatible with the 1.5 code
> base though (that's where I tested it myself).

ProjectHelper is pluggable at startup in two ways.
In ProjectHelper:

     /**
      * Name of JVM system property which provides the name of the
      * ProjectHelper class to use.
      */
     public static final String HELPER_PROPERTY =
         "org.apache.tools.ant.ProjectHelper";

     /**
      * The service identifier in jars which provide Project Helper
      * implementations.
      */
     public static final String SERVICE_ID =
         "META-INF/services/org.apache.tools.ant.ProjectHelper";

     public static ProjectHelper getProjectHelper()
         throws BuildException {
...

         // First, try the system property
         String helperClass = System.getProperty(HELPER_PROPERTY);
         try {
             if (helperClass != null) {
                 helper = newHelper(helperClass);
             }
...

     // A JDK1.3 'service' ( like in JAXP ). That will plug a helper
     // automatically if in CLASSPATH, with the right META-INF/services.
...
              ClassLoader classLoader = getContextClassLoader();
              InputStream is = null;
              if (classLoader != null) {
                  is = classLoader.getResourceAsStream(SERVICE_ID);
              }
              if (is == null) {
                  is = ClassLoader.getSystemResourceAsStream(SERVICE_ID);
              }
...

> Nicola Ken and I briefly
> discussed <import/include> being a task, and I didn't think it was possible
> using a SAX-based project helper. How could it inject XML elements being
> outside of ProjectHelperImpl? The latter would have to be DOM based for it
> to happen IMHO, and would requires hooks still. But I'm certainly wrong...

Basically it needs to call ProjectHelperImpl to add the stuff to the 
Project.
ProjectHelper just adds stuff to the Project, and I don't see why, at 
least in theory, it cannot be done during runs.

> --DD
> 
> -----Original Message-----
> From: costinm@covalent.net [mailto:costinm@covalent.net] 
> Sent: Monday, July 15, 2002 1:21 AM
> To: Ant Developers List; nicolaken@apache.org
> Subject: Re: <import> enhancement, it's done, but do you like how it works ?
> 
> On Sun, 14 Jul 2002, Nicola Ken Barozzi wrote:
> 
> 
>>costinm@covalent.net wrote:
>>
>>>I was just thinking - how difficult would it be to implement this 
>>>as an add-on task for ant1.5 ? 
>>
>>You mean the <import> tag?
>>Well, it already works for 1.5 AFAIK.
> 
> 
> I'm a bit confused here - is it included in the 1.5 release ? Can you 
> use it as an optional task in 1.5 ?  
> I tought it is in the 1.6 branch, and requires some change to 
> ProjectHelper, didn't know it was also included in 1.5.
> 
> --
> To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
> 
> 
> 


-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message