build: 优化构建脚本

This commit is contained in:
2024-03-18 09:58:33 +08:00
parent 8d94816b36
commit 57f06c3ce2
3 changed files with 2 additions and 6 deletions

View File

@@ -55,10 +55,6 @@ subprojects {
expand(map)
}
}
shadowJar {
relocate("de.tr7zw.changeme.nbtapi", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi")
relocate("de.tr7zw.annotations", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi.annotations")
}
build {
dependsOn(shadowJar)
}

View File

@@ -54,6 +54,8 @@ tasks {
shadowJar {
from(shade.map { if (it.isDirectory) it else zipTree(it) })
destinationDirectory = rootProject.layout.buildDirectory
relocate("de.tr7zw.changeme.nbtapi", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi")
relocate("de.tr7zw.annotations", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi.annotations")
}
val shadowJava8 = register<ShadowJar>("shadowJava8") {
dependsOn(":core-common:build")

View File

@@ -60,8 +60,6 @@ tasks {
from(jar.get().outputs)
from(shadeJava8.map { if (it.isDirectory) it else zipTree(it) })
destinationDirectory = rootProject.layout.buildDirectory
relocate("de.tr7zw.changeme.nbtapi", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi")
relocate("de.tr7zw.annotations", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi.annotations")
}
build {
dependsOn(shadowJava8)