Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Bulding product with one plug-ing having aspects
Bulding product with one plug-ing having aspects [message #67815] Fri, 10 July 2009 12:06 Go to next message
Eclipse UserFriend
Originally posted by: gaston.tonietti.teracode.com

Hi guys,

I'm developing a RCP application, and I've split its functionality into many plug-ins, one of them has AspectJ capability.
So now, I need to build the application as an Eclipse product with self-update support. to address it I've followed instructions from "Andrew Niefer: Building p2 RCP products in Eclipse 3.5M6" and
"Equinox/p2/Adding Self-Update to an RCP Application".

Let me tell you what problem I have. I got it working, but when PDE Build compiles the plug-in with aspects it does it without AspectJ support, so the exported product is not working as it does not contain the
needed aspects.

After talking with Andrew Eisenberg from AJDT project, he helped me to setup a product build with AspectJ support using AJDT Build. I was able to export the entire product with all aspects working grate but I
lost a very important thing, AJDT build does not support p2.gathering property so I cannot generate the repository and I cannot install the product with p2 director either.

*So my question is:*
Can I build the product with PDE Build so I get a self-update application, but use AJDT build just for the plug-in which needs it so the product has aspects working as well?

I've tried to do it myself but without luck. Since I saw that PDE Build generates temporary build.xml files in each plug-in it must build, I created an Ant Build file with AspectJ support using PDE Tools
context menu entry on the MANIFEST file, thinking PDE will use it instead of generating one, but it is overridden by PDE Build with a regular build.xml without AspectJ support.
I also tried making the build file read-only but then PDE Build fails because it cannot write the file.

So please let me know how I can address it. I guess it can be done but I don't know how.

Thanks a lot in advance.
Gaston.
Re: Bulding product with one plug-ing having aspects [message #67898 is a reply to message #67815] Fri, 10 July 2009 15:40 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Gaston,
I don't know what is involved with building aspects. But you
essentially have 2 choices:
1) Add "custom=true" to your build.properties file. Then PDE/Build will
not overwrite the build.xml and it will use your modified script.

2) Or use customBuildCallbacks=true.
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .pde.doc.user/tasks/pde_custom_callbacks.htm
To do this, you copy
org.eclipse.pde.build/templates/plugins/customBuildCallbacks .xml into
your bundle.

Once you have defined the customBuildCallbacks=true property, if you
generate the build.xml using PDE Tools, you will notice
<subant antfile="${customBuildCallbacks}" ..> calls throughout the script.

Depending on what AspectJ needs to do, you may be able to use the
post.compile.* targets which have access to the source, the compiled
..class files, and the classpath.

