AspectJ within Android Studio

Hello to everyone!

I'm experimenting with AspectJ plugin for Android development under Gradle build system. Well, I've sucessfully developed and deployed (but not yet published somewhere) gradle compile plugin for Android Studio to build aspects suppling modern popular plugins, such as Android Annotations, Dagger, Retrolambda, etc. At this point I've decided to integrate language highlighting and code assistment into the Studio.
And I found that Ultimate edition supports AspectJ by default, but not community edition (which Android Studio is based on). I've tried to port this plugin under the Studio.
Some success I've got. But not everything works well.
In details:
+ Studio launches and works stable
+ projects properly builds and launches
+ aspects correctly compiles and injects into classes dex
- File roots navBar doesn't work
- Run / Debug / Attach Debugger menu options doesn't work

Well, this negatives doesn't brake my work and I can even write aspectJ/Java code as usually, but it looks ugly and makes me feel sad.
Is there any chance or opportunity to make this plugin work for Android Studio? Or maybe some way to buy or obtain it? :)

P.S. My gradle plugin:
In attachments is how it looks now in editor with modified AspectJ Support plugin from IntelliJ Ultimate edition.

Comment actions Permalink

Is there any chance or opportunity to make this plugin work for Android Studio?

At the moment, it's not possible technically - the plugin depends on some parts of a Spring plugin (which is only available in Ultimate). There are plans to break the dependency and move the AspectJ plugin to Community, but they are uncertain.

Comment actions Permalink

And thanks for your response!

That's great that you plan (even if that's make to wait for some weeks or months) to make a community version.
But this problem made me to play with ultimate's version and after I spent some hours in byte-code editor, I've yet oddly make it works.
I've used only aop-common and aspectj plugins, removed dependeincies with com.intellij.ultimate and some classes, related to the ultimate version.
Now I have it almost fully works (pointcuts doesn't highlight and assist classes and methods I describe there) in two packaed zip-files and tested within different Android Studio's configs and versions (1.2-1.3 and different minors).
The important thing is I don't use aspectj-jps, because my AspectJGradlePlugin defines custom compile-order and declares ajc-tasks itself.

On this point I'd want to ask am I can share my work and use it on my own risk? Of cause I didn't and won't touch any copyrights :)

Comment actions Permalink

Removing a dependency on Ultimate falls under the definition of Software Cracking and, in general, is an illegal activity. So I'd kindly ask you not to do this.


Please sign in to leave a comment.