Let's say I have few aspects, which I have already compiled, and now I just want to compile single source file, but without recompiling the aspects, since it takes a lot of time. Is there any way to do so?
For example, I have the following:
- Trace.aj
- Log.aj
- Test.java
All of them were compiled during my "build-all", and now I've changed Test.java
and wants to recompile it using the (already compiled) aspects.
Use load-time weaving.
http://www.aspectprogrammer.org/blogs/adrian/2004/05/loadtime_weavin.html
Here's how to do it in eclipse: http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html#enabling-load-time-weaving
I'm not sure load time weaving is the right approach in this case. You typically use load time weaving when you want to modify the behaviour of classes that have already been compiled. In this case you are compiling the Test type. If the aspects are relatively stable, you can separate them into another project and build that into a jar (say trace.jar), you can then modify the AJDT configuration to add the jar to the aspect libraries (from memory, so apologies if it's not accurate, go to the project properties, select the aspectj compiler option, select the aspect libraries/path tab and add your aspect jar). Doing this means that the aspects in the jar will be applied to Test.java on each build.