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
<http://download.oracle.com/javase/6/docs/api/javax/lang/model/element/Element.html>
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.clem...@gmail.com>
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 <ebenza...@gmail.com> 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@eclipse.org
>> 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@eclipse.org
> 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@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to