Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Recommend plugin structure for Ant Tasks (+ cpptasks)
Recommend plugin structure for Ant Tasks (+ cpptasks) [message #268247] Mon, 23 August 2004 11:42 Go to next message
Eclipse UserFriend
Originally posted by: mark.melvin.dspfactory.com

Hi,

I am diving into writing my own Ant tasks, as well as using the cpptasks
module in my plugin. I was going to throw everything into a "build"
plugin, but found in the Online Help that your contributed tasks and
types should be in a separate JAR, and hence the plugin classes will not
have access to the tasks and types inside these JARs.

Can anyone give me some feedback on how to make this work? I need to
include the cpptasks.jar in a plugin somewhere, and I want to have
access to the tasks and types in that JAR file. Should I create a
wrapper plugin for that JAR file? I have quite a few plugins, and
really don't want to keep adding more...
Also, for the tasks that I write - am I then required to put all of them
in a completely separate plugin as well - say my.company.myAntTasks -
which will require the cpptasks wrapper plugin because it will be
extending it, and then in my "build" plugin, require this new
"myAntTasks" plugin? This seems like a lot of plugins... I already
have quite a few.

Thanks,
Mark.
Re: Recommend plugin structure for Ant Tasks (+ cpptasks) [message #268261 is a reply to message #268247] Mon, 23 August 2004 13:17 Go to previous messageGo to next message
Eclipse UserFriend
There is no requirement for a separate plugin...only that the Ant
contributed tasks and types be in a separate JAR that is NOT specified as a
runtime library for that plugin.

Please take a look at how we have set up the org.eclipse.ant.ui plugin and
its Ant extraClasspathEntries and the use of external tool builders to
generate the JARs.

HTH
Darins

"Mark Melvin" <mark.melvin@dspfactory.com> wrote in message
news:cgd33i$n38$1@eclipse.org...
> Hi,
>
> I am diving into writing my own Ant tasks, as well as using the cpptasks
> module in my plugin. I was going to throw everything into a "build"
> plugin, but found in the Online Help that your contributed tasks and
> types should be in a separate JAR, and hence the plugin classes will not
> have access to the tasks and types inside these JARs.
>
> Can anyone give me some feedback on how to make this work? I need to
> include the cpptasks.jar in a plugin somewhere, and I want to have
> access to the tasks and types in that JAR file. Should I create a
> wrapper plugin for that JAR file? I have quite a few plugins, and
> really don't want to keep adding more...
> Also, for the tasks that I write - am I then required to put all of them
> in a completely separate plugin as well - say my.company.myAntTasks -
> which will require the cpptasks wrapper plugin because it will be
> extending it, and then in my "build" plugin, require this new
> "myAntTasks" plugin? This seems like a lot of plugins... I already
> have quite a few.
>
> Thanks,
> Mark.
Re: Recommend plugin structure for Ant Tasks (+ cpptasks) [message #268282 is a reply to message #268261] Mon, 23 August 2004 13:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mark.melvin.dspfactory.com

OK - yeah that's one of the plugins I was looking at. However, can you
still use these tasks/types from within classes in the
org.eclipse.ant.ui plugin? The Online Help suggests this is not
possible. It states "The consequences are that plug-in classes do not
have access to the classes provided by these extra JARs."

So - I guess my problem is - I can use this approach for the cpptasks
JAR and place it in some plugin that will not require access to the
classes within it, but I can't add both my custom tasks and the cpptasks
together in the same plugin (like you have done in the ant.ui plugin)
because my custom tasks need access to the tesks and types in the
cpptasks JAR file. Am I making sense at all, or do I still not
understand...?

One more question... What is the difference between using the
extraClasspathEntries extension point, and using the antTasks and
antTypes extension points?

Thanks,
Mark.

Darin Swanson wrote:

> There is no requirement for a separate plugin...only that the Ant
> contributed tasks and types be in a separate JAR that is NOT specified as a
> runtime library for that plugin.
>
> Please take a look at how we have set up the org.eclipse.ant.ui plugin and
> its Ant extraClasspathEntries and the use of external tool builders to
> generate the JARs.
>
> HTH
> Darins
>
> "Mark Melvin" <mark.melvin@dspfactory.com> wrote in message
> news:cgd33i$n38$1@eclipse.org...
>
>>Hi,
>>
>>I am diving into writing my own Ant tasks, as well as using the cpptasks
>>module in my plugin. I was going to throw everything into a "build"
>>plugin, but found in the Online Help that your contributed tasks and
>>types should be in a separate JAR, and hence the plugin classes will not
>>have access to the tasks and types inside these JARs.
>>
>>Can anyone give me some feedback on how to make this work? I need to
>>include the cpptasks.jar in a plugin somewhere, and I want to have
>>access to the tasks and types in that JAR file. Should I create a
>>wrapper plugin for that JAR file? I have quite a few plugins, and
>>really don't want to keep adding more...
>>Also, for the tasks that I write - am I then required to put all of them
>>in a completely separate plugin as well - say my.company.myAntTasks -
>>which will require the cpptasks wrapper plugin because it will be
>>extending it, and then in my "build" plugin, require this new
>>"myAntTasks" plugin? This seems like a lot of plugins... I already
>>have quite a few.
>>
>>Thanks,
>>Mark.
>
>
>
Re: Recommend plugin structure for Ant Tasks (+ cpptasks) [message #268309 is a reply to message #268282] Mon, 23 August 2004 16:52 Go to previous messageGo to next message
Eclipse UserFriend
"Mark Melvin" <mark.melvin@dspfactory.com> wrote in message
news:cgd98v$1k7$1@eclipse.org...
> OK - yeah that's one of the plugins I was looking at. However, can you
> still use these tasks/types from within classes in the
> org.eclipse.ant.ui plugin? The Online Help suggests this is not
> possible. It states "The consequences are that plug-in classes do not
> have access to the classes provided by these extra JARs."

This is correct

>
> So - I guess my problem is - I can use this approach for the cpptasks
> JAR and place it in some plugin that will not require access to the
> classes within it, but I can't add both my custom tasks and the cpptasks
> together in the same plugin (like you have done in the ant.ui plugin)
> because my custom tasks need access to the tesks and types in the
> cpptasks JAR file. Am I making sense at all, or do I still not
> understand...?

You need to get a grip on what will be present on the Ant runtime classpath
:-)
If the cpptasks JAR is included in the Ant runtime classpath then your
custom tasks can access these classes.
The reason for the separation of the plugin classes and the Ant classes is
we need to ensure that the classes are loaded by the correct classloader.
Ant runtime classes cannot be loaded in a plugin classloader but the
classloader that does load the Ant runtime classes has the plugin
classloader(s) as a "parent".
Therefore Ant classes can see plugin classes. Plugin classes cannot see Ant
classes. Ant classes can see all other classes on the Ant runtime classpath.

>
> One more question... What is the difference between using the
> extraClasspathEntries extension point, and using the antTasks and
> antTypes extension points?

extraClasspathEntries are just that...JARs that a plugin would like to be
included on the Ant runtime classpath
Specifying a task or type you get the accompanying JAR added to the Ant
runtime classpath for free

HTH
Darins
Re: Recommend plugin structure for Ant Tasks (+ cpptasks) [message #268316 is a reply to message #268309] Mon, 23 August 2004 17:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mark.melvin.dspfactory.com

Thanks for your patience on this one, Darin. I'll try to wrap my head
around this - it is *almost* clear. :o)

Mark.

Darin Swanson wrote:

> "Mark Melvin" <mark.melvin@dspfactory.com> wrote in message
> news:cgd98v$1k7$1@eclipse.org...
>
>>OK - yeah that's one of the plugins I was looking at. However, can you
>>still use these tasks/types from within classes in the
>>org.eclipse.ant.ui plugin? The Online Help suggests this is not
>>possible. It states "The consequences are that plug-in classes do not
>>have access to the classes provided by these extra JARs."
>
>
> This is correct
>
>
>>So - I guess my problem is - I can use this approach for the cpptasks
>>JAR and place it in some plugin that will not require access to the
>>classes within it, but I can't add both my custom tasks and the cpptasks
>>together in the same plugin (like you have done in the ant.ui plugin)
>>because my custom tasks need access to the tesks and types in the
>>cpptasks JAR file. Am I making sense at all, or do I still not
>>understand...?
>
>
> You need to get a grip on what will be present on the Ant runtime classpath
> :-)
> If the cpptasks JAR is included in the Ant runtime classpath then your
> custom tasks can access these classes.
> The reason for the separation of the plugin classes and the Ant classes is
> we need to ensure that the classes are loaded by the correct classloader.
> Ant runtime classes cannot be loaded in a plugin classloader but the
> classloader that does load the Ant runtime classes has the plugin
> classloader(s) as a "parent".
> Therefore Ant classes can see plugin classes. Plugin classes cannot see Ant
> classes. Ant classes can see all other classes on the Ant runtime classpath.
>
>
>>One more question... What is the difference between using the
>>extraClasspathEntries extension point, and using the antTasks and
>>antTypes extension points?
>
>
> extraClasspathEntries are just that...JARs that a plugin would like to be
> included on the Ant runtime classpath
> Specifying a task or type you get the accompanying JAR added to the Ant
> runtime classpath for free
>
> HTH
> Darins
>
>
Re: Recommend plugin structure for Ant Tasks (+ cpptasks) [message #268324 is a reply to message #268316] Mon, 23 August 2004 18:21 Go to previous message
Eclipse UserFriend
Classloaders etc always give me a headache :-)

Don't hesitate to continue asking in this forum for help.

As well, as a task developer, if there are holes in the doc or
implementation that would make your life easier please log bug reports so we
can address these issues.

Thanks
Darins

"Mark Melvin" <mark.melvin@dspfactory.com> wrote in message
news:cgdn7a$mj2$1@eclipse.org...
> Thanks for your patience on this one, Darin. I'll try to wrap my head
> around this - it is *almost* clear. :o)
>
> Mark.
>
> Darin Swanson wrote:
>
> > "Mark Melvin" <mark.melvin@dspfactory.com> wrote in message
> > news:cgd98v$1k7$1@eclipse.org...
> >
> >>OK - yeah that's one of the plugins I was looking at. However, can you
> >>still use these tasks/types from within classes in the
> >>org.eclipse.ant.ui plugin? The Online Help suggests this is not
> >>possible. It states "The consequences are that plug-in classes do not
> >>have access to the classes provided by these extra JARs."
> >
> >
> > This is correct
> >
> >
> >>So - I guess my problem is - I can use this approach for the cpptasks
> >>JAR and place it in some plugin that will not require access to the
> >>classes within it, but I can't add both my custom tasks and the cpptasks
> >>together in the same plugin (like you have done in the ant.ui plugin)
> >>because my custom tasks need access to the tesks and types in the
> >>cpptasks JAR file. Am I making sense at all, or do I still not
> >>understand...?
> >
> >
> > You need to get a grip on what will be present on the Ant runtime
classpath
> > :-)
> > If the cpptasks JAR is included in the Ant runtime classpath then your
> > custom tasks can access these classes.
> > The reason for the separation of the plugin classes and the Ant classes
is
> > we need to ensure that the classes are loaded by the correct
classloader.
> > Ant runtime classes cannot be loaded in a plugin classloader but the
> > classloader that does load the Ant runtime classes has the plugin
> > classloader(s) as a "parent".
> > Therefore Ant classes can see plugin classes. Plugin classes cannot see
Ant
> > classes. Ant classes can see all other classes on the Ant runtime
classpath.
> >
> >
> >>One more question... What is the difference between using the
> >>extraClasspathEntries extension point, and using the antTasks and
> >>antTypes extension points?
> >
> >
> > extraClasspathEntries are just that...JARs that a plugin would like to
be
> > included on the Ant runtime classpath
> > Specifying a task or type you get the accompanying JAR added to the Ant
> > runtime classpath for free
> >
> > HTH
> > Darins
> >
> >
Previous Topic:How to specify LD_LIBRARYPATH for plugin?
Next Topic:Plugin Failed to load under V3, but loads under runtime (solved)
Goto Forum:
  


Current Time: Thu Jul 24 16:29:30 EDT 2025

Powered by FUDForum. Page generated in 0.04483 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top