Skip to content

Commit

Permalink
build: 1.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Aug 20, 2021
1 parent dce08c4 commit 14db096
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 11 deletions.
18 changes: 9 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "xyz.cssxsh.mirai.plugin"
version = "1.2.6"
version = "1.2.7"

repositories {
mavenLocal()
Expand All @@ -20,16 +20,16 @@ repositories {
kotlin {
sourceSets {
all {
languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn")
languageSettings.useExperimentalAnnotation("kotlin.ExperimentalStdlibApi")
languageSettings.useExperimentalAnnotation("io.ktor.util.KtorExperimentalAPI")
languageSettings.useExperimentalAnnotation("kotlinx.serialization.InternalSerializationApi")
languageSettings.useExperimentalAnnotation("kotlinx.serialization.ExperimentalSerializationApi")
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.console.util.ConsoleExperimentalApi")
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.utils.MiraiExperimentalApi")
// languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn")
// languageSettings.useExperimentalAnnotation("kotlin.ExperimentalStdlibApi")
// languageSettings.useExperimentalAnnotation("io.ktor.util.KtorExperimentalAPI")
// languageSettings.useExperimentalAnnotation("kotlinx.serialization.InternalSerializationApi")
// languageSettings.useExperimentalAnnotation("kotlinx.serialization.ExperimentalSerializationApi")
// languageSettings.useExperimentalAnnotation("net.mamoe.mirai.console.util.ConsoleExperimentalApi")
// languageSettings.useExperimentalAnnotation("net.mamoe.mirai.utils.MiraiExperimentalApi")
}
test {
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.console.ConsoleFrontEndImplementation")
// languageSettings.useExperimentalAnnotation("net.mamoe.mirai.console.ConsoleFrontEndImplementation")
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/xyz/cssxsh/arknights/HttpClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ internal object Downloader : Closeable {
internal fun timestamp(value: Long) = OffsetDateTime.ofInstant(Instant.ofEpochSecond(value), SERVER_ZONE)

object TimestampSerializer : KSerializer<OffsetDateTime> {
@OptIn(InternalSerializationApi::class)
override val descriptor: SerialDescriptor =
buildSerialDescriptor(OffsetDateTime::class.qualifiedName!!, PrimitiveKind.LONG)

Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/xyz/cssxsh/arknights/mine/Question.kt
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ typealias EnemyQuestion = (enemies: EnemyMap) -> QuestionBuild

typealias WeeklyQuestion = (zones: WeeklyMap) -> QuestionBuild

@OptIn(ExperimentalStdlibApi::class)
val randomPlayerQuestion: ConstInfoQuestion = { const ->
val list = buildMap<String, Pair<Int, Set<Int>>> {
val speed = const.playerApRegenSpeed
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/xyz/cssxsh/arknights/penguin/Data.kt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ fun <V : TimePeriod> Iterable<V>.now() = time(OffsetDateTime.now())
typealias I18n<T> = Map<String, T>

object OffsetDataTimeSerializer : KSerializer<OffsetDateTime> {
@OptIn(InternalSerializationApi::class)
override val descriptor: SerialDescriptor
get() = buildSerialDescriptor(OffsetDateTime::class.qualifiedName!!, PrimitiveKind.LONG)

Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/xyz/cssxsh/arknights/weibo/Status.kt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ data class MicroBlogUser(
val name: String
)

@OptIn(ExperimentalSerializationApi::class)
@Serializer(OffsetDateTime::class)
object WeiboDateTimeSerializer : KSerializer<OffsetDateTime> {

Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/xyz/cssxsh/mirai/plugin/ArknightsData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import kotlinx.coroutines.sync.*
import net.mamoe.mirai.console.command.*
import net.mamoe.mirai.console.data.*
import net.mamoe.mirai.console.data.PluginDataExtensions.withDefault
import net.mamoe.mirai.console.util.*
import xyz.cssxsh.arknights.excel.*
import xyz.cssxsh.arknights.market.*
import xyz.cssxsh.arknights.mine.*
Expand Down Expand Up @@ -136,6 +137,7 @@ object ArknightsConfig : ReadOnlyPluginConfig("config") {
val auto by value<Boolean>(true)
}

@OptIn(ConsoleExperimentalApi::class)
fun <T, K, V> AbstractPluginData.delegate(key: T.() -> K) = object : ReadWriteProperty<T, V> {
override fun getValue(thisRef: T, property: KProperty<*>): V {
return findBackingFieldValue<MutableMap<K, V>>(property.name)!!.value.getValue(thisRef.key())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import xyz.cssxsh.arknights.*
import xyz.cssxsh.mirai.plugin.command.*

object ArknightsHelperPlugin : KotlinPlugin(
JvmPluginDescription("xyz.cssxsh.mirai.plugin.arknights-helper", "1.2.6") {
JvmPluginDescription("xyz.cssxsh.mirai.plugin.arknights-helper", "1.2.7") {
name("arknights-helper")
author("cssxsh")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ private suspend fun waitContacts() = supervisorScope {
}
}

@OptIn(ConsoleExperimentalApi::class)
internal object ArknightsSubscriber : CoroutineScope by ArknightsHelperPlugin.childScope("ArknightsSubscriber") {

private fun clock() = launch {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/xyz/cssxsh/mirai/plugin/ArknightsTools.kt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ internal fun role(name: String, roles: Set<String> = ExcelData.gacha.recruit())
when (it) {
in roles -> it
in RoleAlias -> RoleAlias.getValue(it)
else -> throw IllegalArgumentException("未知干员: ${it}")
else -> throw IllegalArgumentException("未知干员: $it")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ object ArknightsFaceCommand: CompositeCommand(
ArknightsFaceData.faces.toMessage()
}

@OptIn(MiraiExperimentalApi::class)
@SubCommand("detail", "详情")
@Description("表情详情")
suspend fun CommandSenderOnMessage<*>.detail() = sendMessage {
Expand Down

0 comments on commit 14db096

Please sign in to comment.