Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #842

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions buildSrc/src/main/kotlin/Compiler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ object OptIns {
}

val kordOptIns = listOf(
"kotlin.time.ExperimentalTime",
"kotlin.contracts.ExperimentalContracts",

"dev.kord.common.annotation.KordInternal",
Expand All @@ -27,7 +26,7 @@ object Jvm {

fun KotlinCommonCompilerOptions.applyKordCompilerOptions() {
allWarningsAsErrors = true
freeCompilerArgs.add("-progressive")
progressiveMode = true
}

fun KotlinSourceSet.applyKordOptIns() {
Expand Down
5 changes: 0 additions & 5 deletions buildSrc/src/main/kotlin/kord-internal-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
org.jetbrains.kotlin.jvm
}
Expand All @@ -10,9 +8,6 @@ repositories {

kotlin {
jvmToolchain(Jvm.target)
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
applyKordCompilerOptions()
}
Expand Down
12 changes: 5 additions & 7 deletions buildSrc/src/main/kotlin/kord-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ kotlin {

jvmToolchain(Jvm.target)

compilerOptions {
applyKordCompilerOptions()
optIn.addAll(kordOptIns)
}

sourceSets {
// allow `ExperimentalCoroutinesApi` for `TestScope.currentTime`
test { languageSettings.optIn(OptIns.coroutines) }
Expand All @@ -37,13 +42,6 @@ kotlin {
configureAtomicFU()

tasks {
withType<KotlinCompile>().configureEach {
compilerOptions {
applyKordCompilerOptions()
freeCompilerArgs.addAll(kordOptIns.map { "-opt-in=$it" })
}
}

withType<Test>().configureEach {
useJUnitPlatform()
}
Expand Down
8 changes: 8 additions & 0 deletions common/api/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public final class dev/kord/common/DiscordTimestampStyle : java/lang/Enum {
public static final field ShortDate Ldev/kord/common/DiscordTimestampStyle;
public static final field ShortDateTime Ldev/kord/common/DiscordTimestampStyle;
public static final field ShortTime Ldev/kord/common/DiscordTimestampStyle;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getStyle ()Ljava/lang/String;
public static fun valueOf (Ljava/lang/String;)Ldev/kord/common/DiscordTimestampStyle;
public static fun values ()[Ldev/kord/common/DiscordTimestampStyle;
Expand Down Expand Up @@ -189,6 +190,7 @@ public final class dev/kord/common/entity/ActivityFlag : java/lang/Enum {
public static final field Play Ldev/kord/common/entity/ActivityFlag;
public static final field Spectate Ldev/kord/common/entity/ActivityFlag;
public static final field Sync Ldev/kord/common/entity/ActivityFlag;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ActivityFlag;
public static fun values ()[Ldev/kord/common/entity/ActivityFlag;
Expand Down Expand Up @@ -540,6 +542,7 @@ public final class dev/kord/common/entity/ApplicationFlag : java/lang/Enum {
public static final field GatewayPresenceLimited Ldev/kord/common/entity/ApplicationFlag;
public static final field VerificationPendingGuildLimit Ldev/kord/common/entity/ApplicationFlag;
public final fun getCode ()I
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun plus (Ldev/kord/common/entity/ApplicationFlag;)Ldev/kord/common/entity/ApplicationFlags;
public final fun plus (Ldev/kord/common/entity/ApplicationFlags;)Ldev/kord/common/entity/ApplicationFlags;
public static fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ApplicationFlag;
Expand Down Expand Up @@ -1448,6 +1451,7 @@ public final class dev/kord/common/entity/ChannelFlag : java/lang/Enum {
public static final field Pinned Ldev/kord/common/entity/ChannelFlag;
public static final field RequireTag Ldev/kord/common/entity/ChannelFlag;
public final fun getCode ()I
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun plus (Ldev/kord/common/entity/ChannelFlag;)Ldev/kord/common/entity/ChannelFlags;
public final fun plus (Ldev/kord/common/entity/ChannelFlags;)Ldev/kord/common/entity/ChannelFlags;
public static fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ChannelFlag;
Expand Down Expand Up @@ -6580,6 +6584,7 @@ public final class dev/kord/common/entity/GuildMemberFlag : java/lang/Enum {
public static final field DidRejoin Ldev/kord/common/entity/GuildMemberFlag;
public static final field StartedOnboarding Ldev/kord/common/entity/GuildMemberFlag;
public final fun getCode ()I
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/GuildMemberFlag;
public static fun values ()[Ldev/kord/common/entity/GuildMemberFlag;
}
Expand Down Expand Up @@ -7091,6 +7096,7 @@ public final class dev/kord/common/entity/MessageFlag : java/lang/Enum {
public static final field SuppressNotifications Ldev/kord/common/entity/MessageFlag;
public static final field Urgent Ldev/kord/common/entity/MessageFlag;
public final fun getCode ()I
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/MessageFlag;
public static fun values ()[Ldev/kord/common/entity/MessageFlag;
}
Expand Down Expand Up @@ -8115,6 +8121,7 @@ public final class dev/kord/common/entity/SystemChannelFlag : java/lang/Enum {
public static final field SuppressRoleSubscriptionPurchaseNotificationReplies Ldev/kord/common/entity/SystemChannelFlag;
public static final field SuppressRoleSubscriptionPurchaseNotifications Ldev/kord/common/entity/SystemChannelFlag;
public final fun getCode ()I
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/SystemChannelFlag;
public static fun values ()[Ldev/kord/common/entity/SystemChannelFlag;
}
Expand Down Expand Up @@ -8211,6 +8218,7 @@ public final class dev/kord/common/entity/UserFlag : java/lang/Enum {
public static final field VerifiedBot Ldev/kord/common/entity/UserFlag;
public static final field VerifiedBotDeveloper Ldev/kord/common/entity/UserFlag;
public final fun getCode ()I
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/UserFlag;
public static fun values ()[Ldev/kord/common/entity/UserFlag;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
// THIS FILE IS AUTO-GENERATED BY KordEnumProcessor.kt, DO NOT EDIT!
// THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
@file:Suppress(names = arrayOf("RedundantVisibilityModifier", "IncorrectFormatting",
"ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection"))

package dev.kord.common.entity

import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.LazyThreadSafetyMode.PUBLICATION
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.PrimitiveKind
Expand All @@ -30,13 +24,12 @@ public sealed class ActivityType(
*/
public val code: Int,
) {
public final override fun equals(other: Any?): Boolean = this === other ||
final override fun equals(other: Any?): Boolean = this === other ||
(other is ActivityType && this.code == other.code)

public final override fun hashCode(): Int = code.hashCode()
final override fun hashCode(): Int = code.hashCode()

public final override fun toString(): String =
"ActivityType.${this::class.simpleName}(code=$code)"
final override fun toString(): String = "ActivityType.${this::class.simpleName}(code=$code)"

/**
* An unknown [ActivityType].
Expand All @@ -60,13 +53,15 @@ public sealed class ActivityType(
public object Competing : ActivityType(5)

internal object Serializer : KSerializer<ActivityType> {
public override val descriptor: SerialDescriptor =
override val descriptor: SerialDescriptor =
PrimitiveSerialDescriptor("dev.kord.common.entity.ActivityType", PrimitiveKind.INT)

public override fun serialize(encoder: Encoder, `value`: ActivityType) =
encoder.encodeInt(value.code)
override fun serialize(encoder: Encoder, `value`: ActivityType) {
encoder.encodeInt(value.code)
}

public override fun deserialize(decoder: Decoder) = when (val code = decoder.decodeInt()) {
override fun deserialize(decoder: Decoder): ActivityType =
when (val code = decoder.decodeInt()) {
0 -> Game
1 -> Streaming
2 -> Listening
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
// THIS FILE IS AUTO-GENERATED BY KordEnumProcessor.kt, DO NOT EDIT!
// THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
@file:Suppress(names = arrayOf("RedundantVisibilityModifier", "IncorrectFormatting",
"ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection"))

package dev.kord.common.entity

import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.LazyThreadSafetyMode.PUBLICATION
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.PrimitiveKind
Expand All @@ -30,12 +24,12 @@ public sealed class AllowedMentionType(
*/
public val `value`: String,
) {
public final override fun equals(other: Any?): Boolean = this === other ||
final override fun equals(other: Any?): Boolean = this === other ||
(other is AllowedMentionType && this.value == other.value)

public final override fun hashCode(): Int = value.hashCode()
final override fun hashCode(): Int = value.hashCode()

public final override fun toString(): String =
final override fun toString(): String =
"AllowedMentionType.${this::class.simpleName}(value=$value)"

/**
Expand Down Expand Up @@ -63,14 +57,15 @@ public sealed class AllowedMentionType(
public object EveryoneMentions : AllowedMentionType("everyone")

internal object Serializer : KSerializer<AllowedMentionType> {
public override val descriptor: SerialDescriptor =
override val descriptor: SerialDescriptor =
PrimitiveSerialDescriptor("dev.kord.common.entity.AllowedMentionType",
PrimitiveKind.STRING)

public override fun serialize(encoder: Encoder, `value`: AllowedMentionType) =
encoder.encodeString(value.value)
override fun serialize(encoder: Encoder, `value`: AllowedMentionType) {
encoder.encodeString(value.value)
}

public override fun deserialize(decoder: Decoder) =
override fun deserialize(decoder: Decoder): AllowedMentionType =
when (val value = decoder.decodeString()) {
"roles" -> RoleMentions
"users" -> UserMentions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// THIS FILE IS AUTO-GENERATED BY KordEnumProcessor.kt, DO NOT EDIT!
// THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
@file:Suppress(names = arrayOf("RedundantVisibilityModifier", "IncorrectFormatting",
"ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection"))

package dev.kord.common.entity

import kotlin.Any
import kotlin.Int
import kotlin.LazyThreadSafetyMode.PUBLICATION
import kotlin.Suppress
import kotlin.collections.List
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.PrimitiveKind
Expand All @@ -28,12 +24,12 @@ public sealed class ApplicationCommandOptionType(
*/
public val type: Int,
) {
public final override fun equals(other: Any?): kotlin.Boolean = this === other ||
final override fun equals(other: Any?): kotlin.Boolean = this === other ||
(other is ApplicationCommandOptionType && this.type == other.type)

public final override fun hashCode(): Int = type.hashCode()
final override fun hashCode(): Int = type.hashCode()

public final override fun toString(): kotlin.String =
final override fun toString(): kotlin.String =
"ApplicationCommandOptionType.${this::class.simpleName}(type=$type)"

/**
Expand Down Expand Up @@ -81,14 +77,16 @@ public sealed class ApplicationCommandOptionType(
public object Attachment : ApplicationCommandOptionType(11)

internal object Serializer : KSerializer<ApplicationCommandOptionType> {
public override val descriptor: SerialDescriptor =
override val descriptor: SerialDescriptor =
PrimitiveSerialDescriptor("dev.kord.common.entity.ApplicationCommandOptionType",
PrimitiveKind.INT)

public override fun serialize(encoder: Encoder, `value`: ApplicationCommandOptionType) =
encoder.encodeInt(value.type)
override fun serialize(encoder: Encoder, `value`: ApplicationCommandOptionType) {
encoder.encodeInt(value.type)
}

public override fun deserialize(decoder: Decoder) = when (val type = decoder.decodeInt()) {
override fun deserialize(decoder: Decoder): ApplicationCommandOptionType =
when (val type = decoder.decodeInt()) {
1 -> SubCommand
2 -> SubCommandGroup
3 -> String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
// THIS FILE IS AUTO-GENERATED BY KordEnumProcessor.kt, DO NOT EDIT!
// THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
@file:Suppress(names = arrayOf("RedundantVisibilityModifier", "IncorrectFormatting",
"ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection"))

package dev.kord.common.entity

import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.LazyThreadSafetyMode.PUBLICATION
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.PrimitiveKind
Expand All @@ -30,12 +24,12 @@ public sealed class ApplicationCommandPermissionType(
*/
public val `value`: Int,
) {
public final override fun equals(other: Any?): Boolean = this === other ||
final override fun equals(other: Any?): Boolean = this === other ||
(other is ApplicationCommandPermissionType && this.value == other.value)

public final override fun hashCode(): Int = value.hashCode()
final override fun hashCode(): Int = value.hashCode()

public final override fun toString(): String =
final override fun toString(): String =
"ApplicationCommandPermissionType.${this::class.simpleName}(value=$value)"

/**
Expand All @@ -55,14 +49,16 @@ public sealed class ApplicationCommandPermissionType(
public object Channel : ApplicationCommandPermissionType(3)

internal object Serializer : KSerializer<ApplicationCommandPermissionType> {
public override val descriptor: SerialDescriptor =
override val descriptor: SerialDescriptor =
PrimitiveSerialDescriptor("dev.kord.common.entity.ApplicationCommandPermissionType",
PrimitiveKind.INT)

public override fun serialize(encoder: Encoder, `value`: ApplicationCommandPermissionType) =
encoder.encodeInt(value.value)
override fun serialize(encoder: Encoder, `value`: ApplicationCommandPermissionType) {
encoder.encodeInt(value.value)
}

public override fun deserialize(decoder: Decoder) = when (val value = decoder.decodeInt()) {
override fun deserialize(decoder: Decoder): ApplicationCommandPermissionType =
when (val value = decoder.decodeInt()) {
1 -> Role
2 -> User
3 -> Channel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
// THIS FILE IS AUTO-GENERATED BY KordEnumProcessor.kt, DO NOT EDIT!
// THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
@file:Suppress(names = arrayOf("RedundantVisibilityModifier", "IncorrectFormatting",
"ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection"))

package dev.kord.common.entity

import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.LazyThreadSafetyMode.PUBLICATION
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.PrimitiveKind
Expand All @@ -30,12 +24,12 @@ public sealed class ApplicationCommandType(
*/
public val `value`: Int,
) {
public final override fun equals(other: Any?): Boolean = this === other ||
final override fun equals(other: Any?): Boolean = this === other ||
(other is ApplicationCommandType && this.value == other.value)

public final override fun hashCode(): Int = value.hashCode()
final override fun hashCode(): Int = value.hashCode()

public final override fun toString(): String =
final override fun toString(): String =
"ApplicationCommandType.${this::class.simpleName}(value=$value)"

/**
Expand Down Expand Up @@ -63,14 +57,16 @@ public sealed class ApplicationCommandType(
public object Message : ApplicationCommandType(3)

internal object Serializer : KSerializer<ApplicationCommandType> {
public override val descriptor: SerialDescriptor =
override val descriptor: SerialDescriptor =
PrimitiveSerialDescriptor("dev.kord.common.entity.ApplicationCommandType",
PrimitiveKind.INT)

public override fun serialize(encoder: Encoder, `value`: ApplicationCommandType) =
encoder.encodeInt(value.value)
override fun serialize(encoder: Encoder, `value`: ApplicationCommandType) {
encoder.encodeInt(value.value)
}

public override fun deserialize(decoder: Decoder) = when (val value = decoder.decodeInt()) {
override fun deserialize(decoder: Decoder): ApplicationCommandType =
when (val value = decoder.decodeInt()) {
1 -> ChatInput
2 -> User
3 -> Message
Expand Down
Loading