perf(hamster-core-bukkit): 优化代码

This commit is contained in:
2023-06-05 17:21:18 +08:00
parent 32833879eb
commit 973cfa6896
3 changed files with 24 additions and 40 deletions

View File

@@ -1,3 +1,6 @@
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
setArchivesBaseName("HamsterCore-Bukkit")
evaluationDependsOn(':hamster-core-common')
@@ -10,20 +13,17 @@ dependencies {
api project(":hamster-core-common") transitive false
shade project(":hamster-core-common") transitive false
implementation "de.tr7zw:item-nbt-api:2.11.2"
//noinspection VulnerableLibrariesLocal
compileOnly 'org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT' exclude group: "com.google.code.gson"
compileOnly 'net.milkbowl.vault:VaultAPI:1.7' transitive false
compileOnly 'org.black_ixx:playerpoints:2.1.3' transitive false
compileOnly "com.comphenix.protocol:ProtocolLib-API:4.4.0" transitive false
// https://mvnrepository.com/artifact/com.google.code.gson/gson
//noinspection GradlePackageUpdate
//noinspection VulnerableLibrariesLocal
compileOnly 'com.google.code.gson:gson:2.8.0'
// https://mvnrepository.com/artifact/net.kyori/adventure-platform-bukkit
api "net.kyori:adventure-platform-bukkit:${adventure_version}"
//noinspection VulnerableLibrariesLocal
oldJar "net.kyori:adventure-platform-bukkit:${adventure_version}"
// https://mvnrepository.com/artifact/net.kyori/adventure-text-minimessage
api "net.kyori:adventure-text-minimessage:${adventure_serializer_version}"
@@ -52,18 +52,17 @@ processResources {
}
}
tasks.compileJava.dependsOn(":hamster-core-common:build")
tasks.register("shadowJar", Jar) {
dependsOn("jar")
from([
tasks.jar.outputs.files.collect {
it.isDirectory() ? it : zipTree(it)
},
configurations.shade.collect {
it.isDirectory() ? it : zipTree(it)
}
])
shadowJar {
//noinspection GrDeprecatedAPIUsage
classifier = ""
dependencies {
exclude(dependency {
it.moduleGroup != 'cn.hamster3.mc.plugin.core' && it.moduleGroup != 'de.tr7zw'
})
}
relocate 'de.tr7zw.changeme.nbtapi', 'cn.hamster3.mc.plugin.core.bukkit.nbtapi'
relocate 'de.tr7zw.annotations', 'cn.hamster3.mc.plugin.core.bukkit.nbtapi.annotations'
destinationDir(getRootProject().buildDir)
}
tasks.build.dependsOn(shadowJar)