Skip to content

Commit

Permalink
Replace kotlin-targets with Targets.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Mar 4, 2024
1 parent 5869b9a commit 92d05e7
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ repositories {
kotlin {
compilerOptions {
allWarningsAsErrors = true
freeCompilerArgs.add("-Xcontext-receivers")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.kpm.external.ExternalVariantApi
import org.jetbrains.kotlin.gradle.kpm.external.project
import org.jetbrains.kotlin.konan.target.HostManager

plugins {
org.jetbrains.kotlin.multiplatform
}

kotlin {
@OptIn(ExternalVariantApi::class)
fun KotlinMultiplatformExtension.targets() {
// There are issues with compiling the linux variant on windows
// Please use WSL if you need to work on the linux port
if (!HostManager.hostIsMingw) {
Expand All @@ -14,7 +14,7 @@ kotlin {

jvm()

if (name != "voice" && name != "core-voice") {
if (project.name != "voice" && project.name != "core-voice") {
mingwX64()
js {
nodejs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ kotlin {
}
}

targets()
explicitApi()
jvmToolchain(Jvm.target)

Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import dev.kord.gradle.tools.util.commitHash
import dev.kord.gradle.tools.util.shortCommitHash

plugins {
`kord-targets`
`kord-multiplatform-module`
`kord-publishing`
alias(libs.plugins.buildconfig)
}

kotlin {
targets()
sourceSets {
commonMain {
dependencies {
Expand Down
1 change: 0 additions & 1 deletion core-voice/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
`kord-targets`
`kord-multiplatform-module`
`kord-publishing`
}
Expand Down
1 change: 0 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
`kord-targets`
`kord-multiplatform-module`
`kord-publishing`
}
Expand Down
3 changes: 2 additions & 1 deletion core/live-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugins {
`kord-targets`
org.jetbrains.kotlin.multiplatform
}

kotlin {
targets()
sourceSets {
all {
applyKordOptIns()
Expand Down
1 change: 0 additions & 1 deletion gateway/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
`kord-targets`
`kord-multiplatform-module`
`kord-publishing`
}
Expand Down
7 changes: 5 additions & 2 deletions ksp-annotations/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask

plugins {
`kord-targets`

org.jetbrains.kotlin.multiplatform
// workaround for https://youtrack.jetbrains.com/issue/KT-43500 (not intended to be published)
org.jetbrains.dokka
`kord-publishing`
}

kotlin {
targets()
}

tasks.withType<AbstractDokkaLeafTask>().configureEach {
dokkaSourceSets.configureEach {
suppress = true
Expand Down
1 change: 0 additions & 1 deletion rest/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
`kord-targets`
`kord-multiplatform-module`
`kord-publishing`
}
Expand Down
6 changes: 2 additions & 4 deletions samples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.konan.target.Family

plugins {
`kord-targets`
org.jetbrains.kotlin.multiplatform
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
Expand All @@ -17,9 +17,7 @@ kotlin {
}
}
}
js {
binaries.executable()
}
targets()

targets.withType<KotlinNativeTarget> {
// Voice does not target windows, so we disable it
Expand Down
3 changes: 2 additions & 1 deletion test-kit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
`kord-targets`
org.jetbrains.kotlin.multiplatform
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
Expand All @@ -15,6 +15,7 @@ kotlin {
}
}
}
targets()
sourceSets {
commonMain {
dependencies {
Expand Down
1 change: 0 additions & 1 deletion voice/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
`kord-targets`
`kord-multiplatform-module`
`kord-publishing`
}
Expand Down

0 comments on commit 92d05e7

Please sign in to comment.