Zach Klippenstein (he/him) [MOD]
04/13/2021, 4:48 PMRequiresOptIn
annotation, and another module that depends on that module and annotates some code with the custom annotation, the Kotlin compiler won’t actually enforce the opt-in if the dependency on the module containing the annotation is specified as implementation
or compileOnly
– it must be an api
dependency.
Even weirder, the IDE (Android Studio Arctic Fox) actually will still enforce the annotation with those other configurations – only command-line gradle builds don’t.
I haven’t seen any documentation about this requirement, and it doesn’t really make sense to me. Is this a gradle bug? A Kotlin bug? Kotlin gradle plugin bug? Or just expected behavior?tapchicoma
04/13/2021, 5:18 PMZach Klippenstein (he/him) [MOD]
04/13/2021, 5:31 PM