Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Incremental Compile Time Weaving

Hi Justin,

AJDT (the eclipse support for AspectJ) drives AspectJ for incremental compilation.  There is a complex state object that is produced by the first ‘full build’ (so you always get a first full build when you open the IDE) but after that the state object is used to do minimal builds for any changes you make.(the state object could be persisted on disk but that code hasn’t been written…).

It is similar to the incremental compilation approach taken by Eclipse JDT but obviously aspects make it a little more complicated. You can see in https://github.com/eclipse/org.aspectj/blob/d5dada81e503e257d20e2aa829716fb5c3934072/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java that there are (full) batchBuild() method and an incrementalBuild() method. 

Digging through AJDT to explore how that gets used is perhaps challenging but there are https://github.com/eclipse/org.aspectj/blob/591afb3a599dc2b3dd5811c6c7e74e7e5f3c5c01/tests/src/test/java/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java tests for incremental compilation and the harness they use - https://github.com/eclipse/org.aspectj/blob/884ced970ee8d04bfb89a53ec1a40fcb848db2b6/tests/src/test/java/org/aspectj/systemtest/incremental/tools/AbstractMultiProjectIncrementalAjdeInteractionTestbed.java can perhaps give you hints about how the compiler is initially setup then subsequent incremental build requests are made. The tests are building a project, then changing some file within it, then driving an incremental build and checking the expected things (and only those) are built/woven.  I don’t think there are up to date docs for the whole implementation unfortunately. 

Cheers,
Andy

On Sep 8, 2020, at 11:44 AM, Justin Tullgren <jtullgren@xxxxxxxxxxxxxxx> wrote:

Hi,
 
I am investigating if the AJ compiler supports incremental compilations. Is it possible to weave byte code for only modified types?  If yes, can anyone please point me to the developer documentation for it?
 
Thank you,
JT
Justin Tullgren
Senior Software Engineer
T 
M 603-512-2826
jtullgren@xxxxxxxxxxxxxxx


“Watch 

Read the Forrester Wave 
Thunderhead is the trading name of Thunderhead One, Inc. which is registered in Virginia, USA under No. 07993165 whose registered office is at Suite 4017, 250 Commercial Street, Manchester, NH 03101.
The contents of this e-mail are intended for the named addressee only. It contains confidential information. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/aspectj-dev


Back to the top