-Andrew
Gaston M. Tonietti wrote:
> Hi guys,
>
> I'm developing a RCP application, and I've split its functionality into many plug-ins, one of them has AspectJ capability.
> So now, I need to build the application as an Eclipse product with self-update support. to address it I've followed instructions from "Andrew Niefer: Building p2 RCP products in Eclipse 3.5M6" and
> "Equinox/p2/Adding Self-Update to an RCP Application".
>
> Let me tell you what problem I have. I got it working, but when PDE Build compiles the plug-in with aspects it does it without AspectJ support, so the exported product is not working as it does not contain the
> needed aspects.
>
> After talking with Andrew Eisenberg from AJDT project, he helped me to setup a product build with AspectJ support using AJDT Build. I was able to export the entire product with all aspects working grate but I
> lost a very important thing, AJDT build does not support p2.gathering property so I cannot generate the repository and I cannot install the product with p2 director either.
>
> *So my question is:*
> Can I build the product with PDE Build so I get a self-update application, but use AJDT build just for the plug-in which needs it so the product has aspects working as well?
>
> I've tried to do it myself but without luck. Since I saw that PDE Build generates temporary build.xml files in each plug-in it must build, I created an Ant Build file with AspectJ support using PDE Tools
> context menu entry on the MANIFEST file, thinking PDE will use it instead of generating one, but it is overridden by PDE Build with a regular build.xml without AspectJ support.
> I also tried making the build file read-only but then PDE Build fails because it cannot write the file.
>
> So please let me know how I can address it. I guess it can be done but I don't know how.
>
> Thanks a lot in advance.
> Gaston.
Re: Bulding product with one plug-ing having aspects [message #67960 is a reply to message #67898] Fri, 10 July 2009 20:46 Go to previous message
Eclipse UserFriend
Originally posted by: gaston.tonietti.teracode.com

Thank you for answering! it was very clarifier.

Basically both build.xml files are pretty similar, the main difference is the task used to compile (inside @dot target). PDE uses javac while AJDT uses iajc and adds an extra classpath definition.
I took a look to customBuildCallbacks docs but I did not see any useful target to address such a replace, the only way I figure out is post.compile.<compilation target> where I could delete compilation
result from javac and trigger a new one using iajc task, it seems a little ugly. doesn't it?

So, I took the build.xml file generated by PDE Build and replaced javac task with an iajc one, then I added custom=true to my build.properties and it worked!
But it has an ugly side as well, build.xml has some hardcoded thinks I don't like, such absolute paths and the plug-in version everywhere. Should I handle them as properties by myself? or I have another
way?

I would like to have thinks auto-generated as much as possible.

Thanks again.
Gaston.

Andrew Niefer wrote:

> Gaston,
> I don't know what is involved with building aspects. But you
> essentially have 2 choices:
> 1) Add "custom=true" to your build.properties file. Then PDE/Build will
> not overwrite the build.xml and it will use your modified script.
>
> 2) Or use customBuildCallbacks=true.
> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .pde.doc.user/tasks/pde_custom_callbacks.htm
> To do this, you copy
> org.eclipse.pde.build/templates/plugins/customBuildCallbacks .xml into
> your bundle.
>
> Once you have defined the customBuildCallbacks=true property, if you
> generate the build.xml using PDE Tools, you will notice
> <subant antfile="${customBuildCallbacks}" ..> calls throughout the script.
>
> Depending on what AspectJ needs to do, you may be able to use the
> post.compile.* targets which have access to the source, the compiled
> .class files, and the classpath.
>
> -Andrew
> Gaston M. Tonietti wrote:
>> Hi guys,
>>
>> I'm developing a RCP application, and I've split its functionality into
>> many plug-ins, one of them has AspectJ capability. So now, I need to
>> build the application as an Eclipse product with self-update support. to
>> address it I've followed instructions from "Andrew Niefer: Building p2
>> RCP products in Eclipse 3.5M6" and "Equinox/p2/Adding Self-Update to an
>> RCP Application".
>>
>> Let me tell you what problem I have. I got it working, but when PDE Build
>> compiles the plug-in with aspects it does it without AspectJ support, so
>> the exported product is not working as it does not contain the needed
>> aspects.
>>
>> After talking with Andrew Eisenberg from AJDT project, he helped me to
>> setup a product build with AspectJ support using AJDT Build. I was able
>> to export the entire product with all aspects working grate but I lost a
>> very important thing, AJDT build does not support p2.gathering property
>> so I cannot generate the repository and I cannot install the product with
>> p2 director either.
>>
>> *So my question is:*
>> Can I build the product with PDE Build so I get a self-update
>> application, but use AJDT build just for the plug-in which needs it so
>> the product has aspects working as well?
>>
>> I've tried to do it myself but without luck. Since I saw that PDE Build
>> generates temporary build.xml files in each plug-in it must build, I
>> created an Ant Build file with AspectJ support using PDE Tools context
>> menu entry on the MANIFEST file, thinking PDE will use it instead of
>> generating one, but it is overridden by PDE Build with a regular
>> build.xml without AspectJ support. I also tried making the build file
>> read-only but then PDE Build fails because it cannot write the file.
>>
>> So please let me know how I can address it. I guess it can be done but I
>> don't know how.
>>
>> Thanks a lot in advance.
>> Gaston.
Re: Bulding product with one plug-ing having aspects [message #599248 is a reply to message #67815] Fri, 10 July 2009 15:40 Go to previous message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Gaston,
I don't know what is involved with building aspects. But you
essentially have 2 choices:
1) Add "custom=true" to your build.properties file. Then PDE/Build will
not overwrite the build.xml and it will use your modified script.

2) Or use customBuildCallbacks=true.
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .pde.doc.user/tasks/pde_custom_callbacks.htm
To do this, you copy
org.eclipse.pde.build/templates/plugins/customBuildCallbacks .xml into
your bundle.

Once you have defined the customBuildCallbacks=true property, if you
generate the build.xml using PDE Tools, you will notice
<subant antfile="${customBuildCallbacks}" ..> calls throughout the script.

Depending on what AspectJ needs to do, you may be able to use the
post.compile.* targets which have access to the source, the compiled
..class files, and the classpath.

