abbath0767
abbath0767

Reputation: 986

How start annotationProcessing (kapt) for local library?

I write small library for annotation processing. Compile it to jar file with Gradle and add to android project. In build.gradle app lvl i added:

dependencies {

  //...
    compile files('/Users/I/Documents/Projects/my/test2/build/libs/codelib-0.3.jar')
}

and

android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true

But if i build the project java classes not genered. In another java project (not android!) all perfect works (for build i use command gradle assemble) and files creates. For annotationProcessing in another dependencies (dagger, glide) i use 'kotlin-kapt' and he works fine for there, but he not local obviously.

Upvotes: 2

Views: 1423

Answers (1)

hotkey
hotkey

Reputation: 147901

Kapt uses a separate configuration for its annotation processors, namely kapt. You need to add your JAR to that configuration as well:

dependencies {
     // ...

     kapt files('/Users/I/Documents/Projects/my/test2/build/libs/codelib-0.3.jar')
}

Upvotes: 4

Related Questions