mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 15:40:28 +08:00
Merge remote-tracking branch 'origin/reborn' into reborn
This commit is contained in:
commit
7b359108b9
@ -71,6 +71,20 @@ dependencies {
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.2.0")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.2.0")
|
||||
}
|
||||
ext {
|
||||
// 傻逼 compileAndRuntime 没 exclude 掉
|
||||
// 傻逼 gradle 第二次配置 task 会覆盖掉第一次的配置
|
||||
val x: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar.() -> Unit = {
|
||||
dependencyFilter.exclude {
|
||||
when ("${it.moduleGroup}:${it.moduleName}") {
|
||||
"net.mamoe:mirai-core" -> true
|
||||
"net.mamoe:mirai-core-qqandroid" -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
}
|
||||
this.set("shadowJar", x)
|
||||
}
|
||||
|
||||
tasks {
|
||||
"test"(Test::class) {
|
||||
|
@ -1,31 +0,0 @@
|
||||
import net.mamoe.mirai.console.command.fuzzySearch
|
||||
import net.mamoe.mirai.console.command.fuzzySearchOnly
|
||||
|
||||
class Him188(val name:String){
|
||||
override fun toString(): String {
|
||||
return name
|
||||
}
|
||||
}
|
||||
|
||||
fun main(){
|
||||
val list = listOf(
|
||||
Him188("111122"),
|
||||
Him188("H1hsncm"),
|
||||
Him188("Ahsndb1"),
|
||||
Him188("Him188"),
|
||||
Him188("aisb11j2"),
|
||||
Him188("aisndnme"),
|
||||
Him188("a9su102"),
|
||||
Him188("nmsl"),
|
||||
Him188("Him1888"),
|
||||
Him188("Him18887")
|
||||
)
|
||||
val s1 = list.fuzzySearch("Him1888"){
|
||||
it.name
|
||||
}
|
||||
val s2 = list.fuzzySearchOnly("Him1888"){
|
||||
it.name
|
||||
}
|
||||
println("S1: $s1")
|
||||
println("S2: $s2")
|
||||
}
|
@ -22,6 +22,7 @@ import kotlin.math.pow
|
||||
class MiraiConsoleBuildPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) = target.run {
|
||||
apply<ShadowPlugin>()
|
||||
val ext = target.extensions.getByName("ext") as org.gradle.api.plugins.ExtraPropertiesExtension
|
||||
|
||||
if (tasks.none { it.name == "shadowJar" }) {
|
||||
return@run
|
||||
@ -40,6 +41,10 @@ class MiraiConsoleBuildPlugin : Plugin<Project> {
|
||||
"Implementation-Version" to target.version.toString() + "-" + gitVersion
|
||||
)
|
||||
}
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
kotlin.runCatching {
|
||||
(ext["shadowJar"] as? ShadowJar.() -> Unit)?.invoke(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,21 @@ dependencies {
|
||||
testApi(project(":mirai-console"))
|
||||
}
|
||||
|
||||
ext {
|
||||
// 傻逼 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.consolePure
|
||||
|
||||
description = "Console Pure CLI frontend for mirai"
|
Loading…
Reference in New Issue
Block a user