WeaverLite
Simple plugin for AspectJ weaving. For example please check this library: Pury. It uses plugin for weaving library, and in the example it uses this plugin for weaving project itself.
How to use.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.nikitakozlov:weaverlite:1.0.0'
}
}
apply plugin: 'com.nikitakozlov.weaverlite'
Configuration.
You can enabled/disable it on a debug and/or release build. Default configuration looks like this.
weaverLite {
enabledForDebug = true
enabledForRelease = false
}
How to start using AspectJ.
- Add dependency on AspectJ.
dependencies { compile 'org.aspectj:aspectjrt:1.8.6' }
- Apply WeaverLite.
- Add
@AspectJ
annotation to your aspect class. - Define pointcut.
- Enjoy