Skip to content

Commit

Permalink
Merge branch 'main' into kotlin-2.0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann committed Aug 29, 2024
2 parents 74582f5 + 4ecbb47 commit e065fcb
Show file tree
Hide file tree
Showing 30 changed files with 173 additions and 61 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deployment-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
KORD_TEST_TOKEN: ${{ secrets.KORD_TEST_TOKEN }}
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
KORD_REPO_USER: ${{ secrets.KORD_REPO_USER }}
KORD_REPO_PASSWORD: ${{ secrets.KORD_REPO_PASSWORD }}
SIGNING_KEY: ${{ secrets.signingKey }}
SIGNING_PASSWORD: ${{ secrets.signingPassword }}
steps:
Expand Down
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ in [`gradle.properties`](gradle.properties))
```kotlin
repositories {
mavenCentral()
// Kord Snapshots Repository (Optional):
// Kord Snapshot Repositories (optional, choose one of these):
maven("https://repo.kord.dev/snapshots")
maven("https://oss.sonatype.org/content/repositories/snapshots")
}

Expand All @@ -82,7 +83,10 @@ dependencies {
```groovy
repositories {
mavenCentral()
// Kord Snapshots Repository (Optional):
// Kord Snapshot Repositories (optional, choose one of these):
maven {
url "https://repo.kord.dev/snapshots"
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
Expand All @@ -95,9 +99,19 @@ dependencies {

### Maven

##### Kord Snapshots Repository (Optional):
##### Kord Snapshot Repositories (optional, choose one of these):

```xml
<repository>
<id>snapshots-repo</id>
<url>https://repo.kord.dev/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>

<repository>
<id>snapshots-repo</id>
Expand All @@ -114,7 +128,6 @@ dependencies {
---

```xml

<dependency>
<groupId>dev.kord</groupId>
<artifactId>kord-core-jvm</artifactId>
Expand Down
11 changes: 11 additions & 0 deletions buildSrc/src/main/kotlin/kord-publishing.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ publishing {
password = getenv("NEXUS_PASSWORD")
}
}

if (!isRelease) {
maven {
name = "kordSnapshots"
url = uri("https://repo.kord.dev/snapshots")
credentials {
username = getenv("KORD_REPO_USER")
password = getenv("KORD_REPO_PASSWORD")
}
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ public class Permissions internal constructor(

@Deprecated(
level = DeprecationLevel.HIDDEN,
message = "Binary compatibility, keep for some releases.",
message = "Kept for binary compatibility, this declaration will be removed in 0.17.0.",
)
public inline fun copy0(builder: Builder.() -> Unit): Permissions {
contract { callsInPlace(builder, EXACTLY_ONCE) }
Expand Down Expand Up @@ -620,7 +620,8 @@ public class Permissions internal constructor(
@Suppress(names = arrayOf("DEPRECATION_ERROR"))
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'Companion'.",
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.",
replaceWith = ReplaceWith(expression = "Permissions.Companion", imports =
arrayOf("dev.kord.common.entity.Permissions")),
)
Expand All @@ -630,7 +631,8 @@ public class Permissions internal constructor(

@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'Companion'.",
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.",
replaceWith = ReplaceWith(expression = "Permissions.Companion", imports =
arrayOf("dev.kord.common.entity.Permissions")),
)
Expand All @@ -650,7 +652,7 @@ public inline fun Permissions(builder: Permissions.Builder.() -> Unit = {}): Per
@Suppress(names = arrayOf("FunctionName"))
@Deprecated(
level = DeprecationLevel.HIDDEN,
message = "Binary compatibility, keep for some releases.",
message = "Kept for binary compatibility, this declaration will be removed in 0.17.0.",
)
public inline fun Permissions0(builder: Permissions.Builder.() -> Unit = {}): Permissions {
contract { callsInPlace(builder, EXACTLY_ONCE) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ public class SystemChannelFlags internal constructor(
@Suppress(names = arrayOf("DEPRECATION_ERROR"))
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'Companion'.",
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.",
replaceWith = ReplaceWith(expression = "SystemChannelFlags.Companion", imports =
arrayOf("dev.kord.common.entity.SystemChannelFlags")),
)
Expand All @@ -340,7 +341,8 @@ public class SystemChannelFlags internal constructor(

@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'Companion'.",
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.",
replaceWith = ReplaceWith(expression = "SystemChannelFlags.Companion", imports =
arrayOf("dev.kord.common.entity.SystemChannelFlags")),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public class UserFlags internal constructor(

@Deprecated(
level = DeprecationLevel.HIDDEN,
message = "Binary compatibility, keep for some releases.",
message = "Kept for binary compatibility, this declaration will be removed in 0.17.0.",
)
public inline fun copy0(builder: Builder.() -> Unit): UserFlags {
contract { callsInPlace(builder, EXACTLY_ONCE) }
Expand Down
2 changes: 1 addition & 1 deletion common/src/commonMain/kotlin/DiscordBitSet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public fun DiscordBitSet(value: String): DiscordBitSet {


@Deprecated(
"Replaced by 'DiscordBitSet.serializer()'.",
"Replaced by 'DiscordBitSet.serializer()'. This declaration will be removed in 0.16.0.",
ReplaceWith("DiscordBitSet.serializer()", imports = ["dev.kord.common.DiscordBitSet"]),
DeprecationLevel.HIDDEN,
)
Expand Down
2 changes: 1 addition & 1 deletion common/src/commonMain/kotlin/Locale.kt
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public data class Locale(val language: String, val country: String? = null) {
}

@Deprecated(
"Replaced by 'Locale.serializer()'.",
"Replaced by 'Locale.serializer()'. This declaration will be removed in 0.16.0.",
ReplaceWith("Locale.serializer()", imports = ["dev.kord.common.Locale"]),
DeprecationLevel.HIDDEN,
)
Expand Down
2 changes: 1 addition & 1 deletion common/src/commonMain/kotlin/entity/DiscordChannel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public sealed class ArchiveDuration(
@Suppress("UNUSED_PARAMETER") unused: Nothing?,
) : ArchiveDuration(duration) {
@Deprecated(
"Replaced by 'ArchiveDuration.from()'.",
"Replaced by 'ArchiveDuration.from()'. This declaration will be removed in 0.16.0.",
ReplaceWith("ArchiveDuration.from(duration)", imports = ["dev.kord.common.entity.ArchiveDuration"]),
DeprecationLevel.HIDDEN,
)
Expand Down
6 changes: 4 additions & 2 deletions common/src/commonMain/kotlin/entity/DiscordShard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public data class DiscordShard(val index: Int, val count: Int) {
public companion object {
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"Renamed to 'Companion'.",
"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.",
ReplaceWith("DiscordShard.Companion", imports = ["dev.kord.common.entity.DiscordShard"]),
DeprecationLevel.ERROR,
)
Expand All @@ -44,7 +45,8 @@ public data class DiscordShard(val index: Int, val count: Int) {
}

@Deprecated(
"Renamed to 'Companion'.",
"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.",
ReplaceWith("DiscordShard.Companion", imports = ["dev.kord.common.entity.DiscordShard"]),
DeprecationLevel.ERROR,
)
Expand Down
3 changes: 2 additions & 1 deletion common/src/commonMain/kotlin/entity/Permissions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public val Permissions.Companion.ALL: Permissions get() = ALL_PERMISSIONS

@Suppress("UnusedReceiverParameter", "DEPRECATION_ERROR")
@Deprecated(
"'Permissions.NewCompanion' was renamed to 'Permissions.Companion'. Use 'Permissions.Companion.ALL' instead.",
"'Permissions.NewCompanion' was renamed to 'Permissions.Companion'. Use 'Permissions.Companion.ALL' instead. The " +
"deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in 0.17.0.",
ReplaceWith("Permissions.ALL", imports = ["dev.kord.common.entity.Permissions", "dev.kord.common.entity.ALL"]),
DeprecationLevel.ERROR,
)
Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/Kord.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import kotlin.contracts.contract
import kotlin.coroutines.CoroutineContext
import kotlinx.coroutines.channels.Channel as CoroutineChannel

@Deprecated("Use your own logger instead, this will be removed in the future.", level = DeprecationLevel.HIDDEN)
@Deprecated("Use your own logger instead. This declaration will be removed in 0.16.0.", level = DeprecationLevel.HIDDEN)
public val kordLogger: mu.KLogger = mu.KotlinLogging.logger { }

private val logger = KotlinLogging.logger { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import dev.kord.core.event.Event

@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public sealed interface ApplicationCommandCreateEvent : Event {
Expand All @@ -17,7 +18,8 @@ public sealed interface ApplicationCommandCreateEvent : Event {
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class ChatInputCommandCreateEvent(
Expand All @@ -31,7 +33,8 @@ public class ChatInputCommandCreateEvent(
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class UserCommandCreateEvent(
Expand All @@ -45,7 +48,8 @@ public class UserCommandCreateEvent(
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class MessageCommandCreateEvent(
Expand All @@ -59,7 +63,8 @@ public class MessageCommandCreateEvent(
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class UnknownApplicationCommandCreateEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import dev.kord.core.event.Event

@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public sealed interface ApplicationCommandDeleteEvent : Event {
Expand All @@ -17,7 +18,8 @@ public sealed interface ApplicationCommandDeleteEvent : Event {
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class ChatInputCommandDeleteEvent(
Expand All @@ -31,7 +33,8 @@ public class ChatInputCommandDeleteEvent(
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class UserCommandDeleteEvent(
Expand All @@ -45,7 +48,8 @@ public class UserCommandDeleteEvent(
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class MessageCommandDeleteEvent(
Expand All @@ -59,7 +63,8 @@ public class MessageCommandDeleteEvent(
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class UnknownApplicationCommandDeleteEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import dev.kord.core.event.Event

@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public sealed interface ApplicationCommandUpdateEvent : Event {
Expand All @@ -17,7 +18,8 @@ public sealed interface ApplicationCommandUpdateEvent : Event {
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class ChatInputCommandUpdateEvent(
Expand All @@ -31,7 +33,8 @@ public class ChatInputCommandUpdateEvent(
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class UserCommandUpdateEvent(
Expand All @@ -45,7 +48,8 @@ public class UserCommandUpdateEvent(
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class MessageCommandUpdateEvent(
Expand All @@ -58,7 +62,8 @@ public class MessageCommandUpdateEvent(
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
"details. The deprecation level will be raised to HIDDEN in 0.16.0 and this declaration will be removed in " +
"0.17.0.",
level = DeprecationLevel.ERROR,
)
public class UnknownApplicationCommandUpdateEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ public class Intents internal constructor(

@Deprecated(
level = DeprecationLevel.HIDDEN,
message = "Binary compatibility, keep for some releases.",
message = "Kept for binary compatibility, this declaration will be removed in 0.17.0.",
)
public inline fun copy0(builder: Builder.() -> Unit): Intents {
contract { callsInPlace(builder, EXACTLY_ONCE) }
Expand Down Expand Up @@ -502,7 +502,7 @@ public inline fun Intents(builder: Intents.Builder.() -> Unit = {}): Intents {
@Suppress(names = arrayOf("FunctionName"))
@Deprecated(
level = DeprecationLevel.HIDDEN,
message = "Binary compatibility, keep for some releases.",
message = "Kept for binary compatibility, this declaration will be removed in 0.17.0.",
)
public inline fun Intents0(builder: Intents.Builder.() -> Unit = {}): Intents {
contract { callsInPlace(builder, EXACTLY_ONCE) }
Expand Down
Loading

0 comments on commit e065fcb

Please sign in to comment.