Instantly share code, notes, and snippets.

Embed
What would you like to do?
testApt to testAnnotationProcessor migration, workaround for issue: https://code.google.com/p/android/issues/detail?id=224272
android.applicationVariants.all {
def aptOutputDir = new File(buildDir, "generated/source/apt/${it.unitTestVariant.dirName}")
it.unitTestVariant.addJavaSourceFoldersToModel(aptOutputDir)
}
@TreeFrogApps

This comment has been minimized.

Show comment
Hide comment
@TreeFrogApps

TreeFrogApps Dec 1, 2016

Also marked as resolved, this is still an issue as of: gradle:2.2.2 & gradle:2.3.0-alpha2

TreeFrogApps commented Dec 1, 2016

Also marked as resolved, this is still an issue as of: gradle:2.2.2 & gradle:2.3.0-alpha2

@itsymbal

This comment has been minimized.

Show comment
Hide comment
@itsymbal

itsymbal Mar 7, 2017

For Library modules, the config is

android {
defaultConfig {
      android.libraryVariants.all {
            def aptOutputDir = new File(buildDir, "generated/source/apt/${it.unitTestVariant.dirName}")
            it.unitTestVariant.addJavaSourceFoldersToModel(aptOutputDir)
        }
}
}

itsymbal commented Mar 7, 2017

For Library modules, the config is

android {
defaultConfig {
      android.libraryVariants.all {
            def aptOutputDir = new File(buildDir, "generated/source/apt/${it.unitTestVariant.dirName}")
            it.unitTestVariant.addJavaSourceFoldersToModel(aptOutputDir)
        }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment