From 4432ae30df28b8d1cb66c8a5c0bd3b8ce23aa388 Mon Sep 17 00:00:00 2001 From: Him188 Date: Thu, 28 Jan 2021 09:32:22 +0800 Subject: [PATCH] Include mirai-console in mirai project build --- backend/mirai-console/build.gradle.kts | 11 +++++++++- .../src/main/kotlin/MiraiCoreDependency.kt | 21 +++++++++++++++++++ buildSrc/src/main/kotlin/PublishingHelpers.kt | 10 ++++----- buildSrc/src/main/kotlin/Versions.kt | 12 ++++------- .../mirai-console-terminal/build.gradle.kts | 11 +++++++++- tools/compiler-common/build.gradle.kts | 11 +++++++++- tools/gradle-plugin/build.gradle.kts | 11 +++++++++- tools/gradle-plugin/src/VersionConstants.kt | 12 +++++------ tools/intellij-plugin/build.gradle.kts | 11 +++++++++- 9 files changed, 86 insertions(+), 24 deletions(-) create mode 100644 buildSrc/src/main/kotlin/MiraiCoreDependency.kt diff --git a/backend/mirai-console/build.gradle.kts b/backend/mirai-console/build.gradle.kts index 07c94556c..f0b36a941 100644 --- a/backend/mirai-console/build.gradle.kts +++ b/backend/mirai-console/build.gradle.kts @@ -1,3 +1,12 @@ +/* + * Copyright 2019-2021 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/master/LICENSE + */ + @file:Suppress("UnusedImport") import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -65,4 +74,4 @@ tasks { } } -setupPublishing("mirai-console") \ No newline at end of file +configurePublishing("mirai-console") \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/MiraiCoreDependency.kt b/buildSrc/src/main/kotlin/MiraiCoreDependency.kt new file mode 100644 index 000000000..b0bfe6143 --- /dev/null +++ b/buildSrc/src/main/kotlin/MiraiCoreDependency.kt @@ -0,0 +1,21 @@ +/* + * Copyright 2019-2021 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/master/LICENSE + */ + +import org.gradle.api.Project + +/* + * For compatibility with composite mirai-core and mirai-console builds and dedicated mirai-console builds. + * + * If you're in mirai project, see also root/buildSrc/MiraiCoreDependency.kt (likely path) + */ + + +const val `mirai-core-api` = "net.mamoe:mirai-core-api:${Versions.core}" +const val `mirai-core` = "net.mamoe:mirai-core:${Versions.core}" +const val `mirai-core-utils` = "net.mamoe:mirai-core-utils:${Versions.core}" diff --git a/buildSrc/src/main/kotlin/PublishingHelpers.kt b/buildSrc/src/main/kotlin/PublishingHelpers.kt index 65414a697..58a3a00ed 100644 --- a/buildSrc/src/main/kotlin/PublishingHelpers.kt +++ b/buildSrc/src/main/kotlin/PublishingHelpers.kt @@ -1,10 +1,10 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 Mamoe Technologies and contributors. * - * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. - * Use of this source code is governed by the GNU AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found through the following link. + * 此源代码的使用受 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/master/LICENSE + * https://github.com/mamoe/mirai/blob/master/LICENSE */ @file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "NOTHING_TO_INLINE", "RemoveRedundantBackticks") @@ -60,7 +60,7 @@ internal fun Project.`publishing`(configure: org.gradle.api.publish.PublishingEx (this as org.gradle.api.plugins.ExtensionAware).extensions.configure("publishing", configure) -inline fun Project.setupPublishing( +inline fun Project.configurePublishing( artifactId: String, bintrayRepo: String = "mirai", bintrayPkgName: String = artifactId, diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 3a1e3d35e..e14dcb875 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,10 +1,10 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 Mamoe Technologies and contributors. * - * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. - * Use of this source code is governed by the GNU AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found through the following link. + * 此源代码的使用受 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/master/LICENSE + * https://github.com/mamoe/mirai/blob/master/LICENSE */ @file:Suppress("MemberVisibilityCanBePrivate", "ObjectPropertyName", "unused") @@ -58,10 +58,6 @@ const val `kotlinx-serialization-protobuf` = "org.jetbrains.kotlinx:kotlinx-seri const val `kotlinx-atomicfu` = "org.jetbrains.kotlinx:atomicfu:${Versions.atomicFU}" -const val `mirai-core-api` = "net.mamoe:mirai-core-api:${Versions.core}" -const val `mirai-core` = "net.mamoe:mirai-core:${Versions.core}" -const val `mirai-core-utils` = "net.mamoe:mirai-core-utils:${Versions.core}" - const val yamlkt = "net.mamoe.yamlkt:yamlkt:${Versions.yamlkt}" const val `jetbrains-annotations` = "org.jetbrains:annotations:19.0.0" diff --git a/frontend/mirai-console-terminal/build.gradle.kts b/frontend/mirai-console-terminal/build.gradle.kts index abc01a86a..8e4c803a1 100644 --- a/frontend/mirai-console-terminal/build.gradle.kts +++ b/frontend/mirai-console-terminal/build.gradle.kts @@ -1,3 +1,12 @@ +/* + * Copyright 2019-2021 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/master/LICENSE + */ + plugins { kotlin("jvm") kotlin("plugin.serialization") @@ -22,6 +31,6 @@ version = Versions.consoleTerminal description = "Console Terminal CLI frontend for mirai" -setupPublishing("mirai-console-terminal", bintrayPkgName = "mirai-console-terminal") +configurePublishing("mirai-console-terminal", bintrayPkgName = "mirai-console-terminal") // endregion \ No newline at end of file diff --git a/tools/compiler-common/build.gradle.kts b/tools/compiler-common/build.gradle.kts index 84fedfdc6..b5226274c 100644 --- a/tools/compiler-common/build.gradle.kts +++ b/tools/compiler-common/build.gradle.kts @@ -1,3 +1,12 @@ +/* + * Copyright 2019-2021 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/master/LICENSE + */ + @file:Suppress("UnusedImport") plugins { @@ -22,4 +31,4 @@ dependencies { testRuntimeOnly(`kotlin-compiler`) } -setupPublishing("mirai-console-compiler-common") \ No newline at end of file +configurePublishing("mirai-console-compiler-common") \ No newline at end of file diff --git a/tools/gradle-plugin/build.gradle.kts b/tools/gradle-plugin/build.gradle.kts index 9c5b6a004..1661c4dc3 100644 --- a/tools/gradle-plugin/build.gradle.kts +++ b/tools/gradle-plugin/build.gradle.kts @@ -1,3 +1,12 @@ +/* + * Copyright 2019-2021 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/master/LICENSE + */ + @file:Suppress("UnusedImport") plugins { @@ -87,4 +96,4 @@ tasks { compileKotlin.dependsOn(fillBuildConstants) } -setupPublishing("mirai-console-gradle") \ No newline at end of file +configurePublishing("mirai-console-gradle") \ No newline at end of file diff --git a/tools/gradle-plugin/src/VersionConstants.kt b/tools/gradle-plugin/src/VersionConstants.kt index 63aab1660..a9fb00887 100644 --- a/tools/gradle-plugin/src/VersionConstants.kt +++ b/tools/gradle-plugin/src/VersionConstants.kt @@ -1,15 +1,15 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 Mamoe Technologies and contributors. * - * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. - * Use of this source code is governed by the GNU AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found through the following link. + * 此源代码的使用受 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/master/LICENSE + * https://github.com/mamoe/mirai/blob/master/LICENSE */ package net.mamoe.mirai.console.gradle internal object VersionConstants { - const val CONSOLE_VERSION = "2.0.0" // value is written here automatically during build - const val CORE_VERSION = "2.0.0" // value is written here automatically during build + const val CONSOLE_VERSION = "2.2.0-dev-4" // value is written here automatically during build + const val CORE_VERSION = "2.2.0-dev-4" // value is written here automatically during build } \ No newline at end of file diff --git a/tools/intellij-plugin/build.gradle.kts b/tools/intellij-plugin/build.gradle.kts index 9e095a04e..49324bd1f 100644 --- a/tools/intellij-plugin/build.gradle.kts +++ b/tools/intellij-plugin/build.gradle.kts @@ -1,3 +1,12 @@ +/* + * Copyright 2019-2021 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/master/LICENSE + */ + @file:Suppress("UnusedImport") plugins { @@ -66,4 +75,4 @@ dependencies { compileOnly(files("libs/ide-common.jar")) } -setupPublishing("mirai-console-intellij") \ No newline at end of file +configurePublishing("mirai-console-intellij") \ No newline at end of file