2020-05-14 08:18:03 +08:00
|
|
|
plugins {
|
2020-08-16 23:21:11 +08:00
|
|
|
kotlin("jvm")
|
|
|
|
kotlin("plugin.serialization")
|
2020-08-28 20:07:02 +08:00
|
|
|
kotlin("kapt")
|
2020-05-14 08:18:03 +08:00
|
|
|
id("java")
|
|
|
|
`maven-publish`
|
2020-06-28 11:45:21 +08:00
|
|
|
id("com.jfrog.bintray")
|
2020-05-14 08:18:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
2020-08-16 23:21:11 +08:00
|
|
|
target.compilations.all {
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = "1.8"
|
2020-08-20 20:24:08 +08:00
|
|
|
freeCompilerArgs = freeCompilerArgs + "-Xjvm-default=enable"
|
2020-08-16 23:21:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-14 08:18:03 +08:00
|
|
|
sourceSets {
|
|
|
|
all {
|
|
|
|
languageSettings.enableLanguageFeature("InlineClasses")
|
|
|
|
|
|
|
|
languageSettings.useExperimentalAnnotation("kotlin.Experimental")
|
2020-06-21 00:47:52 +08:00
|
|
|
languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn")
|
2020-05-14 08:18:03 +08:00
|
|
|
languageSettings.progressiveMode = true
|
|
|
|
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.utils.MiraiInternalAPI")
|
2020-06-23 17:49:30 +08:00
|
|
|
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.utils.MiraiExperimentalAPI")
|
2020-08-16 23:21:11 +08:00
|
|
|
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.console.util.ConsoleExperimentalAPI")
|
2020-07-24 20:11:10 +08:00
|
|
|
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.console.ConsoleFrontEndImplementation")
|
2020-05-14 08:18:03 +08:00
|
|
|
languageSettings.useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes")
|
|
|
|
languageSettings.useExperimentalAnnotation("kotlin.experimental.ExperimentalTypeInference")
|
|
|
|
languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-06-20 20:46:20 +08:00
|
|
|
|
2020-05-14 08:18:03 +08:00
|
|
|
dependencies {
|
2020-06-22 12:49:02 +08:00
|
|
|
implementation("org.jline:jline:3.15.0")
|
|
|
|
implementation("org.fusesource.jansi:jansi:1.18")
|
2020-06-20 20:46:20 +08:00
|
|
|
|
2020-06-22 12:49:02 +08:00
|
|
|
compileAndRuntime(project(":mirai-console"))
|
|
|
|
compileAndRuntime("net.mamoe:mirai-core:${Versions.core}")
|
2020-07-19 13:18:27 +08:00
|
|
|
compileAndRuntime(kotlin("stdlib", Versions.kotlinStdlib)) // embedded by core
|
2020-05-14 08:18:03 +08:00
|
|
|
|
2020-06-29 22:52:15 +08:00
|
|
|
runtimeOnly("net.mamoe:mirai-core-qqandroid:${Versions.core}")
|
2020-06-20 22:55:07 +08:00
|
|
|
testApi("net.mamoe:mirai-core-qqandroid:${Versions.core}")
|
2020-05-14 08:18:03 +08:00
|
|
|
testApi(project(":mirai-console"))
|
2020-08-28 20:07:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
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)
|
2020-05-14 08:18:03 +08:00
|
|
|
}
|
|
|
|
|
2020-07-11 20:04:18 +08:00
|
|
|
ext.apply {
|
2020-06-23 22:18:49 +08:00
|
|
|
// 傻逼 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)
|
|
|
|
}
|
|
|
|
|
2020-06-21 00:44:02 +08:00
|
|
|
version = Versions.consolePure
|
2020-05-14 08:18:03 +08:00
|
|
|
|
2020-06-28 11:45:21 +08:00
|
|
|
description = "Console Pure CLI frontend for mirai"
|
|
|
|
|
|
|
|
setupPublishing("mirai-console-pure", bintrayPkgName = "mirai-console-pure")
|
|
|
|
|
|
|
|
// endregion
|