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 #826

Merged
merged 1 commit into from
May 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ out/
**/build/*
!**/build/generated/
# re-exclude BuildConfigGenerated.kt
common/build/generated/source/buildConfig/main/main/dev/kord/common/BuildConfigGenerated.kt
common/build/generated/sources/buildConfig/main/dev/kord/common/BuildConfigGenerated.kt
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Compiler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ object Jvm {
}

fun KotlinCommonCompilerOptions.applyKordCompilerOptions() {
// TODO: set to true again once https://github.com/Kotlin/kotlinx-atomicfu/issues/289 is fixed
allWarningsAsErrors = false
allWarningsAsErrors = true
freeCompilerArgs.add("-progressive")
}

fun KotlinSourceSet.applyKordOptIns() {
languageSettings {
// allow `ExperimentalCoroutinesApi` for `TestScope.currentTime`
if ("Test" in name) optIn(OptIns.coroutines)
kordOptIns.forEach(::optIn)
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/kord-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ kotlin {
jvmToolchain(Jvm.target)

sourceSets {
// allow `ExperimentalCoroutinesApi` for `runTest {}`
// allow `ExperimentalCoroutinesApi` for `TestScope.currentTime`
test { languageSettings.optIn(OptIns.coroutines) }
}
}
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
Expand Up @@ -81,6 +81,12 @@ tasks {
}
}

afterEvaluate {
named("sourcesJar") {
dependsOn("kspCommonMainKotlinMetadata")
}
}

withType<AbstractDokkaLeafTask>().configureEach {
applyKordDokkaOptions()
dependsOn("kspCommonMainKotlinMetadata")
Expand Down
232 changes: 116 additions & 116 deletions common/api/common.api

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions common/src/commonMain/kotlin/entity/Data.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package dev.kord.common.entity

import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.OptionalSnowflake
import dev.kord.common.serialization.InstantInEpochSecondsSerializer
import dev.kord.common.serialization.InstantInEpochSeconds
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand All @@ -25,7 +25,6 @@ public data class DiscordTyping(
val guildId: OptionalSnowflake = OptionalSnowflake.Missing,
@SerialName("user_id")
val userId: Snowflake,
@Serializable(with = InstantInEpochSecondsSerializer::class)
val timestamp: Instant,
val timestamp: InstantInEpochSeconds,
val member: Optional<DiscordGuildMember> = Optional.Missing()
)
10 changes: 4 additions & 6 deletions common/src/commonMain/kotlin/entity/DiscordActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ package dev.kord.common.entity
import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.OptionalBoolean
import dev.kord.common.entity.optional.OptionalSnowflake
import dev.kord.common.serialization.InstantInEpochMillisecondsSerializer
import dev.kord.common.serialization.InstantInEpochMilliseconds
import dev.kord.ksp.GenerateKordEnum
import dev.kord.ksp.GenerateKordEnum.Entry
import dev.kord.ksp.GenerateKordEnum.ValueType.INT
import kotlinx.datetime.Instant
import kotlinx.serialization.*
import kotlinx.serialization.builtins.ListSerializer
import kotlinx.serialization.builtins.serializer
Expand All @@ -41,8 +40,7 @@ public data class DiscordActivity(
val type: ActivityType,
val url: Optional<String?> = Optional.Missing(),
@SerialName("created_at")
@Serializable(with = InstantInEpochMillisecondsSerializer::class)
val createdAt: Instant,
val createdAt: InstantInEpochMilliseconds,
val timestamps: Optional<DiscordActivityTimestamps> = Optional.Missing(),
@SerialName("application_id")
val applicationId: OptionalSnowflake = OptionalSnowflake.Missing,
Expand Down Expand Up @@ -88,8 +86,8 @@ public class ActivityFlags(public val value: Int) {

@Serializable
public data class DiscordActivityTimestamps(
val start: Optional<@Serializable(with = InstantInEpochMillisecondsSerializer::class) Instant> = Optional.Missing(),
val end: Optional<@Serializable(with = InstantInEpochMillisecondsSerializer::class) Instant> = Optional.Missing(),
val start: Optional<InstantInEpochMilliseconds> = Optional.Missing(),
val end: Optional<InstantInEpochMilliseconds> = Optional.Missing(),
)

@Serializable
Expand Down
15 changes: 5 additions & 10 deletions common/src/commonMain/kotlin/serialization/InstantSerializers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dev.kord.common.serialization

import kotlinx.datetime.Instant
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationException
import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
Expand Down Expand Up @@ -36,11 +37,8 @@ public object InstantInEpochMillisecondsSerializer : KSerializer<Instant> {
}
}

// TODO use this typealias instead of annotating types/properties with
// @Serializable(with = InstantInEpochMillisecondsSerializer::class) once
// https://github.com/Kotlin/kotlinx.serialization/issues/1895 is fixed
// /** An [Instant] that is [serializable][Serializable] with [InstantInEpochMillisecondsSerializer]. */
// public typealias InstantInEpochMilliseconds = @Serializable(with = InstantInEpochMillisecondsSerializer::class) Instant
/** An [Instant] that is [serializable][Serializable] with [InstantInEpochMillisecondsSerializer]. */
public typealias InstantInEpochMilliseconds = @Serializable(with = InstantInEpochMillisecondsSerializer::class) Instant


// epoch seconds
Expand All @@ -61,8 +59,5 @@ public object InstantInEpochSecondsSerializer : KSerializer<Instant> {
}
}

// TODO use this typealias instead of annotating types/properties with
// @Serializable(with = InstantInEpochSecondsSerializer::class) once
// https://github.com/Kotlin/kotlinx.serialization/issues/1895 is fixed
// /** An [Instant] that is [serializable][Serializable] with [InstantInEpochSecondsSerializer]. */
// public typealias InstantInEpochSeconds = @Serializable(with = InstantInEpochSecondsSerializer::class) Instant
/** An [Instant] that is [serializable][Serializable] with [InstantInEpochSecondsSerializer]. */
public typealias InstantInEpochSeconds = @Serializable(with = InstantInEpochSecondsSerializer::class) Instant
Loading