Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » A question about using AJDT in plugin projects
A question about using AJDT in plugin projects [message #64906] Thu, 18 May 2006 13:29 Go to next message
Eclipse UserFriend
Originally posted by: sbederml.gmail.com

Hi,

I'm working on a way of adding aspects to existing plugins. The problem is
that after importing an existing plugin as binary project with linked
content, it is not possible to add aspects to it. Though, there is no
problem when the project is imported with it sources, instead of with
linked content.

So my question is: is there a way to add aspets to binary plugin projects
with linked content?

Thank you in advance,
Michael
Re: A question about using AJDT in plugin projects [message #65022 is a reply to message #64906] Fri, 19 May 2006 12:17 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Michael Beder wrote:
> I'm working on a way of adding aspects to existing plugins. The problem
> is that after importing an existing plugin as binary project with linked
> content, it is not possible to add aspects to it. Though, there is no
> problem when the project is imported with it sources, instead of with
> linked content.
>
> So my question is: is there a way to add aspets to binary plugin
> projects with linked content?

It's not as straightforward, but you can do binary weaving. For example
if the plugin has its class files in a jar file called foo.jar, rename
it to say foo-orig.jar, then weave in the aspects sending the output to
a new (woven) foo.jar. You can do this manually in eclipse using a
separate AspectJ project to do the weaving in, using the inpath and
outjar settings, or you could automate the process with an Ant script.

An alternative approach would be to weave the plugin at load-time. See
for example the equinox incubator project that is looking into this:
http://www.eclipse.org/equinox/incubator/aspects/

Regards,

Matt.
Re: A question about using AJDT in plugin projects [message #65043 is a reply to message #65022] Sat, 20 May 2006 02:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sbederml.gmail.com

Thank you very much, Matt :)

I've managed to manually add aspects to imported plugins as binary
projects with linked content, using the following way (for
org.eclipse.search plugin):

1) Import the plugin with linked content
2) Convert the project to AspectJ project
3) Add a source folder and an aspect within it

In project properties:

4) Add org.eclipse.search.jar to AspectJ InPath
5) Set AspectJ Output jar to new jar, e.g. org.eclipse.search-weaved.jar
6) Replace org.eclipse.search.jar with org.eclipse.search-weaved.jar in
the build path

And that's it. Each weaving produces an org.eclipse.search-weaved.jar
with the added aspect, and this jar is being run.

But the problem is that I need this process to be automatic. The
problematic things is changing an AspectJ project InPath and Output jar
- is there way to do it programatically?

Thanks,
Michael

Matt Chapman wrote:
> Michael Beder wrote:
>
>> I'm working on a way of adding aspects to existing plugins. The
>> problem is that after importing an existing plugin as binary project
>> with linked content, it is not possible to add aspects to it. Though,
>> there is no problem when the project is imported with it sources,
>> instead of with linked content.
>>
>> So my question is: is there a way to add aspets to binary plugin
>> projects with linked content?
>
>
> It's not as straightforward, but you can do binary weaving. For example
> if the plugin has its class files in a jar file called foo.jar, rename
> it to say foo-orig.jar, then weave in the aspects sending the output to
> a new (woven) foo.jar. You can do this manually in eclipse using a
> separate AspectJ project to do the weaving in, using the inpath and
> outjar settings, or you could automate the process with an Ant script.
>
> An alternative approach would be to weave the plugin at load-time. See
> for example the equinox incubator project that is looking into this:
> http://www.eclipse.org/equinox/incubator/aspects/
>
> Regards,
>
> Matt.
Re: A question about using AJDT in plugin projects [message #65234 is a reply to message #65043] Tue, 23 May 2006 19:08 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Michael Beder wrote:

> But the problem is that I need this process to be automatic. The
> problematic things is changing an AspectJ project InPath and Output jar
> - is there way to do it programatically?

Changing those settings updates properties files under .settings in the
project, so you might be able to automate it that way. Alternatively you
could generate an Ant build file to build the project and then modify it
appropriately - such as adding options to the iajc task.

Regards,

Matt.
Re: A question about using AJDT in plugin projects [message #65447 is a reply to message #65234] Fri, 26 May 2006 13:56 Go to previous message
Eclipse UserFriend
Originally posted by: sbederml.gmail.com

Thank you! changing ajdt properties in .settings folder is just what I
needed.

Michael

Matt Chapman wrote:
> Michael Beder wrote:
>
>> But the problem is that I need this process to be automatic. The
>> problematic things is changing an AspectJ project InPath and Output
>> jar - is there way to do it programatically?
>
>
> Changing those settings updates properties files under .settings in the
> project, so you might be able to automate it that way. Alternatively you
> could generate an Ant build file to build the project and then modify it
> appropriately - such as adding options to the iajc task.
>
> Regards,
>
> Matt.
>
Re: A question about using AJDT in plugin projects [message #593711 is a reply to message #64906] Fri, 19 May 2006 12:17 Go to previous message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Michael Beder wrote:
> I'm working on a way of adding aspects to existing plugins. The problem
> is that after importing an existing plugin as binary project with linked
> content, it is not possible to add aspects to it. Though, there is no
> problem when the project is imported with it sources, instead of with
> linked content.
>
> So my question is: is there a way to add aspets to binary plugin
> projects with linked content?

It's not as straightforward, but you can do binary weaving. For example
if the plugin has its class files in a jar file called foo.jar, rename
it to say foo-orig.jar, then weave in the aspects sending the output to
a new (woven) foo.jar. You can do this manually in eclipse using a
separate AspectJ project to do the weaving in, using the inpath and
outjar settings, or you could automate the process with an Ant script.

An alternative approach would be to weave the plugin at load-time. See
for example the equinox incubator project that is looking into this:
http://www.eclipse.org/equinox/incubator/aspects/

Regards,

Matt.
Re: A question about using AJDT in plugin projects [message #593756 is a reply to message #65022] Sat, 20 May 2006 02:48 Go to previous message
Eclipse UserFriend
Originally posted by: sbederml.gmail.com

Thank you very much, Matt :)

I've managed to manually add aspects to imported plugins as binary
projects with linked content, using the following way (for
org.eclipse.search plugin):

1) Import the plugin with linked content
2) Convert the project to AspectJ project
3) Add a source folder and an aspect within it

