Jon Bailey
02/16/2023, 5:55 PMAdam S
02/16/2023, 6:00 PMmbonnin
02/16/2023, 6:02 PMnetwork an implementation dependency of shared it shouldn't be visible from your iOS and Android appsLandry Norris
02/16/2023, 6:04 PMCasey Brooks
02/16/2023, 6:05 PMapi dependency, but mark everything internal in your :network module that you don’t want accessible in :shared or your app projectsLandry Norris
02/16/2023, 6:05 PMJon Bailey
02/16/2023, 6:05 PMCasey Brooks
02/16/2023, 6:06 PMmbonnin
02/16/2023, 6:06 PMnetworking-api and networking-impl (or so, don't trust me on naming)mbonnin
02/16/2023, 6:07 PM@OptIn annotation from @Adam S would work too if you enable it module wide on shared , it's just more work to maintain these annotationsJon Bailey
02/16/2023, 6:08 PMLandry Norris
02/16/2023, 6:08 PMinternal things are accessible to anything in the same project, even across modules.Jon Bailey
02/16/2023, 6:09 PMmbonnin
02/16/2023, 6:09 PMIf the netwprk/shared modules are in the same repo, I’m almost certain thatNope, internal is "accessible in the same module only"things are accessible to anything in the same project, even across modules.internal
Landry Norris
02/16/2023, 6:10 PMCasey Brooks
02/16/2023, 6:10 PMinternal acts like public within a single gradle module, but is private to others that depend on itmbonnin
02/16/2023, 6:10 PMIf you mark it as internal, it will be visible everywhere in the same module.mbonnin
02/16/2023, 6:11 PMLandry Norris
02/16/2023, 6:11 PMmbonnin
02/16/2023, 6:12 PMah I was hoping to avoid that because then it gets chaotic as I have more modules, would the OptIn work hiding things to ObjC?Not sure about ObjC.
@OptIn is read by the Kotlin compiler so the Swift compiler might very well ignore itJon Bailey
02/16/2023, 6:13 PMmbonnin
02/16/2023, 6:14 PMLandry Norris
02/16/2023, 6:14 PM-friend-modules <path> Paths to friend modulesmbonnin
02/16/2023, 6:15 PMimplementation(project("network-impl")) to your android App (saying this to play the devil's advocate, I'm still pretty convinced multiple modules is the good solution for you)Jon Bailey
02/16/2023, 6:16 PMmkrussel
02/16/2023, 6:18 PMHiddenFromObjC that you can also use.mbonnin
02/16/2023, 6:19 PMinternal functions on public typesThis way is "easy". You can have public types in internal functions signatures. The other way is not possible (public functions exposing internal types)