-Andrew
Gaston M. Tonietti wrote:
> Hi guys,
>
> I'm developing a RCP application, and I've split its functionality into many plug-ins, one of them has AspectJ capability.
> So now, I need to build the application as an Eclipse product with self-update support. to address it I've followed instructions from "Andrew Niefer: Building p2 RCP products in Eclipse 3.5M6" and
> "Equinox/p2/Adding Self-Update to an RCP Application".
>
> Let me tell you what problem I have. I got it working, but when PDE Build compiles the plug-in with aspects it does it without AspectJ support, so the exported product is not working as it does not contain the
> needed aspects.
>
> After talking with Andrew Eisenberg from AJDT project, he helped me to setup a product build with AspectJ support using AJDT Build. I was able to export the entire product with all aspects working grate but I
> lost a very important thing, AJDT build does not support p2.gathering property so I cannot generate the repository and I cannot install the product with p2 director either.
>
> *So my question is:*
> Can I build the product with PDE Build so I get a self-update application, but use AJDT build just for the plug-in which needs it so the product has aspects working as well?
>
> I've tried to do it myself but without luck. Since I saw that PDE Build generates temporary build.xml files in each plug-in it must build, I created an Ant Build file with AspectJ support using PDE Tools
> context menu entry on the MANIFEST file, thinking PDE will use it instead of generating one, but it is overridden by PDE Build with a regular build.xml without AspectJ support.
> I also tried making the build file read-only but then PDE Build fails because it cannot write the file.
>
> So please let me know how I can address it. I guess it can be done but I don't know how.
>
> Thanks a lot in advance.
> Gaston.
Re: Bulding product with one plug-ing having aspects [message #599276 is a reply to message #67898] Fri, 10 July 2009 20:46 Go to previous message
Eclipse UserFriend
Originally posted by: gaston.tonietti.teracode.com

Thank you for answering! it was very clarifier.

Basically both build.xml files are pretty similar, the main difference is the task used to compile (inside @dot target). PDE uses javac while AJDT uses iajc and adds an extra classpath definition.
I took a look to customBuildCallbacks docs but I did not see any useful target to address such a replace, the only way I figure out is post.compile.<compilation target> where I could delete compilation
result from javac and trigger a new one using iajc task, it seems a little ugly. doesn't it?

So, I took the build.xml file generated by PDE Build and replaced javac task with an iajc one, then I added custom=true to my build.properties and it worked!
But it has an ugly side as well, build.xml has some hardcoded thinks I don't like, such absolute paths and the plug-in version everywhere. Should I handle them as properties by myself? or I have another
way?

I would like to have thinks auto-generated as much as possible.

Thanks again.
Gaston.

Andrew Niefer wrote:

> Gaston,
> I don't know what is involved with building aspects. But you
> essentially have 2 choices:
> 1) Add "custom=true" to your build.properties file. Then PDE/Build will
> not overwrite the build.xml and it will use your modified script.
>
> 2) Or use customBuildCallbacks=true.
> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .pde.doc.user/tasks/pde_custom_callbacks.htm
> To do this, you copy
> org.eclipse.pde.build/templates/plugins/customBuildCallbacks .xml into
> your bundle.
>
> Once you have defined the customBuildCallbacks=true property, if you
> generate the build.xml using PDE Tools, you will notice
> <subant antfile="${customBuildCallbacks}" ..> calls throughout the script.
>
> Depending on what AspectJ needs to do, you may be able to use the
> post.compile.* targets which have access to the source, the compiled
> .class files, and the classpath.
>
> -Andrew
> Gaston M. Tonietti wrote:
>> Hi guys,
>>
>> I'm developing a RCP application, and I've split its functionality into
>> many plug-ins, one of them has AspectJ capability. So now, I need to
>> build the application as an Eclipse product with self-update support. to
>> address it I've followed instructions from "Andrew Niefer: Building p2
>> RCP products in Eclipse 3.5M6" and "Equinox/p2/Adding Self-Update to an
>> RCP Application".
>>
>> Let me tell you what problem I have. I got it working, but when PDE Build
>> compiles the plug-in with aspects it does it without AspectJ support, so
>> the exported product is not working as it does not contain the needed
>> aspects.
>>
>> After talking with Andrew Eisenberg from AJDT project, he helped me to
>> setup a product build with AspectJ support using AJDT Build. I was able
>> to export the entire product with all aspects working grate but I lost a
>> very important thing, AJDT build does not support p2.gathering property
>> so I cannot generate the repository and I cannot install the product with
>> p2 director either.
>>
>> *So my question is:*
>> Can I build the product with PDE Build so I get a self-update
>> application, but use AJDT build just for the plug-in which needs it so
>> the product has aspects working as well?
>>
>> I've tried to do it myself but without luck. Since I saw that PDE Build
>> generates temporary build.xml files in each plug-in it must build, I
>> created an Ant Build file with AspectJ support using PDE Tools context
>> menu entry on the MANIFEST file, thinking PDE will use it instead of
>> generating one, but it is overridden by PDE Build with a regular
>> build.xml without AspectJ support. I also tried making the build file
>> read-only but then PDE Build fails because it cannot write the file.
>>
>> So please let me know how I can address it. I guess it can be done but I
>> don't know how.
>>
>> Thanks a lot in advance.
>> Gaston.
Previous Topic:Editor plugin doesn't work on Mac
Next Topic:Error updating product with p2
Goto Forum:
  


Current Time: Wed Apr 24 21:33:22 GMT 2024

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

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

Back to the top