Hi. What’s the best way to have functions / classe...
# getting-started
p
Hi. What’s the best way to have functions / classes / etc visible across a Gradle project modules only?
internal
makes it visible only for the specific module. I see compiler supports
-Xfriend-paths
but that’s completely undocumented and as far as I know is not supported in Kotlin Gradle plugin
c
public
makes it visible outside of the module; at that point you can control consumers of the module (they have to declare a dependency on it to use it).
p
@Chris Lee yes, but this is a library — I want to have some components visible to the “library group” of modules but hidden from general consumers
a
the best alternative at the moment is an
@RequiresOptIn
annotation https://kotlinlang.org/docs/opt-in-requirements.html
p
@Adam S that’s a bit disappointing, but I guess you’re right — that’s how KotlinX coroutines does with
@InternalCoroutinesApi
👍 1
Thanks