mirai/frontend/mirai-console-terminal/build.gradle.kts
Karlatemp 8fe2506e75
Terminal (#179)
* Rename ConsolePure to ConsoleTerminal

* Fix the way to close console with Ctrl+C

* Fix windows pipeline error. Fix EndOfFileException

* Add ConsoleExperimentalApi

* Collect imports

* Review

- Change old CLI main deprecation level to ERROR
- Update documents
- Update tasks from pure to terminal

* Fix error in closing console.

* Fix terminal closing and Ctrl+C closing.

* Add console shut-downing status

* Don't invokeOnCompletion when console shut-downing

* Fix Input interrupt

* Ensure active unless console is shut downing

* Change MiraiConsole.isShutDowning to `!job.isActive`

* Code Review

- Update Message on MiraiConsolePureLoader.kt
- Change MiraiConsole.isShutDowning to MiraiConsole.isActive
- Change MiraiConsole.shutdown to ConsoleInternalApi

* run catching

* Fix console input

* Update shutdown

* Fix module

* Revert 5199395

* Typo
2020-09-18 12:43:57 +08:00

75 lines
2.7 KiB
Plaintext

plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("java")
`maven-publish`
id("com.jfrog.bintray")
}
kotlin {
target.compilations.all {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = freeCompilerArgs + "-Xjvm-default=all"
}
}
sourceSets {
all {
languageSettings.enableLanguageFeature("InlineClasses")
languageSettings.useExperimentalAnnotation("kotlin.Experimental")
languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn")
languageSettings.progressiveMode = true
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.utils.MiraiInternalAPI")
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.utils.MiraiExperimentalAPI")
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.console.util.ConsoleExperimentalApi")
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.console.ConsoleFrontEndImplementation")
languageSettings.useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes")
languageSettings.useExperimentalAnnotation("kotlin.experimental.ExperimentalTypeInference")
languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
}
}
}
dependencies {
implementation("org.jline:jline:3.15.0")
implementation("org.fusesource.jansi:jansi:1.18")
compileAndRuntime(project(":mirai-console"))
compileAndRuntime("net.mamoe:mirai-core:${Versions.core}")
compileAndRuntime(kotlin("stdlib", Versions.kotlinStdlib)) // embedded by core
runtimeOnly("net.mamoe:mirai-core-qqandroid:${Versions.core}")
testApi("net.mamoe:mirai-core-qqandroid:${Versions.core}")
testApi(project(":mirai-console"))
// val autoService = "1.0-rc7"
// kapt("com.google.auto.service", "auto-service", autoService)
// compileOnly("com.google.auto.service", "auto-service-annotations", autoService)
// testCompileOnly("com.google.auto.service", "auto-service-annotations", autoService)
}
ext.apply {
// 傻逼 compileAndRuntime 没 exclude 掉
// 傻逼 gradle 第二次配置 task 会覆盖掉第一次的配置
val x: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar.() -> Unit = {
dependencyFilter.include {
when ("${it.moduleGroup}:${it.moduleName}") {
"org.jline:jline" -> true
"org.fusesource.jansi:jansi" -> true
else -> false
}
}
}
this.set("shadowJar", x)
}
version = Versions.consoleTerminal
description = "Console Terminal CLI frontend for mirai"
setupPublishing("mirai-console-terminal", bintrayPkgName = "mirai-console-terminal")
// endregion