From 6cf5769b7c1c7b3b2124b99304bafe3319691fc1 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Thu, 12 Sep 2024 15:12:23 +0200 Subject: [PATCH] More fixes in regards to merge --- buildSrc/src/main/kotlin/Compiler.kt | 6 +++--- buildSrc/src/main/kotlin/Targets.kt | 10 +++++----- .../kotlin/kord-multiplatform-module.gradle.kts | 8 ++++++-- .../src/main/kotlin/kord-publishing.gradle.kts | 14 +++----------- ksp-annotations/build.gradle.kts | 10 ++++++++++ test-kit/build.gradle.kts | 10 ++++++++++ voice/api/voice.klib.api | 14 -------------- 7 files changed, 37 insertions(+), 35 deletions(-) diff --git a/buildSrc/src/main/kotlin/Compiler.kt b/buildSrc/src/main/kotlin/Compiler.kt index 6caa6484fc3..35b50c6d0f6 100644 --- a/buildSrc/src/main/kotlin/Compiler.kt +++ b/buildSrc/src/main/kotlin/Compiler.kt @@ -14,13 +14,13 @@ val kordOptIns = listOf( "dev.kord.common.annotation.KordVoice", ) -internal fun KotlinCommonCompilerOptions.applyKordCommonCompilerOptions() { +fun KotlinCommonCompilerOptions.applyKordCommonCompilerOptions() { allWarningsAsErrors = true progressiveMode = true - freeCompilerArgs.add("-Xexpect-actual-classes") + freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xexpect-actual-classes") } -internal const val KORD_JVM_TARGET = 8 +const val KORD_JVM_TARGET = 8 internal fun KotlinJvmCompilerOptions.applyKordJvmCompilerOptions() { applyKordCommonCompilerOptions() diff --git a/buildSrc/src/main/kotlin/Targets.kt b/buildSrc/src/main/kotlin/Targets.kt index 8188fd9e02e..f804f3e7acf 100644 --- a/buildSrc/src/main/kotlin/Targets.kt +++ b/buildSrc/src/main/kotlin/Targets.kt @@ -5,7 +5,11 @@ import org.jetbrains.kotlin.konan.target.HostManager @OptIn(ExperimentalKotlinGradlePluginApi::class) fun KotlinMultiplatformExtension.targets() { - jvm() + jvm { + compilerOptions { + applyKordJvmCompilerOptions() + } + } js { nodejs { @@ -38,10 +42,6 @@ fun KotlinMultiplatformExtension.targets() { tvosX64() tvosArm64() tvosSimulatorArm64() - - compilerOptions { - applyKordCompilerOptions() - } } // There are issues with linking the linux variant on windows. diff --git a/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts b/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts index b37339635c2..59a69c782dc 100644 --- a/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts @@ -1,6 +1,7 @@ import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest +import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest plugins { org.jetbrains.kotlin.multiplatform @@ -41,10 +42,9 @@ kotlin { targets() explicitApi() - jvmToolchain(Jvm.target) compilerOptions { - applyKordCompilerOptions() optIn.addAll(kordOptIns) + applyKordCommonCompilerOptions() } sourceSets { @@ -74,6 +74,10 @@ tasks { environment("PROJECT_ROOT", rootProject.projectDir.absolutePath) } + withType().configureEach { + options.release = KORD_JVM_TARGET + } + afterEvaluate { val compilationTasks = kotlin.targets.flatMap { listOf("compileKotlin${it.name.replaceFirstChar(Char::titlecase)}", "${it.name}SourcesJar") diff --git a/buildSrc/src/main/kotlin/kord-publishing.gradle.kts b/buildSrc/src/main/kotlin/kord-publishing.gradle.kts index 20d05a7dc4b..64f4f66714a 100644 --- a/buildSrc/src/main/kotlin/kord-publishing.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-publishing.gradle.kts @@ -1,3 +1,4 @@ +import org.jetbrains.kotlin.konan.target.Family import java.lang.System.getenv import java.util.Base64 @@ -17,7 +18,7 @@ mavenPublishing { signAllPublications() if (plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) { - configure(KotlinMultiplatform(javadocJar = JavadocJar.Dokka("dokkaHtml"))) +// configure(KotlinMultipla(javadocJar = JavadocJar.Dokka("dokkaHtml"))) } pom { @@ -56,16 +57,7 @@ mavenPublishing { } repositories { - maven { - url = uri(if (isRelease) Repo.releasesUrl else Repo.snapshotsUrl) - - credentials { - username = getenv("NEXUS_USER") - password = getenv("NEXUS_PASSWORD") - } - } - - if (!isRelease) { + if (true) { maven { name = "kordSnapshots" url = uri("https://repo.kord.dev/snapshots") diff --git a/ksp-annotations/build.gradle.kts b/ksp-annotations/build.gradle.kts index c2fa45ec56f..524da336279 100644 --- a/ksp-annotations/build.gradle.kts +++ b/ksp-annotations/build.gradle.kts @@ -10,8 +10,18 @@ plugins { `kord-publishing` } +kotlin { + targets() +} + tasks.withType().configureEach { dokkaSourceSets.configureEach { suppress = true } } + +tasks { + withType().configureEach { + options.release = KORD_JVM_TARGET + } +} diff --git a/test-kit/build.gradle.kts b/test-kit/build.gradle.kts index b0deb0f21bd..652f677426b 100644 --- a/test-kit/build.gradle.kts +++ b/test-kit/build.gradle.kts @@ -41,4 +41,14 @@ kotlin { } } } + + compilerOptions { + applyKordCommonCompilerOptions() + } +} + +tasks { + withType().configureEach { + options.release = KORD_JVM_TARGET + } } diff --git a/voice/api/voice.klib.api b/voice/api/voice.klib.api index de44c2249d4..1a2cd4e778b 100644 --- a/voice/api/voice.klib.api +++ b/voice/api/voice.klib.api @@ -1029,8 +1029,6 @@ final value class dev.kord.voice/AudioFrame { // dev.kord.voice/AudioFrame|null[ } sealed class dev.kord.voice.gateway/Close : dev.kord.voice.gateway/VoiceEvent { // dev.kord.voice.gateway/Close|null[0] - constructor () // dev.kord.voice.gateway/Close.|(){}[0] - final class DiscordClose : dev.kord.voice.gateway/Close { // dev.kord.voice.gateway/Close.DiscordClose|null[0] constructor (dev.kord.voice.gateway/VoiceGatewayCloseCode, kotlin/Boolean) // dev.kord.voice.gateway/Close.DiscordClose.|(dev.kord.voice.gateway.VoiceGatewayCloseCode;kotlin.Boolean){}[0] @@ -1057,8 +1055,6 @@ sealed class dev.kord.voice.gateway/Close : dev.kord.voice.gateway/VoiceEvent { } sealed class dev.kord.voice.gateway/Command { // dev.kord.voice.gateway/Command|null[0] - constructor () // dev.kord.voice.gateway/Command.|(){}[0] - final object SerializationStrategy : kotlinx.serialization/SerializationStrategy { // dev.kord.voice.gateway/Command.SerializationStrategy|null[0] final val descriptor // dev.kord.voice.gateway/Command.SerializationStrategy.descriptor|{}descriptor[0] final fun (): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.voice.gateway/Command.SerializationStrategy.descriptor.|(){}[0] @@ -1068,8 +1064,6 @@ sealed class dev.kord.voice.gateway/Command { // dev.kord.voice.gateway/Command| } sealed class dev.kord.voice.gateway/VoiceEvent { // dev.kord.voice.gateway/VoiceEvent|null[0] - constructor () // dev.kord.voice.gateway/VoiceEvent.|(){}[0] - final object DeserializationStrategy : kotlinx.serialization/DeserializationStrategy { // dev.kord.voice.gateway/VoiceEvent.DeserializationStrategy|null[0] final val descriptor // dev.kord.voice.gateway/VoiceEvent.DeserializationStrategy.descriptor|{}descriptor[0] final fun (): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.voice.gateway/VoiceEvent.DeserializationStrategy.descriptor.|(){}[0] @@ -1079,8 +1073,6 @@ sealed class dev.kord.voice.gateway/VoiceEvent { // dev.kord.voice.gateway/Voice } sealed class dev.kord.voice.gateway/VoiceGatewayCloseCode { // dev.kord.voice.gateway/VoiceGatewayCloseCode|null[0] - constructor (kotlin/Int) // dev.kord.voice.gateway/VoiceGatewayCloseCode.|(kotlin.Int){}[0] - final val code // dev.kord.voice.gateway/VoiceGatewayCloseCode.code|{}code[0] final fun (): kotlin/Int // dev.kord.voice.gateway/VoiceGatewayCloseCode.code.|(){}[0] @@ -1118,8 +1110,6 @@ sealed class dev.kord.voice.gateway/VoiceGatewayCloseCode { // dev.kord.voice.ga } sealed class dev.kord.voice.udp/PayloadType { // dev.kord.voice.udp/PayloadType|null[0] - constructor (kotlin/Byte) // dev.kord.voice.udp/PayloadType.|(kotlin.Byte){}[0] - final val raw // dev.kord.voice.udp/PayloadType.raw|{}raw[0] final fun (): kotlin/Byte // dev.kord.voice.udp/PayloadType.raw.|(){}[0] @@ -1139,8 +1129,6 @@ sealed class dev.kord.voice.udp/PayloadType { // dev.kord.voice.udp/PayloadType| } sealed class dev.kord.voice/EncryptionMode { // dev.kord.voice/EncryptionMode|null[0] - constructor (kotlin/String) // dev.kord.voice/EncryptionMode.|(kotlin.String){}[0] - final val value // dev.kord.voice/EncryptionMode.value|{}value[0] final fun (): kotlin/String // dev.kord.voice/EncryptionMode.value.|(){}[0] @@ -1166,8 +1154,6 @@ sealed class dev.kord.voice/EncryptionMode { // dev.kord.voice/EncryptionMode|nu } sealed class dev.kord.voice/SpeakingFlag { // dev.kord.voice/SpeakingFlag|null[0] - constructor (kotlin/Int) // dev.kord.voice/SpeakingFlag.|(kotlin.Int){}[0] - final val code // dev.kord.voice/SpeakingFlag.code|{}code[0] final fun (): kotlin/Int // dev.kord.voice/SpeakingFlag.code.|(){}[0] final val shift // dev.kord.voice/SpeakingFlag.shift|{}shift[0]