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

Dependency updates #998

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 3 additions & 9 deletions buildSrc/src/main/kotlin/Git.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import org.gradle.api.Project
import java.io.ByteArrayOutputStream
import org.gradle.api.provider.Provider

internal fun Project.git(vararg command: String): String {
val output = ByteArrayOutputStream()
exec {
internal fun Project.git(vararg command: String) = providers.exec {
commandLine("git", *command)
standardOutput = output
errorOutput = output
workingDir = rootDir
}.rethrowFailure().assertNormalExitValue()
return output.toString().trim()
}
}.standardOutput.asText.map { it.trim() }.get()
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/Projects.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.gradle.api.Project
import org.gradle.api.provider.Provider

object Library {
const val name = "kord"
Expand Down
121 changes: 0 additions & 121 deletions common/api/common.api

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
@file:Suppress(names = arrayOf("IncorrectFormatting", "ReplaceArrayOfWithLiteral",
"SpellCheckingInspection", "GrazieInspection"))
@file:Suppress(names = arrayOf("IncorrectFormatting", "ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection"))

package dev.kord.common.entity

Expand All @@ -18,8 +17,7 @@ import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [ActivityFlag]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags).
* See [ActivityFlag]s in the [Discord Developer Documentation](https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags).
*/
public sealed class ActivityFlag(
/**
Expand All @@ -38,27 +36,20 @@ public sealed class ActivityFlag(
get() = 1 shl shift

/**
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` and
* [flag].
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` and [flag].
*/
public operator fun plus(flag: ActivityFlag): ActivityFlags =
ActivityFlags(this.value or flag.value)
public operator fun plus(flag: ActivityFlag): ActivityFlags = ActivityFlags(this.value or flag.value)

/**
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` and
* [flags].
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` and [flags].
*/
public operator fun plus(flags: ActivityFlags): ActivityFlags =
ActivityFlags(this.value or flags.value)
public operator fun plus(flags: ActivityFlags): ActivityFlags = ActivityFlags(this.value or flags.value)

final override fun equals(other: Any?): Boolean = this === other ||
(other is ActivityFlag && this.shift == other.shift)
final override fun equals(other: Any?): Boolean = this === other || (other is ActivityFlag && this.shift == other.shift)

final override fun hashCode(): Int = shift.hashCode()

final override fun toString(): String =
if (this is Unknown) "ActivityFlag.Unknown(shift=$shift)"
else "ActivityFlag.${this::class.simpleName}"
final override fun toString(): String = if (this is Unknown) "ActivityFlag.Unknown(shift=$shift)" else "ActivityFlag.${this::class.simpleName}"

/**
* An unknown [ActivityFlag].
Expand Down Expand Up @@ -106,8 +97,7 @@ public sealed class ActivityFlag(
}

/**
* Returns an instance of [ActivityFlag] with [ActivityFlag.shift] equal to the specified
* [shift].
* Returns an instance of [ActivityFlag] with [ActivityFlag.shift] equal to the specified [shift].
*
* @throws IllegalArgumentException if [shift] is not in 0..30.
*/
Expand Down Expand Up @@ -150,8 +140,7 @@ public sealed class ActivityFlag(
*
* ## Modifying an existing instance of [ActivityFlags]
*
* You can create a modified copy of an existing instance of [ActivityFlags] using the [copy]
* method:
* You can create a modified copy of an existing instance of [ActivityFlags] using the [copy] method:
* ```kotlin
* activityFlags.copy {
* +ActivityFlag.Instance
Expand All @@ -169,20 +158,17 @@ public sealed class ActivityFlag(
*
* ## Checking for [ActivityFlag]s
*
* You can use the [contains] operator to check whether an instance of [ActivityFlags] contains
* specific [ActivityFlag]s:
* You can use the [contains] operator to check whether an instance of [ActivityFlags] contains specific [ActivityFlag]s:
* ```kotlin
* val hasActivityFlag = ActivityFlag.Instance in activityFlags
* val hasActivityFlags = ActivityFlags(ActivityFlag.Instance, ActivityFlag.Join) in activityFlags
* ```
*
* ## Unknown [ActivityFlag]s
*
* Whenever [ActivityFlag]s haven't been added to Kord yet, they will be deserialized as instances
* of [ActivityFlag.Unknown].
* Whenever [ActivityFlag]s haven't been added to Kord yet, they will be deserialized as instances of [ActivityFlag.Unknown].
*
* You can also use [ActivityFlag.fromShift] to check for [unknown][ActivityFlag.Unknown]
* [ActivityFlag]s.
* You can also use [ActivityFlag.fromShift] to check for [unknown][ActivityFlag.Unknown] [ActivityFlag]s.
* ```kotlin
* val hasUnknownActivityFlag = ActivityFlag.fromShift(23) in activityFlags
* ```
Expand Down Expand Up @@ -214,42 +200,32 @@ public class ActivityFlags internal constructor(
/**
* Checks if this instance of [ActivityFlags] has all bits set that are set in [flag].
*/
public operator fun contains(flag: ActivityFlag): Boolean =
this.value and flag.value == flag.value
public operator fun contains(flag: ActivityFlag): Boolean = this.value and flag.value == flag.value

/**
* Checks if this instance of [ActivityFlags] has all bits set that are set in [flags].
*/
public operator fun contains(flags: ActivityFlags): Boolean =
this.value and flags.value == flags.value
public operator fun contains(flags: ActivityFlags): Boolean = this.value and flags.value == flags.value

/**
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` and
* [flag].
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` and [flag].
*/
public operator fun plus(flag: ActivityFlag): ActivityFlags =
ActivityFlags(this.value or flag.value)
public operator fun plus(flag: ActivityFlag): ActivityFlags = ActivityFlags(this.value or flag.value)

/**
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` and
* [flags].
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` and [flags].
*/
public operator fun plus(flags: ActivityFlags): ActivityFlags =
ActivityFlags(this.value or flags.value)
public operator fun plus(flags: ActivityFlags): ActivityFlags = ActivityFlags(this.value or flags.value)

/**
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` except
* the bits that are set in [flag].
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` except the bits that are set in [flag].
*/
public operator fun minus(flag: ActivityFlag): ActivityFlags =
ActivityFlags(this.value and flag.value.inv())
public operator fun minus(flag: ActivityFlag): ActivityFlags = ActivityFlags(this.value and flag.value.inv())

/**
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` except
* the bits that are set in [flags].
* Returns an instance of [ActivityFlags] that has all bits set that are set in `this` except the bits that are set in [flags].
*/
public operator fun minus(flags: ActivityFlags): ActivityFlags =
ActivityFlags(this.value and flags.value.inv())
public operator fun minus(flags: ActivityFlags): ActivityFlags = ActivityFlags(this.value and flags.value.inv())

/**
* Returns a copy of this instance of [ActivityFlags] modified with [builder].
Expand All @@ -259,8 +235,7 @@ public class ActivityFlags internal constructor(
return Builder(value).apply(builder).build()
}

override fun equals(other: Any?): Boolean = this === other ||
(other is ActivityFlags && this.value == other.value)
override fun equals(other: Any?): Boolean = this === other || (other is ActivityFlags && this.value == other.value)

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

Expand Down Expand Up @@ -298,8 +273,7 @@ public class ActivityFlags internal constructor(
}

/**
* Returns an instance of [ActivityFlags] that has all bits set that are currently set in
* this [Builder].
* Returns an instance of [ActivityFlags] that has all bits set that are currently set in this [Builder].
*/
public fun build(): ActivityFlags = ActivityFlags(value)
}
Expand All @@ -314,8 +288,7 @@ public class ActivityFlags internal constructor(
encoder.encodeSerializableValue(delegate, value.value)
}

override fun deserialize(decoder: Decoder): ActivityFlags =
ActivityFlags(decoder.decodeSerializableValue(delegate))
override fun deserialize(decoder: Decoder): ActivityFlags = ActivityFlags(decoder.decodeSerializableValue(delegate))
}
}

