You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "Kevin A. Burton" <bu...@relativity.yi.org> on 2000/03/13 09:40:51 UTC

Optional taskdefs and providing additional params to Taskdefs

Two things:

- We need to agree on a way to except optional taskdefs like the recent
xslt task.

I propose we place them in a org.apache.tools.ant.taskdefs.optional
package.  We really need to keep everything together in one place. 
Thoughts?  I would really like to get this straightened out.

- We need to provide additional information to Taskdefs by enhancing the
interface to include a 

public void setExtendedParameters( DocumentFragment df );

public DocumentFragment getExtendedParameters();

in org.apache.tools.ant.Task

Why?  The reason is that not all information about a task can be given
with just attributes.  Within the XSLT task I want to pass some
parameters to the XSLT engine (Xalan) and I can't do this without an
extensible mechanism.  The parameter is defined within the stylesheet
and not within the XSLT task so I can't just have hard-coded attributes
here.

What I want to do is this:

<xslt ...>
    <parameter name="test1" value="test1"/>
    <parameter name="test2" value="test2"/>
    <!--
    This would work for anything the user puts here.. only certain
elements would make sense
    to the Task though.
    -->

</xslt>

The task would then parse these parameters and set them when I
initialize Xalan.  The stylesheet would then get the parameters and
continue about it's merry way :)

Thoughts?

Kevin

-- 
Kevin A Burton (burton@apache.org)
http://relativity.yi.org
Message to SUN:  "Open Source Java!"
"For evil to win is for good men to do nothing."

Re: Optional taskdefs and providing additional params to Taskdefs

Posted by James Duncan Davidson <ja...@eng.sun.com>.
> - We need to agree on a way to except optional taskdefs like the recent
> xslt task.
>
> I propose we place them in a org.apache.tools.ant.taskdefs.optional
> package.  We really need to keep everything together in one place.
> Thoughts?  I would really like to get this straightened out.

Yes, I agree it would be nice to have an optional set of tasks that can ship
with a full Ant distro that people can use at will. However, I'd also like
to solve the problem of making it easier to pick up taskdefs that people
might create on the fly.

> - We need to provide additional information to Taskdefs by enhancing the
> interface to include a
>
> public void setExtendedParameters( DocumentFragment df );

Why are you exposing XML doc frags within the internal APIs? Once the XML
build file is read, we're not in XML land anymore. I'd like to keep it that
way and just leave XML as the disk based data format.

.duncan


Re: Optional taskdefs and providing additional params to Taskdefs

Posted by James Duncan Davidson <ja...@eng.sun.com>.
Most likely so... I wanted to stay away from that, but it seems that there
needs to be a local.taskdef.location property....

.duncan

----- Original Message -----
From: David Bullock
To: ant-dev@jakarta.apache.org
Sent: Monday, March 13, 2000 1:06 AM
Subject: Re: Optional taskdefs and providing additional params to Taskdefs


IMHO, ANT is going to need a (custom?) ClassLoader, and the extra Task
classes should be loadable into a build.xml-configurable 'extension' URL.
Valid candidates for Tasks will of course implement a tag interface.  It
will need this anyway later on in ANT's life when it starts to do
distributed builds on multiple machines (so that the AntBuildController can
divvy out tasks acording to any platform-specific constraints.  :-)
$0.02,
David.

"Kevin A. Burton" wrote:
Two things:
- We need to agree on a way to except optional taskdefs like the recent
xslt task.
I propose we place them in a org.apache.tools.ant.taskdefs.optional
package.  We really need to keep everything together in one place.
Thoughts?  I would really like to get this straightened out.
- We need to provide additional information to Taskdefs by enhancing the
interface to include a
public void setExtendedParameters( DocumentFragment df );
public DocumentFragment getExtendedParameters();
in org.apache.tools.ant.Task
Why?  The reason is that not all information about a task can be given
with just attributes.  Within the XSLT task I want to pass some
parameters to the XSLT engine (Xalan) and I can't do this without an
extensible mechanism.  The parameter is defined within the stylesheet
and not within the XSLT task so I can't just have hard-coded attributes
here.
What I want to do is this:
<xslt ...>
    <parameter name="test1" value="test1"/>
    <parameter name="test2" value="test2"/>
    <!--
    This would work for anything the user puts here.. only certain
