curioustechizen
12/07/2023, 11:00 AM:kmp:shared
- This contains ClassId
as shown in the thread
• :kmp:feature1
- This contains AuthToken
as shown in the thread
I can access ClassIdCompanion
from my Swift code, but I don't see AuthTokenCompanion
curioustechizen
12/07/2023, 11:01 AM:kmp:shared
module - this is the one that is exported to Swift:
interface ClassId {
val value: Int
fun isValid(): Boolean = value >= 0
companion object {
val Invalid = withValue(-1)
fun withValue(value: Int): ClassId = ClassIdImpl(value)
}
}
@JvmInline
private value class ClassIdImpl(override val value: Int) : ClassId
curioustechizen
12/07/2023, 11:03 AM:kmp:feature1
module - this is not exported to Swift; just the implementation(projects.kmp.feature1)
dependency is declared
interface AuthToken {
val token: String
companion object {
fun of(token: String): AuthToken = AuthTokenImpl(token)
}
}
@JvmInline
private value class AuthTokenImpl(override val token: String) : AuthToken
curioustechizen
12/07/2023, 11:04 AMMypackageAuthToken
but I cannot see MypackageAuthTokenCompanion
that allows me to create an instance.Jan Holešovský
12/07/2023, 11:55 AMcurioustechizen
12/07/2023, 12:34 PMcurioustechizen
12/07/2023, 12:35 PMObjCName
annotations would help?curioustechizen
12/07/2023, 12:36 PM:kmp:shared
module has this snippet that configures the binaries. I don't have this snippet in any other multiplatform module that :kmp:shared
depends on. Wonder if that has any impact:
target.binaries.framework {
baseName = "KMPShared"
}
Jan Holešovský
12/07/2023, 2:03 PMJan Holešovský
12/07/2023, 2:04 PMDaniel Seither
12/07/2023, 2:26 PMcurioustechizen
12/07/2023, 4:09 PMcommonMain { dependencies {}}
block?
Another way of asking the same question is, if I don't use export(project(":moduleName"))
, will symbols present in ":moduleName"
not be visible to Swift?Daniel Seither
12/07/2023, 4:15 PMexport(…)
changes this.curioustechizen
12/07/2023, 4:22 PMonly the types from the dependencies that are used in any interfaces exported by the main moduleThis was the missing part of the puzzle. Thanks.