Expand All @@ -328,32 +301,28 @@ public inline fun ActivityFlags(builder: ActivityFlags.Builder.() -> Unit = {}):
}

/**
* Returns an instance of [ActivityFlags] that has all bits set that are set in any element of
* [flags].
* Returns an instance of [ActivityFlags] that has all bits set that are set in any element of [flags].
*/
public fun ActivityFlags(vararg flags: ActivityFlag): ActivityFlags = ActivityFlags {
flags.forEach { +it }
}

/**
* Returns an instance of [ActivityFlags] that has all bits set that are set in any element of
* [flags].
* Returns an instance of [ActivityFlags] that has all bits set that are set in any element of [flags].
*/
public fun ActivityFlags(vararg flags: ActivityFlags): ActivityFlags = ActivityFlags {
flags.forEach { +it }
}

/**
* Returns an instance of [ActivityFlags] that has all bits set that are set in any element of
* [flags].
* Returns an instance of [ActivityFlags] that has all bits set that are set in any element of [flags].
*/
public fun ActivityFlags(flags: Iterable<ActivityFlag>): ActivityFlags = ActivityFlags {
flags.forEach { +it }
}

/**
* Returns an instance of [ActivityFlags] that has all bits set that are set in any element of
* [flags].
* Returns an instance of [ActivityFlags] that has all bits set that are set in any element of [flags].
*/
@JvmName("ActivityFlags0")
public fun ActivityFlags(flags: Iterable<ActivityFlags>): ActivityFlags = ActivityFlags {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
@file:Suppress(names = arrayOf("IncorrectFormatting", "ReplaceArrayOfWithLiteral",
"SpellCheckingInspection", "GrazieInspection"))
@file:Suppress(names = arrayOf("IncorrectFormatting", "ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection"))

package dev.kord.common.entity

Expand All @@ -14,8 +13,7 @@ import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [ActivityPlatform]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/events/gateway-events#activity-object).
* See [ActivityPlatform]s in the [Discord Developer Documentation](https://discord.com/developers/docs/events/gateway-events#activity-object).
*/
@Serializable(with = ActivityPlatform.Serializer::class)
public sealed class ActivityPlatform(
Expand All @@ -24,14 +22,11 @@ public sealed class ActivityPlatform(
*/
public val `value`: String,
) {
final override fun equals(other: Any?): Boolean = this === other ||
(other is ActivityPlatform && this.value == other.value)
final override fun equals(other: Any?): Boolean = this === other || (other is ActivityPlatform && this.value == other.value)

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

final override fun toString(): String =
if (this is Unknown) "ActivityPlatform.Unknown(value=$value)"
else "ActivityPlatform.${this::class.simpleName}"
final override fun toString(): String = if (this is Unknown) "ActivityPlatform.Unknown(value=$value)" else "ActivityPlatform.${this::class.simpleName}"

/**
* An unknown [ActivityPlatform].
Expand Down Expand Up @@ -60,8 +55,7 @@ public sealed class ActivityPlatform(

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

override fun serialize(encoder: Encoder, `value`: ActivityPlatform) {
encoder.encodeString(value.value)
Expand All @@ -88,8 +82,7 @@ public sealed class ActivityPlatform(
}

/**
* Returns an instance of [ActivityPlatform] with [ActivityPlatform.value] equal to the
* specified [value].
* Returns an instance of [ActivityPlatform] with [ActivityPlatform.value] equal to the specified [value].
*/
public fun from(`value`: String): ActivityPlatform = when (value) {
"desktop" -> Desktop
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
@file:Suppress(names = arrayOf("IncorrectFormatting", "ReplaceArrayOfWithLiteral",
"SpellCheckingInspection", "GrazieInspection"))
@file:Suppress(names = arrayOf("IncorrectFormatting", "ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection"))

package dev.kord.common.entity

Expand All @@ -14,8 +13,7 @@ import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [ActivityType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types).
* See [ActivityType]s in the [Discord Developer Documentation](https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types).
*/
@Serializable(with = ActivityType.Serializer::class)
public sealed class ActivityType(
Expand All @@ -24,13 +22,11 @@ public sealed class ActivityType(
*/
public val code: Int,
) {
final override fun equals(other: Any?): Boolean = this === other ||
(other is ActivityType && this.code == other.code)
final override fun equals(other: Any?): Boolean = this === other || (other is ActivityType && this.code == other.code)

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

final override fun toString(): String = if (this is Unknown) "ActivityType.Unknown(code=$code)"
else "ActivityType.${this::class.simpleName}"
final override fun toString(): String = if (this is Unknown) "ActivityType.Unknown(code=$code)" else "ActivityType.${this::class.simpleName}"

/**
* An unknown [ActivityType].
Expand Down Expand Up @@ -80,8 +76,7 @@ public sealed class ActivityType(
}

/**
* Returns an instance of [ActivityType] with [ActivityType.code] equal to the specified
* [code].
* Returns an instance of [ActivityType] with [ActivityType.code] equal to the specified [code].
*/
public fun from(code: Int): ActivityType = when (code) {
0 -> Game
Expand Down
Loading