Andrey Tabakov
09/11/2023, 2:59 PMe: commonMain can't declare dependsOn on other source sets
I've got this code:
sourceSets {
val commonAntlr by creating {
dependencies {
implementation(kotlin("stdlib"))
// add antlr-kotlin-runtime otherwise, the generated sources will not compile
implementation(project(":3rdparty:antlr-kotlin:antlr-kotlin-runtime"))
}
// you have to add the generated sources the to the kotlin compiler source directory list
// this is not required if you use src/commonAntlr/kotlin and want to add the generated sources to version control
kotlin.srcDir("build/generated-src/commonAntlr/kotlin")
}
val commonMain by getting {
dependsOn(commonAntlr)
kotlin.srcDir("build/generated-src/commonMain/kotlin")
dependencies {
....
}
}
}
How to migrate this?mbonnin
09/11/2023, 3:29 PMcommonMain
?
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib"))
// add antlr-kotlin-runtime otherwise, the generated sources will not compile
implementation(project(":3rdparty:antlr-kotlin:antlr-kotlin-runtime"))
}
// you have to add the generated sources the to the kotlin compiler source directory list
// this is not required if you use src/commonAntlr/kotlin and want to add the generated sources to version control
kotlin.srcDir("build/generated-src/commonAntlr/kotlin")
}
}
tapchicoma
09/11/2023, 3:35 PMcommon
source setAndrey Tabakov
09/11/2023, 3:39 PMkotlin.srcDir("build/generated-src/commonMain/kotlin")
with
kotlin.srcDir("build/generated-src/commonAntlr/kotlin")
Thank you!