Skip to content

Commit

Permalink
Merge pull request #31 from cketti/update-build-config
Browse files Browse the repository at this point in the history
Clean up source set configuration
  • Loading branch information
cketti authored May 16, 2024
2 parents 947a96d + f0b924d commit 7dce8fd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
5 changes: 3 additions & 2 deletions kotlin-codepoints-deluxe/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ kotlin {
watchosSimulatorArm64()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
api(project(":kotlin-codepoints"))
}
}
val commonTest by getting {

commonTest {
dependencies {
implementation(kotlin("test"))
}
Expand Down
24 changes: 11 additions & 13 deletions kotlin-codepoints/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
alias(libs.plugins.kotlin.multiplatform)
Expand Down Expand Up @@ -48,23 +48,21 @@ kotlin {
watchosX64()
watchosSimulatorArm64()

@OptIn(ExperimentalKotlinGradlePluginApi::class)
applyDefaultHierarchyTemplate {
group("nonJvm") {
withJs()
withNative()
withWasm()
}
}

sourceSets {
val commonMain by getting
val commonTest by getting {
commonTest {
dependencies {
implementation(kotlin("test"))
}
}

val commonImplementation by creating {
dependsOn(commonMain)
}
}

targets.onEach {
if (it.platformType != KotlinPlatformType.jvm) {
it.compilations.getByName("main").source(sourceSets.getByName("commonImplementation"))
}
}
}

Expand Down

0 comments on commit 7dce8fd

Please sign in to comment.