1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-17 09:09:23 +08:00

Create new module mirai-core-utils-addition

This commit is contained in:
Karlatemp 2022-06-10 22:23:26 +08:00
parent 1a2241b8b2
commit 62319ff453
No known key found for this signature in database
GPG Key ID: BA173CA2B9956C59
8 changed files with 115 additions and 0 deletions
mirai-console
backend/mirai-console/src/internal/plugin
tools/gradle-plugin/src/main/kotlin
mirai-core-utils-addition
build.gradle.kts
src
androidMain/kotlin
commonMain/kotlin
jvmMain/kotlin
mirai-core
settings.gradle.kts

View File

@ -71,6 +71,9 @@ internal class JvmPluginDependencyDownloader(
"mirai-core-utils",
"mirai-core-utils-jvm",
"mirai-core-utils-android",
"mirai-core-utils-addition",
"mirai-core-utils-addition-jvm",
"mirai-core-utils-addition-android",
"mirai-console",
"mirai-console-terminal",
)

View File

@ -57,6 +57,9 @@ public open class BuildMiraiPluginV2 : Jar() {
"net.mamoe:mirai-core-utils",
"net.mamoe:mirai-core-utils-jvm",
"net.mamoe:mirai-core-utils-android",
"net.mamoe:mirai-core-utils-addition",
"net.mamoe:mirai-core-utils-addition-jvm",
"net.mamoe:mirai-core-utils-addition-android",
"net.mamoe:mirai-console",
"net.mamoe:mirai-console-terminal",
)

View File

@ -0,0 +1,77 @@
/*
* Copyright 2019-2022 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
plugins {
kotlin("multiplatform")
// id("kotlinx-atomicfu")
kotlin("plugin.serialization")
id("me.him188.kotlin-jvm-blocking-bridge")
id("me.him188.kotlin-dynamic-delegation")
`maven-publish`
}
description = "mirai-core utilities additions"
kotlin {
explicitApi()
if (isAndroidSDKAvailable) {
jvm("android") {
attributes.attribute(KotlinPlatformType.attribute, KotlinPlatformType.androidJvm)
// publishAllLibraryVariants()
}
} else {
printAndroidNotInstalled()
}
jvm("common") {
attributes.attribute(KotlinPlatformType.attribute, KotlinPlatformType.common)
}
jvm("jvm")
sourceSets {
val commonMain by getting {
dependencies {
implementation(project(":mirai-core-utils"))
}
}
val commonTest by getting {
dependencies {
}
}
if (isAndroidSDKAvailable) {
val androidMain by getting {
dependencies {
compileOnly(`android-runtime`)
implementation(`zxing-core`)
}
}
}
val jvmMain by getting {
dependencies {
implementation(`zxing-javase`)
}
}
val jvmTest by getting {
dependencies {
runtimeOnly(files("build/classes/kotlin/jvm/test")) // classpath is not properly set by IDE
}
}
}
}
configureMppPublishing()

View File

@ -0,0 +1,10 @@
/*
* Copyright 2019-2022 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/
package net.mamoe.mirai.utils.addition

View File

@ -0,0 +1,10 @@
/*
* Copyright 2019-2022 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/
package net.mamoe.mirai.utils.addition

View File

@ -0,0 +1,10 @@
/*
* Copyright 2019-2022 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/
package net.mamoe.mirai.utils.addition

View File

@ -102,6 +102,7 @@ kotlin {
val jvmTest by getting {
dependencies {
api(`kotlinx-coroutines-debug`)
api(project(":mirai-core-utils-addition"))
// implementation("net.mamoe:mirai-login-solver-selenium:1.0-dev-14")
}
}

View File

@ -28,6 +28,7 @@ fun includeProject(projectPath: String, dir: String? = null) {
}
includeProject(":mirai-core-utils")
includeProject(":mirai-core-utils-addition")
includeProject(":mirai-core-api")
includeProject(":mirai-core")
includeProject(":mirai-core-all")