Animesh Sahu
12/01/2020, 8:10 AMplugins {
kotlin("multiplatform") version "1.4.20" apply false
}
allprojects {
this.group = "com.github.animeshz"
this.version = "0.0.1"
repositories {
mavenCentral()
jcenter()
}
}
subprojects {
apply(plugin = "kotlin-multiplatform")
}
build.gradle.kts (in common module)
@file:Suppress("UNUSED_VARIABLE")
kotlin {
linuxX64()
mingwX64()
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2")
// implementation("io.github.microutils:kotlin-logging:2.0.2")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation("io.kotest:kotest-assertions-core:4.3.1")
// implementation("io.kotest:kotest-property:4.3.1")
}
}
val linuxX64Main by getting {
dependsOn(commonMain)
}
val mingwX64Main by getting {
dependsOn(commonMain)
}
all {
languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn")
}
}
explicitApi()
}
build.gradle.kts (in specific module having problem)
kotlin {
linuxX64()
mingwX64()
sourceSets {
val commonMain by getting {
dependencies {
api(project(":common"))
}
}
val commonTest by getting {}
val linuxX64Main by getting {
dependsOn(commonMain)
}
val mingwX64Main by getting {
dependsOn(commonMain)
}
}
explicitApi()
}
api()
instead of implementation()
to expose the common dependency to all of the submodules having it as a dependency...