annotationprocessor and apt configure equivalent
Z

1

8

I'm using AndroidAnnotaion, but due to Android Studio 2.3 and Gradle 2.3.0, they said android-apt was obsoleted. And annotationProcessor is a new one. so, I want to know how can I configure annotationProcessor like I do with apt before.

If I misunderstand something, please help.

So, before...

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

and now...

dependencies {

    def AAVersion = '4.2.0'
    annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
}
Zohar answered 6/3, 2017 at 9:36 Comment(4)
Did you check the migration guide? bitbucket.org/hvisser/android-apt/wiki/MigrationCoxalgia
Looks like you need to configure arguments, like you did with android-apt.Boatwright
@Boatwright yeah...Zohar
@GabrieleMariotti, nope I will check it.Zohar
D
7

You can pass annotation processing configuration options in the following way:

android {
  defaultConfig {
    javaCompileOptions {
      annotationProcessorOptions {
        arguments = ['library': 'true']
      }
    }
  }
}
Dogeared answered 12/3, 2017 at 18:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.