Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Fwd: AspectJ with Lombok?

The ECJ packages are renamed but there are also numerous extensions here and there to support the likes of ITDs which affect type/method resolution. If you clone the AspectJ repo: https://github.com/eclipse/org.aspectj you will see the compiler in the org.eclipse.jdt.core module - the binary and src are in there. That module is actually built from the repo org.aspectj.shadows - browsing that is more complicated so I'd say glance into the src/zip. I can't say whether lombok would be compatible apart from the package prefix but my gut feeling would be that it would just work.  I wonder if running a jarjar on the lombok code to replace occurrences org org.eclipse.jdt. with org.aspectj.org.eclipse.jdt. might get it into a working state.

cheers,
Andy

On 18 September 2014 09:41, Eric B <ebenzacar@xxxxxxxxx> wrote:
Hi Andy,

Your reply just came in as I was writing my addendum.  I ran across the following post on SO that could hopefully help (http://stackoverflow.com/questions/6107197/how-does-lombok-work).

Lombok codes against a) internal javac apis and b) internal eclipse apis (in a separate processor). JSR 269 does not let you modify existing source code, but when you cast an Element to the underlying AST node, you can actually modify the AST (which is what project Lombok does).

I'm not entirely sure how much ajc deviates from ejc.  Have you just renamed all the packages to be org.aspectj?  Where would I find the sources for EJC to see how much/where AJC deviates?

Thanks,

Eric



On Thu, Sep 18, 2014 at 11:25 AM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
I had a brief look at this when we added annotation processing support to AspectJ as that is what I thought Lombok was doing. But then I discovered that I think it wanted to be run as an agent when using the Eclipse Java Compiler (on which AspectJ is based). If I recall correctly lombok had hardcoded classnames for ECJ classes in it and in AspectJ we prefix those with "org.aspectj." - that is as far as I got looking though, I'm afraid.  It would be great if someone had a bit more time than me to dig into it.  Possibly you just need a lombok that recognizes this variant of ECJ.

I think within eclipse some people have been turning on both java and aspectj builders to get it to work a little better. the java builder allowing lombok to run then AspectJ running afterwards but that sounds pretty ugly so I've never tried it.

cheers,
Andy

On 17 September 2014 20:27, Eric B <ebenzacar@xxxxxxxxx> wrote:
I'm trying to use Lombok (http://projectlombok.org/) in an AspectJ project, but when I enable AspectJ, none of my generated lombok code is added to my byte code.

I'm not entirely sure how lombok interacts with Javac, but my guess is that the ajc compiler does not recognize lombok the way javac does.

Is there anyway to make these two play nicely?  Can I configure ajc to use/recognize lombok properly?  Or am I forced to pick only one of the two technologies?

Thanks,

Eric


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users




_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top