ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: PropertyHelper breaks ant-contrib
Date Tue, 07 Aug 2007 21:33:51 GMT
The problem is that ComponentHelper checks if "task" classe are
suitable for being ant classes:

    /**
     * Checks whether or not a class is suitable for serving as Ant task.
     * Ant task implementation classes must be public, concrete, and have
     * a no-arg constructor.
     *
     * @param taskClass The class to be checked.
     *                  Must not be <code>null</code>.
     *
     * @exception BuildException if the class is unsuitable for being an Ant
     *                           task. An error level message is logged before
     *                           this exception is thrown.
     */

This must be by-passed for internal ant tasks but is triggered
by AntCallBack which does some odd things (probably a copy of
ant 1.5 code).

  199       Hashtable taskdefs = project.getTaskDefinitions();
  200       Enumeration et = taskdefs.keys();
  201       while ( et.hasMoreElements() ) {
  202          String taskName = (String)et.nextElement();
  203          if ( taskName.equals( "property" ) ) {
  204             // we have already added this taskdef in #init
  205             continue;
  206          }
  207          Class taskClass = (Class)taskdefs.get( taskName );
  208          newProject.addTaskDefinition( taskName, taskClass );
  209       }

easy fix would be to remove the constructor from PropertyHelperTask.
the project attribute would be injected as usual by IH.

Peter


On 8/7/07, Matt Benson <gudnabrsam@yahoo.com> wrote:
>
> --- Stefan Bodewig <bodewig@apache.org> wrote:
>
> > Hi,
> >
> > see
> >
> <http://vmgump.apache.org/gump/public/ant-contrib/ant-contrib-test/gump_work/build_ant-contrib_ant-contrib-test.html>
> >
> > Apparently AntCallBack's test tries to install a
> > PropertyHelper (I'm
> > not familiar with either the task's nor the test's
> > code, just pointing
> > out the error) and wants to use PropertyHelperTask.
> >
> > Any hints on how to go forward (either in Ant or
> > ant-contrib?)
>
>
> I'm open to suggestions of "how to ease the pain" wrt
> the transition to the (proposed) 1.8 PropertyHelper
> API changes.  I will be happy to donate code wherever
> practical to point the way, as it were; I'll try to
> have a look at this Gump issue and send a patch...
> where?
>
> On a related note, we should probably be thinking
> about releasing 1.7.1 soon, and 1.8 as we work out
> whatever decisions remain on the PropertyHelper stuff?
>  :|  Or we can chuck the whole thing if that's the
> consensus... :O
>
> -Matt
>
> >
> > Stefan
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > dev-help@ant.apache.org
> >
> >
>
>
>
>       ____________________________________________________________________________________
> Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

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


Mime
View raw message