This is a annotation converter for android library
中文文档在 这里
Add annotationbox-plugin as a dependency in your main build.gradle in the root of your project:
buildscript {
dependencies {
classpath 'com.air:annotationbox-plugin:0.5'
}
}
apply the plugin and assign origin annotation and target annotation to your app/build.gradle
such as below:
apply plugin: 'com.air.annotationbox'
annotationbox {
ruleMaps = [
"com.air.annotationbox.custom.annotations.AGET":"retrofit2.http.GET",
"com.air.annotationbox.custom.annotations.AHeaders":"retrofit2.http.Headers",
]
}
Then, when you build app, you will find every annotations as ruleMaps key will convert to ruleMaps value。
This will help you encapsulate annotation.
When the third party library update version and change the annotation package name, This will help you ignore this effect.
There are some issues:
- Only support annotation in interface. So, like butterknife annotation is not support
AnnotationBox is under the BSD license. See the LICENSE file for details.