Преглед изворни кода

Include mirai-console in mirai project build

Him188 пре 5 година
родитељ
комит
4432ae30df

+ 10 - 1
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")
+configurePublishing("mirai-console")

+ 21 - 0
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}"

+ 5 - 5
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,

+ 4 - 8
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"

+ 10 - 1
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

+ 10 - 1
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")
+configurePublishing("mirai-console-compiler-common")

+ 10 - 1
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")
+configurePublishing("mirai-console-gradle")

+ 6 - 6
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
 }

+ 10 - 1
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")
+configurePublishing("mirai-console-intellij")