Bradleycorn
02/08/2023, 6:14 PMstorage
, which implements a SqlDelight DB, per the SqlDelight Documentation (it’s worth noting that docs specify using implementation()
for dependencies). I have a second module feature
which has a dependency on the storage
module, like so:
sourceSets {
val commonMain by getting {
dependencies {
implementation(project(":shared:storage"))
}
}
}
In my feature
module, I can see/import/use classes and objects from the SqlDelight library:
import app.cash.sqldelight.EnumColumnAdapter
...
val someValue = EnumColumnAdapter<MyEnum>().encode(someEnumValue)
That seems … not right? SqlDelight is an implementation detail of the storage
module, and should not be exposed to other modules that have a dependency on storage
. What am I missing here? I’m a bit of a novice with gradle, so perhaps it’s something obvious.Kirill Zhukov
02/08/2023, 8:55 PMstorage
is the module that generates the queries and schemas, that code is added to the module’s source set. So your feature
module gets access to those non-internal/private APIs, just like any other code.implementation
just means that APIs from :shared:storage
won’t be further exposed to other modules that pull in feature
module.Bradleycorn
02/08/2023, 9:37 PMI guess I thought that same logic would apply … because I usejust means that APIs fromimplementation
won’t be further exposed to other modules that pull in:shared:storage
module.feature
implementation("app.cash.sqlDelight")
in :shared:storage
, so none of the sql delight api’s would be further exposed to things (like :shared:feature
) that pull in the storage
module.