Skip to content

Commit

Permalink
Build Kord with K2
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann committed Nov 23, 2023
1 parent 1595b95 commit 734946a
Show file tree
Hide file tree
Showing 39 changed files with 1,641 additions and 1,634 deletions.
6 changes: 6 additions & 0 deletions buildSrc/src/main/kotlin/kord-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.google.devtools.ksp.gradle.KspTaskJvm
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask

plugins {
Expand Down Expand Up @@ -48,6 +49,11 @@ tasks {
withType<AbstractDokkaLeafTask>().configureEach {
applyKordDokkaOptions()
}

withType<KspTaskJvm>().configureEach {
// KSP still uses language version 1.9, progressive mode only works with latest
compilerOptions.progressiveMode = false
}
}

publishing {
Expand Down
6 changes: 6 additions & 0 deletions buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.google.devtools.ksp.gradle.KspTaskMetadata
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest

Expand Down Expand Up @@ -88,4 +89,9 @@ tasks {
applyKordDokkaOptions()
dependsOn("kspCommonMainKotlinMetadata")
}

withType<KspTaskMetadata>().configureEach {
// KSP still uses language version 1.9, progressive mode only works with latest
compilerOptions.progressiveMode = false
}
}
1,188 changes: 598 additions & 590 deletions common/api/common.api

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions common/src/commonMain/kotlin/entity/DiscordUser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,11 @@ public data class DiscordOptionallyMemberUser(
val member: Optional<DiscordGuildMember> = Optional.Missing(),
)

@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"'UserFlags.UserFlagsBuilder' is deprecated, use 'UserFlags.Builder' instead.",
level = DeprecationLevel.HIDDEN,
)
@kotlin.internal.LowPriorityInOverloadResolution
public inline fun UserFlags(builder: UserFlags.UserFlagsBuilder.() -> Unit): UserFlags {
contract { callsInPlace(builder, InvocationKind.EXACTLY_ONCE) }
return UserFlags.UserFlagsBuilder().apply(builder).flags()
Expand Down
4 changes: 2 additions & 2 deletions common/src/commonMain/kotlin/entity/Interactions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ public sealed class Option {
ApplicationCommandOptionType.User -> CommandArgument.Serializer.deserialize(
json, jsonValue!!, name, type!!, focused
)
null, is ApplicationCommandOptionType.Unknown -> error("unknown ApplicationCommandOptionType $type")
is ApplicationCommandOptionType.Unknown -> error("unknown ApplicationCommandOptionType $type")
}
}

Expand Down Expand Up @@ -601,7 +601,7 @@ public sealed class CommandArgument<out T> : Option() {
is AutoCompleteArgument, is StringArgument -> encodeStringElement(
descriptor,
1,
value.value as String
value.value
)
}
}
Expand Down
6 changes: 2 additions & 4 deletions common/src/commonMain/kotlin/entity/Permission.kt
Original file line number Diff line number Diff line change
Expand Up @@ -630,12 +630,11 @@ public class Permissions internal constructor(
return Builder(code.copy()).apply(builder).build()
}

@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"'Permissions.PermissionsBuilder' is deprecated, use 'Permissions.Builder' instead.",
level = DeprecationLevel.HIDDEN,
)
@kotlin.internal.LowPriorityInOverloadResolution
public inline fun copy(block: PermissionsBuilder.() -> Unit): Permissions {
contract { callsInPlace(block, EXACTLY_ONCE) }
return PermissionsBuilder(code.copy()).apply(block).permissions()
Expand Down Expand Up @@ -764,12 +763,11 @@ public inline fun Permissions(builder: Permissions.Builder.() -> Unit = {}): Per
return Permissions.Builder().apply(builder).build()
}

@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"'Permissions.PermissionsBuilder' is deprecated, use 'Permissions.Builder' instead.",
level = DeprecationLevel.HIDDEN,
)
@kotlin.internal.LowPriorityInOverloadResolution
public inline fun Permissions(block: Permissions.PermissionsBuilder.() -> Unit = {}): Permissions {
contract { callsInPlace(block, EXACTLY_ONCE) }
return Permissions.PermissionsBuilder(DiscordBitSet(0)).apply(block).permissions()
Expand Down
3 changes: 1 addition & 2 deletions common/src/commonMain/kotlin/entity/UserFlag.kt
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,11 @@ public class UserFlags internal constructor(
return Builder(code).apply(builder).build()
}

@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "DEPRECATION_ERROR")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"'UserFlags.UserFlagsBuilder' is deprecated, use 'UserFlags.Builder' instead.",
level = DeprecationLevel.HIDDEN,
)
@kotlin.internal.LowPriorityInOverloadResolution
public inline fun copy(block: UserFlagsBuilder.() -> Unit): UserFlags {
contract { callsInPlace(block, EXACTLY_ONCE) }
return UserFlagsBuilder(code).apply(block).flags()
Expand Down
2 changes: 0 additions & 2 deletions common/src/jvmMain/kotlin/Class.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ import kotlin.jvm.java as getJavaClass
public actual typealias Class<T> = java.lang.Class<T>

/** @suppress */
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@kotlin.internal.InlineOnly
@KordInternal
public actual inline val <T : Any> KClass<T>.java: Class<T> inline get() = getJavaClass
8 changes: 3 additions & 5 deletions common/src/nonJvmMain/kotlin/Class.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import dev.kord.common.annotation.KordInternal
import kotlin.reflect.KClass

/** @suppress */
@Suppress("ACTUAL_WITHOUT_EXPECT")
public actual typealias Class<T> = KClass<T>
public actual typealias Class<T> = ArrayDeque<T>

/** @suppress */
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@kotlin.internal.InlineOnly
@KordInternal
public actual inline val <T : Any> KClass<T>.java: Class<T> inline get() = this
public actual inline val <T : Any> KClass<T>.java: Class<T>
inline get() = throw UnsupportedOperationException("'getDeclaringClass()' was never present on Kotlin/JS")
Loading

0 comments on commit 734946a

Please sign in to comment.