资料: https://github.com/HujiangTechnology/gradle_plugin_android_aspectjx
https://www.eclipse.org/aspectj/docs.php
- 项目 build.gradle 添加
buildscript {
...
dependencies {
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.10'
}
}
- lib 项目 build.gradle 添加
apply plugin: 'com.hujiang.android-aspectjx'
// ...
dependencies {
// ...
implementation 'org.aspectj:aspectjrt:1.9.5'
}
- app 项目 build.gradle 添加
apply plugin: 'android-aspectjx'
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}