Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed migration to kotlin 1.9.20 #102

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.gradle.kotlin.dsl.withType
fun Project.configureDetekt() {
apply<DetektPlugin>()
configure<DetektExtension> {
config = rootProject.files("detekt.yml")
config.setFrom(rootProject.files("detekt.yml"))
basePath = rootDir.canonicalPath
buildUponDefaultConfig = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ kotlin {
}
}
}
val nativeTargets = listOf(linuxX64(), mingwX64(), macosX64())
linuxX64()
mingwX64()
macosX64()

if (hasProperty("disableRedundantTargets") && (property("disableRedundantTargets") as String?) != "false") {
// with this flag we exclude targets that are present on multiple OS to speed up build
Expand All @@ -43,55 +45,22 @@ kotlin {
}
}

/*
* Common structure for MPP libraries:
* common
* |
* nonJs
* / \
* native JVM
* / | \
* linux mingw macos
*/
sourceSets {
all {
languageSettings.optIn("kotlin.RequiresOptIn")
}
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val commonNonJsMain by creating {
dependsOn(commonMain)
}
val commonNonJsTest by creating {
dependsOn(commonTest)
}
val jvmMain by getting {
dependsOn(commonNonJsMain)
}
val jvmTest by getting {
dependsOn(commonNonJsTest)
dependencies {
implementation(kotlin("test-junit5"))
implementation("org.junit.jupiter:junit-jupiter-engine:5.10.1")
}
}
val nativeMain by creating {
dependsOn(commonNonJsMain)
}
val nativeTest by creating {
dependsOn(commonNonJsTest)
}
nativeTargets.forEach {
getByName("${it.name}Main").dependsOn(nativeMain)
}
nativeTargets.forEach {
getByName("${it.name}Test").dependsOn(nativeTest)
}
}
}

Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ org.gradle.caching=true
kotlin.code.style=official
kotlin.mpp.stability.nowarn=true
kotlin.native.cacheKind.linuxX64=none
kotlin.mpp.hierarchicalStructureSupport=true
# making custom cinterop libraries available in shared source sets
kotlin.mpp.enableCInteropCommonization=true