https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
x

xxfast

08/18/2022, 4:45 AM
Looks like enums from depending modules are not exported by default (even when the dependency is exported). Not sure why? 🤔
Copy code
dependencies {
  api(project(":module-where-my-enum-lives"))
}
e

eygraber

08/18/2022, 6:00 AM
I think this is behind a flag to avoid unexpected side effects, like massive binaries, etc...
x

xxfast

08/18/2022, 6:13 AM
yeah, looks like its not just enums - any classes that are not directly referenced in the original module is not exported by default
g

Grégory Lureau

08/18/2022, 7:35 AM
It's exported on my project 🤔 I use binaries.executable() and
api(project(":..."))
in commonMain dependencies if this can help. (EDIT: I thought about JS but looks like you're working with iOS, my bad)
x

xxfast

08/18/2022, 9:54 AM
I have this setup
Copy code
// :app
kotlin {
  ..
  listOf(
    iosX64(),
    ..
  ).forEach { target ->
    with(target) {
      binaries {
        framework {
          baseName = "App"
          ..
          export(project(":search"))
        }
      }
    }
  }
  ..
  sourceSets {
    val iosX64Main by getting
    ..
    val iosMain by creating {
      dependsOn(commonMain)
      iosX64Main.dependsOn(this)
      ..

      dependencies {
        ..
        api(project(":search"))
      }
    }
  }
}
i noticed that once i reference this model anywhere from
:app
module, it is immediately exported. If there is not reference to it, it is not exported
22 Views