how can you define dependency constraints in a MPP...
# gradle
r
how can you define dependency constraints in a MPP project? I basically have the same question as this guy: https://discuss.kotlinlang.org/t/dependency-constraints-in-gradle-kotlin-multiplatform-plugin/17720
j
Looks like
dependencies { }
inside a Kotlin target block does not support constraints. That’s something the Kotlin plugin adds (not part of Gradle core). But the mechanism is only an alternative to Gradle’s core dependency declaration mechanism. You can use that instead to define dependencies and constraints. Basically:
kotlin.sourceSets.commonMain.dependencies.implementation
is the same as:
dependencies.commonMainImplementation
Copy code
dependencies {
    commonMainImplementation("...") // <-- dependency
    constraints {
         commonMainImplementation("...") // <-- dependency constraints
    }
}
👍 1
r
thanks, works as expected 👍
👍 1