diff --git a/buildSrc/src/main/kotlin/com/saveourtool/sarifutils/buildutils/DetektConfiguration.kt b/buildSrc/src/main/kotlin/com/saveourtool/sarifutils/buildutils/DetektConfiguration.kt index 0314b33..fae213e 100644 --- a/buildSrc/src/main/kotlin/com/saveourtool/sarifutils/buildutils/DetektConfiguration.kt +++ b/buildSrc/src/main/kotlin/com/saveourtool/sarifutils/buildutils/DetektConfiguration.kt @@ -22,7 +22,7 @@ import org.gradle.kotlin.dsl.withType fun Project.configureDetekt() { apply() configure { - config = rootProject.files("detekt.yml") + config.setFrom(rootProject.files("detekt.yml")) basePath = rootDir.canonicalPath buildUponDefaultConfig = true } diff --git a/buildSrc/src/main/kotlin/com/saveourtool/sarifutils/buildutils/kotlin-library.gradle.kts b/buildSrc/src/main/kotlin/com/saveourtool/sarifutils/buildutils/kotlin-library.gradle.kts index 337b7e1..25e2ce9 100644 --- a/buildSrc/src/main/kotlin/com/saveourtool/sarifutils/buildutils/kotlin-library.gradle.kts +++ b/buildSrc/src/main/kotlin/com/saveourtool/sarifutils/buildutils/kotlin-library.gradle.kts @@ -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 @@ -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) - } } } diff --git a/gradle.properties b/gradle.properties index a77aee6..7ae5da2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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