[terminal] Use the more concise way to add and shadow dependencies

This commit is contained in:
Him188 2022-11-27 19:58:28 +00:00
parent 146d737b42
commit 4b794feecb
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375
2 changed files with 27 additions and 17 deletions

View File

@ -78,6 +78,9 @@ object Versions {
// Java In Memory File System // Java In Memory File System
const val jimfs = "1.2" const val jimfs = "1.2"
const val jline = "3.21.0"
const val jansi = "2.4.0"
// don't update easily unless you want your disk space -= 1000 MB // don't update easily unless you want your disk space -= 1000 MB
// (700 MB for IDEA, 150 MB for sources, 150 MB for JBR) // (700 MB for IDEA, 150 MB for sources, 150 MB for JBR)
@ -273,6 +276,9 @@ const val `maven-resolver-transport-http` =
const val `maven-resolver-provider` = "org.apache.maven:maven-resolver-provider:${Versions.mavenResolverProvider}" const val `maven-resolver-provider` = "org.apache.maven:maven-resolver-provider:${Versions.mavenResolverProvider}"
const val jline = "org.jline:jline:${Versions.jline}"
const val jansi = "org.fusesource.jansi:jansi:${Versions.jansi}"
const val DEPS_TEST_VERSION = "2.99.0-deps-test" const val DEPS_TEST_VERSION = "2.99.0-deps-test"

View File

@ -1,10 +1,10 @@
/* /*
* Copyright 2019-2021 Mamoe Technologies and contributors. * Copyright 2019-2022 Mamoe Technologies and contributors.
* *
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. * 此源代码的使用受 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. * 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/dev/LICENSE
*/ */
plugins { plugins {
@ -14,25 +14,29 @@ plugins {
`maven-publish` `maven-publish`
} }
val shadow: Configuration = project.configurations.create("shadow")
dependencies { dependencies {
implementation("org.jline:jline:3.21.0") api(project(":mirai-core-api"))
implementation("org.fusesource.jansi:jansi:2.4.0") api(project(":mirai-console"))
implementation(project(":mirai-console-frontend-base")) implementation(project(":mirai-core-utils"))
compileAndTestRuntime(project(":mirai-core-utils"))
compileAndTestRuntime(project(":mirai-console")) shadowImplementation(jline)
compileAndTestRuntime(project(":mirai-core-api")) shadowImplementation(jansi)
compileAndTestRuntime(project(":mirai-core-utils")) shadowImplementation(project(":mirai-console-frontend-base"))
compileAndTestRuntime(kotlin("stdlib-jdk8", Versions.kotlinStdlib)) // must specify `compileOnly` explicitly
testApi(project(":mirai-core")) testImplementation(project(":mirai-core"))
testApi(project(":mirai-console"))
} }
version = Versions.consoleTerminal version = Versions.consoleTerminal
description = "Console Terminal CLI frontend for mirai" description = "Console Terminal CLI frontend for mirai"
configurePublishing("mirai-console-terminal") configurePublishing("mirai-console-terminal", setupGpg = false, addShadowJar = false)
val shadowJar = registerRegularShadowTaskForJvmProject(listOf(shadow))
// endregion publishing {
publications.getByName("mavenJava", MavenPublication::class) {
artifacts.artifact(shadowJar)
}
configGpgSign(project)
}