Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Custom Ant tasks and runtime jar libraries
Custom Ant tasks and runtime jar libraries [message #525734] Wed, 07 April 2010 11:40 Go to next message
Eclipse User
Originally posted by: cold.phusion.gmail.com

Hi guys,

I'm trying to define a custom Ant task as an extension which later
should be used in a RCP application. Basically, what I want is an Ant
task which would be available for all plug-ins that are depending on
mine. I've read a lot about the different JVMs and classloaders when
using Ant and Eclipse (I think I got the main point), so I' familiar
with the issue.

However, I can't seem to load any Ant task extensions into my Runtime
Eclipse environment, even when I check out org.eclipse.emf.ant from CVS.
When I disable the installed plug-in and activate the one in my
workspace, I get the following error in my error log (in the Runtime
environment):
The library "ant_tasks/emf.ant.tasks.jar" specified from
"org.eclipse.emf.ant" for the antTasks or antTypes extension does not exist.
Apparently, the runtime library is not built and the extension cannot be
instantiated (I have no compiler errors whatsoever). To be fair, the
plugin.xml of the project contains a comment which probably regards this
issue:
<!-- Replace 'ant_tasks/emf.ant.tasks.jar' by
'ant_tasks/emf.ant.tasks.jar' to be able to debug without regenerating
jars -->
but this doesn't make any sense whichever way you slice it o_O.

Is there any particular way of deploying such Ant tasks in a RCP
environment? Or may be I am missing something? I guess building the Jar
manually might do the trick, but isn't that what the runtime libraries
are for?
Thanks :)

