Exclude everything that pure does not need

This commit is contained in:
Karlatemp 2020-06-23 22:18:49 +08:00
parent 5e3039f866
commit 3408502f99
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8
3 changed files with 16 additions and 31 deletions

View File

@ -73,6 +73,7 @@ dependencies {
}
ext {
// 傻逼 compileAndRuntime 没 exclude 掉
// 傻逼 gradle 第二次配置 task 会覆盖掉第一次的配置
val x: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar.() -> Unit = {
dependencyFilter.exclude {
when ("${it.moduleGroup}:${it.moduleName}") {

View File

@ -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")
}

View File

@ -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"