[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
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
// (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 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"

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 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 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/dev/LICENSE
*/
plugins {
@ -14,25 +14,29 @@ plugins {
`maven-publish`
}
val shadow: Configuration = project.configurations.create("shadow")
dependencies {
implementation("org.jline:jline:3.21.0")
implementation("org.fusesource.jansi:jansi:2.4.0")
implementation(project(":mirai-console-frontend-base"))
compileAndTestRuntime(project(":mirai-core-utils"))
api(project(":mirai-core-api"))
api(project(":mirai-console"))
implementation(project(":mirai-core-utils"))
compileAndTestRuntime(project(":mirai-console"))
compileAndTestRuntime(project(":mirai-core-api"))
compileAndTestRuntime(project(":mirai-core-utils"))
compileAndTestRuntime(kotlin("stdlib-jdk8", Versions.kotlinStdlib)) // must specify `compileOnly` explicitly
shadowImplementation(jline)
shadowImplementation(jansi)
shadowImplementation(project(":mirai-console-frontend-base"))
testApi(project(":mirai-core"))
testApi(project(":mirai-console"))
testImplementation(project(":mirai-core"))
}
version = Versions.consoleTerminal
description = "Console Terminal CLI frontend for mirai"
configurePublishing("mirai-console-terminal")
// endregion
configurePublishing("mirai-console-terminal", setupGpg = false, addShadowJar = false)
val shadowJar = registerRegularShadowTaskForJvmProject(listOf(shadow))
publishing {
publications.getByName("mavenJava", MavenPublication::class) {
artifacts.artifact(shadowJar)
}
configGpgSign(project)
}