Best regards,
Alex
Re: Custom Ant tasks and runtime jar libraries [message #528488 is a reply to message #525734] Tue, 20 April 2010 12:18 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew Niefer
Messages: 990
Registered: July 2009
Senior Member
Hi Alex,
The ant tasks need to live in a separate jar from the rest of the bundle
because of how the ant classloaders work. This means the ant tasks
should be kept in a separate source folder which uses a different output
folder than the default

See this help page:
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/ant_contributing_task.htm

I looked at the org.eclipse.emf.ant plugin, it is set up correctly.
You will need that emf.ant.tasks.jar in order to use it in a self hosted
eclipse. The easiest way to do this is to right click on the Manifest
and do PDE Tools -> Create Ant Build File. Right click on the generated
build.xml and do Run As -> Ant Build.

This will create the jar for you. Some projects write a local_build.xml
that is added as an external builder to create the jar automatically
whenever something changes.
-Andrew

Alex Shterev wrote:
> Hi guys,
>
> I'm trying to define a custom Ant task as an extension which later
> should be used in a RCP application. Basically, what I want is an Ant
> task which would be available for all plug-ins that are depending on
> mine. I've read a lot about the different JVMs and classloaders when
> using Ant and Eclipse (I think I got the main point), so I' familiar
> with the issue.
>
> However, I can't seem to load any Ant task extensions into my Runtime
> Eclipse environment, even when I check out org.eclipse.emf.ant from CVS.
> When I disable the installed plug-in and activate the one in my
> workspace, I get the following error in my error log (in the Runtime
> environment):
> The library "ant_tasks/emf.ant.tasks.jar" specified from
> "org.eclipse.emf.ant" for the antTasks or antTypes extension does not
> exist.
> Apparently, the runtime library is not built and the extension cannot be
> instantiated (I have no compiler errors whatsoever). To be fair, the
> plugin.xml of the project contains a comment which probably regards this
> issue:
> <!-- Replace 'ant_tasks/emf.ant.tasks.jar' by
> 'ant_tasks/emf.ant.tasks.jar' to be able to debug without regenerating
> jars -->
> but this doesn't make any sense whichever way you slice it o_O.
>
> Is there any particular way of deploying such Ant tasks in a RCP
> environment? Or may be I am missing something? I guess building the Jar
> manually might do the trick, but isn't that what the runtime libraries
> are for?
> Thanks :)
>
> Best regards,
> Alex
Re: Custom Ant tasks and runtime jar libraries [message #529207 is a reply to message #528488] Fri, 23 April 2010 09:06 Go to previous message
Alex Shterev is currently offline Alex Shterev
Messages: 20
Registered: April 2010
Junior Member
Hi Andrew,

thank you for your reply. Yes, I read the help section on contributing
an Ant task and I understood almost everything except for the part of
deploying that jar file. I assumed it was going to be built by the
standard PDE builder on the fly and will be automatically provided at
runtime to the self hosted Eclipse instance. I tried exporting the
classes as a Jar using Export > Java > Jar file, but it didn't do the
job. Unfortunately it never crossed my mind to check out the Ant PDE
build... :|
I'll try it out later on and I'll get back to you if I have any further
questions.

Thx once again,
Alex

Am 20.04.2010 18:18, schrieb Andrew Niefer:
> Hi Alex,
> The ant tasks need to live in a separate jar from the rest of the bundle
> because of how the ant classloaders work. This means the ant tasks
> should be kept in a separate source folder which uses a different output
> folder than the default
>
> See this help page:
> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/ant_contributing_task.htm
>
>
> I looked at the org.eclipse.emf.ant plugin, it is set up correctly.
> You will need that emf.ant.tasks.jar in order to use it in a self hosted
> eclipse. The easiest way to do this is to right click on the Manifest
> and do PDE Tools -> Create Ant Build File. Right click on the generated
> build.xml and do Run As -> Ant Build.
>
> This will create the jar for you. Some projects write a local_build.xml
> that is added as an external builder to create the jar automatically
> whenever something changes.
> -Andrew
>
> Alex Shterev wrote:
>> Hi guys,
>>
>> I'm trying to define a custom Ant task as an extension which later
>> should be used in a RCP application. Basically, what I want is an Ant
>> task which would be available for all plug-ins that are depending on
>> mine. I've read a lot about the different JVMs and classloaders when
>> using Ant and Eclipse (I think I got the main point), so I' familiar
>> with the issue.
>>
>> However, I can't seem to load any Ant task extensions into my Runtime
>> Eclipse environment, even when I check out org.eclipse.emf.ant from
>> CVS. When I disable the installed plug-in and activate the one in my
>> workspace, I get the following error in my error log (in the Runtime
>> environment):
>> The library "ant_tasks/emf.ant.tasks.jar" specified from
>> "org.eclipse.emf.ant" for the antTasks or antTypes extension does not
>> exist.
>> Apparently, the runtime library is not built and the extension cannot
>> be instantiated (I have no compiler errors whatsoever). To be fair,
>> the plugin.xml of the project contains a comment which probably
>> regards this issue:
>> <!-- Replace 'ant_tasks/emf.ant.tasks.jar' by
>> 'ant_tasks/emf.ant.tasks.jar' to be able to debug without regenerating
>> jars -->
>> but this doesn't make any sense whichever way you slice it o_O.
>>
>> Is there any particular way of deploying such Ant tasks in a RCP
>> environment? Or may be I am missing something? I guess building the
>> Jar manually might do the trick, but isn't that what the runtime
>> libraries are for?
>> Thanks :)
>>
>> Best regards,
>> Alex
Re: Custom Ant tasks and runtime jar libraries [message #605630 is a reply to message #525734] Tue, 20 April 2010 12:18 Go to previous message
Andrew Niefer is currently offline Andrew Niefer
Messages: 990
Registered: July 2009
Senior Member
Hi Alex,
The ant tasks need to live in a separate jar from the rest of the bundle
because of how the ant classloaders work. This means the ant tasks
should be kept in a separate source folder which uses a different output
folder than the default

See this help page:
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/ant_contributing_task.htm

I looked at the org.eclipse.emf.ant plugin, it is set up correctly.
You will need that emf.ant.tasks.jar in order to use it in a self hosted
eclipse. The easiest way to do this is to right click on the Manifest
and do PDE Tools -> Create Ant Build File. Right click on the generated
build.xml and do Run As -> Ant Build.

This will create the jar for you. Some projects write a local_build.xml
that is added as an external builder to create the jar automatically
whenever something changes.
-Andrew

Alex Shterev wrote:
> Hi guys,
>
> I'm trying to define a custom Ant task as an extension which later
> should be used in a RCP application. Basically, what I want is an Ant
> task which would be available for all plug-ins that are depending on
> mine. I've read a lot about the different JVMs and classloaders when
> using Ant and Eclipse (I think I got the main point), so I' familiar
> with the issue.
>
> However, I can't seem to load any Ant task extensions into my Runtime
> Eclipse environment, even when I check out org.eclipse.emf.ant from CVS.
> When I disable the installed plug-in and activate the one in my
> workspace, I get the following error in my error log (in the Runtime
> environment):
> The library "ant_tasks/emf.ant.tasks.jar" specified from
> "org.eclipse.emf.ant" for the antTasks or antTypes extension does not
> exist.
> Apparently, the runtime library is not built and the extension cannot be
> instantiated (I have no compiler errors whatsoever). To be fair, the
> plugin.xml of the project contains a comment which probably regards this
> issue:
> <!-- Replace 'ant_tasks/emf.ant.tasks.jar' by
> 'ant_tasks/emf.ant.tasks.jar' to be able to debug without regenerating
> jars -->
> but this doesn't make any sense whichever way you slice it o_O.
>
> Is there any particular way of deploying such Ant tasks in a RCP
> environment? Or may be I am missing something? I guess building the Jar
> manually might do the trick, but isn't that what the runtime libraries
> are for?
> Thanks :)
>
> Best regards,
> Alex
Re: Custom Ant tasks and runtime jar libraries [message #605662 is a reply to message #528488] Fri, 23 April 2010 09:06 Go to previous message
Alex Shterev is currently offline Alex Shterev
Messages: 20
Registered: April 2010
Junior Member
Hi Andrew,

thank you for your reply. Yes, I read the help section on contributing
an Ant task and I understood almost everything except for the part of
deploying that jar file. I assumed it was going to be built by the
standard PDE builder on the fly and will be automatically provided at
runtime to the self hosted Eclipse instance. I tried exporting the
classes as a Jar using Export > Java > Jar file, but it didn't do the
job. Unfortunately it never crossed my mind to check out the Ant PDE
build... :|
I'll try it out later on and I'll get back to you if I have any further
questions.

Thx once again,
Alex

Am 20.04.2010 18:18, schrieb Andrew Niefer:
> Hi Alex,
> The ant tasks need to live in a separate jar from the rest of the bundle
> because of how the ant classloaders work. This means the ant tasks
> should be kept in a separate source folder which uses a different output
> folder than the default
>
> See this help page:
> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/ant_contributing_task.htm
>
>
> I looked at the org.eclipse.emf.ant plugin, it is set up correctly.
> You will need that emf.ant.tasks.jar in order to use it in a self hosted
> eclipse. The easiest way to do this is to right click on the Manifest
> and do PDE Tools -> Create Ant Build File. Right click on the generated
> build.xml and do Run As -> Ant Build.
>
> This will create the jar for you. Some projects write a local_build.xml
> that is added as an external builder to create the jar automatically
> whenever something changes.
> -Andrew
>
> Alex Shterev wrote:
>> Hi guys,
>>
>> I'm trying to define a custom Ant task as an extension which later
>> should be used in a RCP application. Basically, what I want is an Ant
>> task which would be available for all plug-ins that are depending on
>> mine. I've read a lot about the different JVMs and classloaders when
>> using Ant and Eclipse (I think I got the main point), so I' familiar
>> with the issue.
>>
>> However, I can't seem to load any Ant task extensions into my Runtime
>> Eclipse environment, even when I check out org.eclipse.emf.ant from
>> CVS. When I disable the installed plug-in and activate the one in my
>> workspace, I get the following error in my error log (in the Runtime
>> environment):
>> The library "ant_tasks/emf.ant.tasks.jar" specified from
>> "org.eclipse.emf.ant" for the antTasks or antTypes extension does not
>> exist.
>> Apparently, the runtime library is not built and the extension cannot
>> be instantiated (I have no compiler errors whatsoever). To be fair,
>> the plugin.xml of the project contains a comment which probably
>> regards this issue:
>> <!-- Replace 'ant_tasks/emf.ant.tasks.jar' by
>> 'ant_tasks/emf.ant.tasks.jar' to be able to debug without regenerating
>> jars -->
>> but this doesn't make any sense whichever way you slice it o_O.
>>
>> Is there any particular way of deploying such Ant tasks in a RCP
>> environment? Or may be I am missing something? I guess building the
>> Jar manually might do the trick, but isn't that what the runtime
>> libraries are for?
>> Thanks :)
>>
>> Best regards,
>> Alex
Previous Topic:F12 and F10 Keys won't work when using SWT components in PDE
Next Topic:View for displaying information for java files opened in the editor.
Goto Forum:
  


Current Time: Tue Jul 22 13:32:35 EDT 2014

Powered by FUDForum. Page generated in 0.02319 seconds