Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/user-apps
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Oct 22, 2024
2 parents 067082e + e99c5c5 commit a6a8e6d
Show file tree
Hide file tree
Showing 50 changed files with 249 additions and 329 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build docs with Gradle
run: ./gradlew --stacktrace --info dokkaHtmlMultiModule
run: ./gradlew --stacktrace --info :dokkaGeneratePublicationHtml
- name: Deploy docs to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/dokka/htmlMultiModule
folder: build/dokka/html
branch: gh-pages
git-config-name: GitHub Actions
git-config-email: [email protected]
Expand Down
43 changes: 42 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
# 0.15.0

## Additions

* Add `User.isSelf` (by @Taubsie in #950)
* Publish snapshots to https://repo.kord.dev/snapshots (#961)
* Document deprecation cycle of deprecated declarations (#969)
* Add `UserMessageCreateBuilder.enforceNonce` (by @DRSchlaubi in #971)
* Implement Monetization (by @viztea in #932)
* Add `MemberProfileAutoModerationRule` (#974)

## Changes

* Bump `DeprecationLevel`s after 0.14.0 (#944)
* Update Auto Moderation builders (#979)
* Link to JDK 23 in Dokka output (#980)

## Fixes

* Fix deserialization of members (by @NoComment1105 in #955)
* Fix deserialization of `Heartbeat` events (#957)
* Fix `getMemberOrNull` and `getGuildMembers` caching only user data (by @Galarzaa90 in #964)
* Fix misuse of reified type parameters (#981)

## Dependencies

Updated in #942, #954, #958, #975, #976, and #986 (not including dependencies only needed for developing Kord)

* Kotlin 1.9.24 -> 2.0.21
* Ktor 2.3.11 -> 3.0.0
* kotlinx.coroutines 1.8.1 -> 1.9.0
* kotlinx.serialization 1.6.3 -> 1.7.3
* kotlinx-datetime 0.6.0 -> 0.6.1
* kord-cache 0.4.0 -> 0.5.4
* kotlin-logging 6.0.9 -> 7.0.0
* SLF4J 2.0.13 -> 2.0.16
* kotlin-node 20.11.30-pre.751 -> 22.5.4-pre.818
* kotlin-multiplatform-bignum 0.3.9 -> 0.3.10
* Stately 2.0.7 -> 2.1.0
* AtomicFU 0.24.0 -> 0.25.0

# 0.14.0

## Additions
Expand Down Expand Up @@ -30,7 +71,7 @@ Updated in #920, #929 and #943
* kotlinx-datetime 0.5.0 -> 0.6.0
* kotlin-logging 6.0.1 -> 6.0.9
* SLF4J 2.0.9 -> 2.0.13
* kotlin-node 18.16.12-pre.619 -> 20.11.5-pre.751
* kotlin-node 18.16.12-pre.619 -> 20.11.30-pre.751
* kotlin-multiplatform-bignum 0.3.8 -> 0.3.9
* Stately 2.0.6 -> 2.0.7
* KSP 1.9.21-1.0.16 -> 1.9.24-1.0.20
Expand Down
11 changes: 10 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
org.jetbrains.dokka // for dokkaHtmlMultiModule task
org.jetbrains.dokka // for dokkaGeneratePublicationHtml task
}

repositories {
Expand All @@ -8,3 +8,12 @@ repositories {

group = Library.group
version = libraryVersion

dependencies {
dokka(projects.common)
dokka(projects.core)
dokka(projects.coreVoice)
dokka(projects.gateway)
dokka(projects.rest)
dokka(projects.voice)
}
39 changes: 27 additions & 12 deletions buildSrc/src/main/kotlin/Documentation.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import org.gradle.api.Project
import org.gradle.kotlin.dsl.assign
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
import java.net.URI
import org.gradle.kotlin.dsl.invoke
import org.jetbrains.dokka.gradle.DokkaExtension
import org.jetbrains.dokka.gradle.workers.ProcessIsolation

fun AbstractDokkaLeafTask.applyKordDokkaOptions() {
internal fun DokkaExtension.applyKordDokkaOptions(project: Project) {

// Dokka runs out of memory with the default maxHeapSize when ProcessIsolation is used
(dokkaGeneratorIsolation.get() as? ProcessIsolation)?.maxHeapSize = "1g"

moduleName = "kord-${project.name}"

failOnWarning = true
dokkaPublications.configureEach {
failOnWarning = true
}

dokkaSourceSets.configureEach {

Expand All @@ -16,17 +23,25 @@ fun AbstractDokkaLeafTask.applyKordDokkaOptions() {

sourceLink {
localDirectory = project.projectDir
remoteUrl = URI("https://github.com/kordlib/kord/blob/${project.commitHash}/${project.name}").toURL()
remoteUrl("https://github.com/kordlib/kord/blob/${project.commitHash}/${project.name}")
remoteLineSuffix = "#L"
}

externalDocumentationLink("https://kotlinlang.org/api/kotlinx.coroutines/")
externalDocumentationLink("https://kotlinlang.org/api/kotlinx.serialization/")
externalDocumentationLink(
url = "https://kotlinlang.org/api/kotlinx-datetime/",
packageListUrl = "https://kotlinlang.org/api/kotlinx-datetime/kotlinx-datetime/package-list",
)
externalDocumentationLink("https://api.ktor.io/")
externalDocumentationLinks {
register("kotlinx.coroutines") {
url("https://kotlinlang.org/api/kotlinx.coroutines/")
}
register("kotlinx.serialization") {
url("https://kotlinlang.org/api/kotlinx.serialization/")
}
register("kotlinx-datetime") {
url("https://kotlinlang.org/api/kotlinx-datetime/")
packageListUrl("https://kotlinlang.org/api/kotlinx-datetime/kotlinx-datetime/package-list")
}
register("Ktor") {
url("https://api.ktor.io/")
}
}

// don't list `TweetNaclFast` in docs
perPackageOption {
Expand Down
10 changes: 4 additions & 6 deletions buildSrc/src/main/kotlin/kord-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask

plugins {
org.jetbrains.kotlin.jvm
org.jetbrains.kotlin.plugin.serialization
Expand Down Expand Up @@ -34,15 +32,15 @@ kotlin {
}
}

dokka {
applyKordDokkaOptions(project)
}

tasks {
withType<Test>().configureEach {
useJUnitPlatform()
}

withType<AbstractDokkaLeafTask>().configureEach {
applyKordDokkaOptions()
}

withType<JavaCompile>().configureEach {
options.release = KORD_JVM_TARGET
}
Expand Down
19 changes: 12 additions & 7 deletions buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest

Expand Down Expand Up @@ -71,6 +70,10 @@ kotlin {
}
}

dokka {
applyKordDokkaOptions(project)
}

tasks {
withType<Test>().configureEach {
useJUnitPlatform()
Expand All @@ -80,7 +83,14 @@ tasks {
environment("PROJECT_ROOT", rootProject.projectDir.absolutePath)
}

for (task in listOf("compileKotlinJvm", "compileKotlinJs", "jvmSourcesJar", "jsSourcesJar")) {
for (task in listOf(
"compileKotlinJvm",
"compileKotlinJs",
"jvmSourcesJar",
"jsSourcesJar",
"dokkaGenerateModuleHtml",
"dokkaGeneratePublicationHtml",
)) {
named(task) {
dependsOn("kspCommonMainKotlinMetadata")
}
Expand All @@ -91,9 +101,4 @@ tasks {
dependsOn("kspCommonMainKotlinMetadata")
}
}

withType<AbstractDokkaLeafTask>().configureEach {
applyKordDokkaOptions()
dependsOn("kspCommonMainKotlinMetadata")
}
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/kord-publishing.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fun MavenPublication.registerDokkaJar() =
tasks.register<Jar>("${name}DokkaJar") {
archiveClassifier = "javadoc"
destinationDirectory = destinationDirectory.get().dir(name)
from(tasks.named("dokkaHtml"))
from(tasks.named("dokkaGeneratePublicationHtml"))
}

publishing {
Expand Down
21 changes: 1 addition & 20 deletions common/api/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ public final class dev/kord/common/DiscordBitSetKt {
public static final fun EmptyBitSet ()Ldev/kord/common/DiscordBitSet;
}

public final class dev/kord/common/DiscordBitSetSerializer : kotlinx/serialization/KSerializer {
public static final field INSTANCE Ldev/kord/common/DiscordBitSetSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/DiscordBitSet;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/DiscordBitSet;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
}

public final class dev/kord/common/DiscordTimestampKt {
public static final fun toMessageFormat (Lkotlinx/datetime/Instant;Ldev/kord/common/DiscordTimestampStyle;)Ljava/lang/String;
public static synthetic fun toMessageFormat$default (Lkotlinx/datetime/Instant;Ldev/kord/common/DiscordTimestampStyle;ILjava/lang/Object;)Ljava/lang/String;
Expand Down Expand Up @@ -149,15 +140,6 @@ public final class dev/kord/common/Locale$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class dev/kord/common/Locale$Serializer : kotlinx/serialization/KSerializer {
public static final field INSTANCE Ldev/kord/common/Locale$Serializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/Locale;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/Locale;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
}

public final class dev/kord/common/LocaleKt {
public static final fun asJavaLocale (Ldev/kord/common/Locale;)Ljava/util/Locale;
public static final fun getKLocale (Ljava/util/Locale;)Ldev/kord/common/Locale;
Expand Down Expand Up @@ -828,7 +810,6 @@ public final class dev/kord/common/entity/ArchiveDuration$ThreeDays : dev/kord/c
}

public final class dev/kord/common/entity/ArchiveDuration$Unknown : dev/kord/common/entity/ArchiveDuration {
public synthetic fun <init> (JLkotlin/jvm/internal/DefaultConstructorMarker;)V
}

public final class dev/kord/common/entity/ArchiveDuration$Week : dev/kord/common/entity/ArchiveDuration {
Expand Down Expand Up @@ -8338,7 +8319,7 @@ public final class dev/kord/common/entity/Permissions$NewCompanion {

public final class dev/kord/common/entity/PermissionsKt {
public static final fun getALL (Ldev/kord/common/entity/Permissions$Companion;)Ldev/kord/common/entity/Permissions;
public static final fun getALL (Ldev/kord/common/entity/Permissions$NewCompanion;)Ldev/kord/common/entity/Permissions;
public static final synthetic fun getALL (Ldev/kord/common/entity/Permissions$NewCompanion;)Ldev/kord/common/entity/Permissions;
}

public abstract class dev/kord/common/entity/PremiumTier {
Expand Down
20 changes: 1 addition & 19 deletions common/api/common.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -6655,14 +6655,6 @@ final class dev.kord.common/Locale { // dev.kord.common/Locale|null[0]
final fun fromString(kotlin/String): dev.kord.common/Locale // dev.kord.common/Locale.Companion.fromString|fromString(kotlin.String){}[0]
final fun serializer(): kotlinx.serialization/KSerializer<dev.kord.common/Locale> // dev.kord.common/Locale.Companion.serializer|serializer(){}[0]
}

final object Serializer : kotlinx.serialization/KSerializer<dev.kord.common/Locale> { // dev.kord.common/Locale.Serializer|null[0]
final val descriptor // dev.kord.common/Locale.Serializer.descriptor|{}descriptor[0]
final fun <get-descriptor>(): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.common/Locale.Serializer.descriptor.<get-descriptor>|<get-descriptor>(){}[0]

final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.common/Locale // dev.kord.common/Locale.Serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0]
final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.common/Locale) // dev.kord.common/Locale.Serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.common.Locale){}[0]
}
}

sealed class <#A: kotlin/Any?> dev.kord.common.entity/AuditLogChangeKey { // dev.kord.common.entity/AuditLogChangeKey|null[0]
Expand Down Expand Up @@ -7491,9 +7483,7 @@ sealed class dev.kord.common.entity/ArchiveDuration { // dev.kord.common.entity/
final fun hashCode(): kotlin/Int // dev.kord.common.entity/ArchiveDuration.hashCode|hashCode(){}[0]
final fun toString(): kotlin/String // dev.kord.common.entity/ArchiveDuration.toString|toString(){}[0]

final class Unknown : dev.kord.common.entity/ArchiveDuration { // dev.kord.common.entity/ArchiveDuration.Unknown|null[0]
constructor <init>(kotlin.time/Duration) // dev.kord.common.entity/ArchiveDuration.Unknown.<init>|<init>(kotlin.time.Duration){}[0]
}
final class Unknown : dev.kord.common.entity/ArchiveDuration // dev.kord.common.entity/ArchiveDuration.Unknown|null[0]

final object Companion { // dev.kord.common.entity/ArchiveDuration.Companion|null[0]
final val entries // dev.kord.common.entity/ArchiveDuration.Companion.entries|{}entries[0]
Expand Down Expand Up @@ -9484,14 +9474,6 @@ final object dev.kord.common.serialization/InstantInEpochSecondsSerializer : kot
final fun serialize(kotlinx.serialization.encoding/Encoder, kotlinx.datetime/Instant) // dev.kord.common.serialization/InstantInEpochSecondsSerializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;kotlinx.datetime.Instant){}[0]
}

final object dev.kord.common/DiscordBitSetSerializer : kotlinx.serialization/KSerializer<dev.kord.common/DiscordBitSet> { // dev.kord.common/DiscordBitSetSerializer|null[0]
final val descriptor // dev.kord.common/DiscordBitSetSerializer.descriptor|{}descriptor[0]
final fun <get-descriptor>(): kotlinx.serialization.descriptors/SerialDescriptor // dev.kord.common/DiscordBitSetSerializer.descriptor.<get-descriptor>|<get-descriptor>(){}[0]

final fun deserialize(kotlinx.serialization.encoding/Decoder): dev.kord.common/DiscordBitSet // dev.kord.common/DiscordBitSetSerializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0]
final fun serialize(kotlinx.serialization.encoding/Encoder, dev.kord.common/DiscordBitSet) // dev.kord.common/DiscordBitSetSerializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;dev.kord.common.DiscordBitSet){}[0]
}

final object dev.kord.common/KordConfiguration { // dev.kord.common/KordConfiguration|null[0]
final var GATEWAY_VERSION // dev.kord.common/KordConfiguration.GATEWAY_VERSION|{}GATEWAY_VERSION[0]
final fun <get-GATEWAY_VERSION>(): kotlin/Int // dev.kord.common/KordConfiguration.GATEWAY_VERSION.<get-GATEWAY_VERSION>|<get-GATEWAY_VERSION>(){}[0]
Expand Down
1 change: 0 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ kotlin {
}
nonJvmMain {
dependencies {
implementation(libs.ktor.utils)
implementation(libs.bignum)
implementation(libs.stately.collections)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,8 @@ public class Permissions internal constructor(
public companion object {
@Suppress(names = arrayOf("DEPRECATION_ERROR"))
@Deprecated(
level = DeprecationLevel.ERROR,
message =
"Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in 0.17.0.",
level = DeprecationLevel.HIDDEN,
message = "Renamed to 'Companion'. This declaration will be removed in 0.17.0.",
replaceWith = ReplaceWith(expression = "Permissions.Companion", imports =
arrayOf("dev.kord.common.entity.Permissions")),
)
Expand All @@ -639,9 +638,8 @@ public class Permissions internal constructor(
}

@Deprecated(
level = DeprecationLevel.ERROR,
message =
"Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in 0.17.0.",
level = DeprecationLevel.HIDDEN,
message = "Renamed to 'Companion'. This declaration will be removed in 0.17.0.",
replaceWith = ReplaceWith(expression = "Permissions.Companion", imports =
arrayOf("dev.kord.common.entity.Permissions")),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,8 @@ public class SystemChannelFlags internal constructor(
public companion object {
@Suppress(names = arrayOf("DEPRECATION_ERROR"))
@Deprecated(
level = DeprecationLevel.ERROR,
message =
"Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in 0.17.0.",
level = DeprecationLevel.HIDDEN,
message = "Renamed to 'Companion'. This declaration will be removed in 0.17.0.",
replaceWith = ReplaceWith(expression = "SystemChannelFlags.Companion", imports =
arrayOf("dev.kord.common.entity.SystemChannelFlags")),
)
Expand All @@ -340,9 +339,8 @@ public class SystemChannelFlags internal constructor(
}

@Deprecated(
level = DeprecationLevel.ERROR,
message =
"Renamed to 'Companion'. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in 0.17.0.",
level = DeprecationLevel.HIDDEN,
message = "Renamed to 'Companion'. This declaration will be removed in 0.17.0.",
replaceWith = ReplaceWith(expression = "SystemChannelFlags.Companion", imports =
arrayOf("dev.kord.common.entity.SystemChannelFlags")),
)
Expand Down
8 changes: 0 additions & 8 deletions common/src/commonMain/kotlin/DiscordBitSet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,3 @@ public fun DiscordBitSet(value: String): DiscordBitSet {

return DiscordBitSet(destination)
}


@Deprecated(
"Replaced by 'DiscordBitSet.serializer()'. This declaration will be removed in 0.16.0.",
ReplaceWith("DiscordBitSet.serializer()", imports = ["dev.kord.common.DiscordBitSet"]),
DeprecationLevel.HIDDEN,
)
public object DiscordBitSetSerializer : KSerializer<DiscordBitSet> by DiscordBitSet.Serializer
Loading

0 comments on commit a6a8e6d

Please sign in to comment.