In project properties:

4) Add org.eclipse.search.jar to AspectJ InPath
5) Set AspectJ Output jar to new jar, e.g. org.eclipse.search-weaved.jar
6) Replace org.eclipse.search.jar with org.eclipse.search-weaved.jar in
the build path

And that's it. Each weaving produces an org.eclipse.search-weaved.jar
with the added aspect, and this jar is being run.

But the problem is that I need this process to be automatic. The
problematic things is changing an AspectJ project InPath and Output jar
- is there way to do it programatically?

Thanks,
Michael

Matt Chapman wrote:
> Michael Beder wrote:
>
>> I'm working on a way of adding aspects to existing plugins. The
>> problem is that after importing an existing plugin as binary project
>> with linked content, it is not possible to add aspects to it. Though,
>> there is no problem when the project is imported with it sources,
>> instead of with linked content.
>>
>> So my question is: is there a way to add aspets to binary plugin
>> projects with linked content?
>
>
> It's not as straightforward, but you can do binary weaving. For example
> if the plugin has its class files in a jar file called foo.jar, rename
> it to say foo-orig.jar, then weave in the aspects sending the output to
> a new (woven) foo.jar. You can do this manually in eclipse using a
> separate AspectJ project to do the weaving in, using the inpath and
> outjar settings, or you could automate the process with an Ant script.
>
> An alternative approach would be to weave the plugin at load-time. See
> for example the equinox incubator project that is looking into this:
> http://www.eclipse.org/equinox/incubator/aspects/
>
> Regards,
>
> Matt.
Re: A question about using AJDT in plugin projects [message #593843 is a reply to message #65043] Tue, 23 May 2006 19:08 Go to previous message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Michael Beder wrote:

> But the problem is that I need this process to be automatic. The
> problematic things is changing an AspectJ project InPath and Output jar
> - is there way to do it programatically?

Changing those settings updates properties files under .settings in the
project, so you might be able to automate it that way. Alternatively you
could generate an Ant build file to build the project and then modify it
appropriately - such as adding options to the iajc task.

Regards,

Matt.
Re: A question about using AJDT in plugin projects [message #593954 is a reply to message #65234] Fri, 26 May 2006 13:56 Go to previous message
Eclipse UserFriend
Originally posted by: sbederml.gmail.com

Thank you! changing ajdt properties in .settings folder is just what I
needed.

Michael

Matt Chapman wrote:
> Michael Beder wrote:
>
>> But the problem is that I need this process to be automatic. The
>> problematic things is changing an AspectJ project InPath and Output
>> jar - is there way to do it programatically?
>
>
> Changing those settings updates properties files under .settings in the
> project, so you might be able to automate it that way. Alternatively you
> could generate an Ant build file to build the project and then modify it
> appropriately - such as adding options to the iajc task.
>
> Regards,
>
> Matt.
>
Previous Topic:AJDT New Feature: New Plug-in Example
Next Topic:A question about adding AspectJ nature to a plugin project programmatically
Goto Forum:
  


Current Time: Tue Apr 16 11:19:55 GMT 2024

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

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

Back to the top