簡體   English   中英

注解處理器和apt配置等效項

[英]annotationprocessor and apt configure equivalent

我正在使用AndroidAnnotaion ,但是由於Android Studio 2.3和Gradle 2.3.0,他們說android-apt已過時。 annotationProcessor是一個新的。 因此,我想知道如何像以前使用apt一樣配置annotationProcessor

如果我誤會了什么,請幫忙。

所以,在...之前

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'
    }
}

現在...

dependencies {

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

您可以通過以下方式傳遞注釋處理配置選項:

android {
  defaultConfig {
    javaCompileOptions {
      annotationProcessorOptions {
        arguments = ['library': 'true']
      }
    }
  }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM