natpryce

    natpryce

    3 years ago
    Does the kotlin-multiplatform plugin create standard source-sets that are dependencies of all native targets? E.g. it creates the standard commonMain and commonTest source sets, which are dependencies of all targets, which can contain code that uses kotlin-stdlib-common. Is there equivalent for native targets, which relies on stdlib features common to all native platforms? (is that even a thing?)
    i

    icarumbas

    3 years ago
    You can use dependsOn with source sets. Create commonNative in sourceSets and depend on it
    natpryce

    natpryce

    3 years ago
    which dependency should I use in the commonNative source set to get stdlib definitions for all native platforms?
    i

    icarumbas

    3 years ago
    everything u need is already in common
    natpryce

    natpryce

    3 years ago
    Not in 1.3.20 it’s not. Common doesn’t have Char.isLetter, Char.isDigit, but they do exist on native platforms
    m

    max.cruz

    3 years ago
    Notice that Char.isDigit isn’t in Common, just in JVM and Native, so my solution is to create an extension function isDigitCommon declare it as expect and provide the specific implementation in JVM and Native modules
    Thomas

    Thomas

    3 years ago
    @natpryce did you find a solution?
    natpryce

    natpryce

    3 years ago
    I defined the source set and dependency relationships explicitly in the Gradle file