annotationprocessor和apt配置等价物

Jon*_*put 8 android android-annotations android-gradle-plugin android-apt annotation-processor

我正在使用AndroidAnnotaion,但由于Android Studio 2.3和Gradle 2.3.0,他们说android-apt已经过时了.而且annotationProcessor是一个新的.所以,我想知道我怎么能annotationProcessorapt以前一样配置.

如果我误解了什么,请帮忙.

所以,之前......

apply plugin: 'android-apt'

dependencies {

    def AAVersion = '4.2.0'
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
}

apt {
    arguments {
        library 'true'
    }
}
Run Code Online (Sandbox Code Playgroud)

现在...

dependencies {

    def AAVersion = '4.2.0'
    annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
}
Run Code Online (Sandbox Code Playgroud)

Won*_*abo 6

您可以通过以下方式传递注释处理配置选项:

android {
  defaultConfig {
    javaCompileOptions {
      annotationProcessorOptions {
        arguments = ['library': 'true']
      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)