elements would make sense
    to the Task though.
    -->
</xslt>
The task would then parse these parameters and set them when I
initialize Xalan.  The stylesheet would then get the parameters and
continue about it's merry way :)
Thoughts?
Kevin
--
Kevin A Burton (burton@apache.org)
http://relativity.yi.org
Message to SUN:  "Open Source Java!"
"For evil to win is for good men to do nothing."
--
David Bullock
Project Leader
dbullock@lisa.com.au

"It's no use saying 'We are doing our best.'  You
have got to succeed in doing what's necessary."
    ...Winston Churchill


LISAcorp
http://www.lisa.com.au/

Adelaide                  Sydney
--------------------      ------------------------
38 Greenhill Rd           Level 3, 228 Pitt Street
Wayville S.A. 5034        Sydney NSW 2000

PH  +61 8 8272 1555       PH  +61 2 9283 0877
FAX +61 8 8271 1199       FAX +61 2 9283 0866
--------------------      ------------------------



Re: Optional taskdefs and providing additional params to Taskdefs

Posted by David Bullock <db...@lisa.com.au>.
IMHO, ANT is going to need a (custom?) ClassLoader, and the extra Task
classes should be loadable into a build.xml-configurable 'extension' URL.
Valid candidates for Tasks will of course implement a tag interface.  It
will need this anyway later on in ANT's life when it starts to do
distributed builds on multiple machines (so that the AntBuildController can
divvy out tasks acording to any platform-specific constraints.  :-)

$0.02,
David.


"Kevin A. Burton" wrote:

> Two things:
>
> - We need to agree on a way to except optional taskdefs like the recent
> xslt task.
>
> I propose we place them in a org.apache.tools.ant.taskdefs.optional
> package.  We really need to keep everything together in one place.
> Thoughts?  I would really like to get this straightened out.
>
> - We need to provide additional information to Taskdefs by enhancing the
> interface to include a
>
> public void setExtendedParameters( DocumentFragment df );
>
> public DocumentFragment getExtendedParameters();
>
> in org.apache.tools.ant.Task
>
> Why?  The reason is that not all information about a task can be given
> with just attributes.  Within the XSLT task I want to pass some
> parameters to the XSLT engine (Xalan) and I can't do this without an
> extensible mechanism.  The parameter is defined within the stylesheet
> and not within the XSLT task so I can't just have hard-coded attributes
> here.
>
> What I want to do is this:
>
> <xslt ...>
>     <parameter name="test1" value="test1"/>
>     <parameter name="test2" value="test2"/>
>     <!--
>     This would work for anything the user puts here.. only certain
> elements would make sense
>     to the Task though.
>     -->
>
> </xslt>
>
> The task would then parse these parameters and set them when I
> initialize Xalan.  The stylesheet would then get the parameters and
> continue about it's merry way :)
>
> Thoughts?
>
> Kevin
>
> --
> Kevin A Burton (burton@apache.org)
> http://relativity.yi.org
> Message to SUN:  "Open Source Java!"
> "For evil to win is for good men to do nothing."

--
David Bullock
Project Leader
dbullock@lisa.com.au

"It's no use saying 'We are doing our best.'  You
have got to succeed in doing what's necessary."
    ...Winston Churchill

LISAcorp
http://www.lisa.com.au/

Adelaide                  Sydney
--------------------      ------------------------
38 Greenhill Rd           Level 3, 228 Pitt Street
Wayville S.A. 5034        Sydney NSW 2000

PH  +61 8 8272 1555       PH  +61 2 9283 0877
FAX +61 8 8271 1199       FAX +61 2 9283 0866
--------------------      ------------------------