Migration from testApt to testAnnotationProcessor

Issue #70 resolved
Karol Wrótniak created an issue

Migration guide says that "all functionality that was previously provided by android-apt is now available in the Android plugin". However for me at least one functionality is not working. Namely sources generated by processors from testApt was fully available in IDE (Android Studio 2.2 in this case) but after changing configuration to testAnnotationProcessor this stopped working. Test code compiles w/o errors but generated classes are not visible by IDE and marked red.

Basing on this android-apt source fragment I worked that around using the following snippet in build.gradle: https://gist.github.com/koral--/f99d64c72741c29431ce4e15c0e5b6d7 There is no need to wrap .all invocation by afterEvaluate

Maybe it is worth to mention this issue in migration guide.

Comments (4)

  1. Hugo Visser repo owner

    If you find something that isn't on par, I recommend filing a bug on http://b.android.com for the tools and revert back to android-apt for now. Adding snippets like that to your build.gradle works, but you'll end up copy-paste this thing on every project which is how android-apt got started :)

    Let me know the bug id and I'll add it to a known issues section.

  2. Log in to comment