2021-01-25 18:14:09 +08:00
|
|
|
import net.fabricmc.loom.task.RemapJarTask
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
base
|
|
|
|
}
|
|
|
|
|
|
|
|
applyCommonConfiguration()
|
|
|
|
|
|
|
|
tasks.register<Jar>("jar") {
|
|
|
|
val remapFabric = project(":worldedit-fabric").tasks.named<RemapJarTask>("remapShadowJar")
|
|
|
|
dependsOn(
|
2021-06-14 02:32:38 +08:00
|
|
|
remapFabric,
|
|
|
|
project(":worldedit-forge").tasks.named("reobfShadowJar")
|
2021-01-25 18:14:09 +08:00
|
|
|
)
|
|
|
|
from(zipTree({remapFabric.get().archiveFile}))
|
2022-03-18 01:18:46 +08:00
|
|
|
from(zipTree({project(":worldedit-forge").tasks.getByName("shadowJar").outputs.files.singleFile})) {
|
|
|
|
// Duplicated first-party files
|
|
|
|
exclude("META-INF/services/org.enginehub.piston.CommandManagerService")
|
|
|
|
exclude("lang/")
|
|
|
|
// No-brainer library excludes
|
|
|
|
exclude("com/sk89q/jchronic/")
|
|
|
|
exclude("com/sk89q/jnbt/")
|
|
|
|
exclude("com/sk89q/minecraft/")
|
|
|
|
exclude("com/sk89q/util/")
|
|
|
|
exclude("com/thoughtworks/")
|
|
|
|
exclude("net/royawesome/")
|
|
|
|
exclude("org/enginehub/piston/")
|
|
|
|
// Exclude worldedit-core
|
|
|
|
exclude {
|
|
|
|
val pathString = it.relativePath.pathString
|
|
|
|
pathString.startsWith("com/sk89q/worldedit/") && !pathString.startsWith("com/sk89q/worldedit/forge/")
|
|
|
|
}
|
|
|
|
// Questionable excludes. So far the two files from each jar are the same.
|
|
|
|
exclude("defaults/worldedit.properties")
|
|
|
|
exclude("pack.mcmeta")
|
|
|
|
}
|
2024-01-06 20:38:25 +08:00
|
|
|
manifest {
|
|
|
|
from(
|
|
|
|
{ zipTree({ remapFabric.get().archiveFile }).single { it.name == "MANIFEST.MF" } }
|
|
|
|
)
|
|
|
|
from(
|
|
|
|
{ zipTree({ project(":worldedit-forge").tasks.getByName("shadowJar").outputs.files.singleFile }).single { it.name == "MANIFEST.MF" } }
|
|
|
|
)
|
|
|
|
}
|
2021-01-25 18:14:09 +08:00
|
|
|
|
2022-03-18 01:18:46 +08:00
|
|
|
duplicatesStrategy = DuplicatesStrategy.FAIL
|
2021-01-25 18:14:09 +08:00
|
|
|
archiveClassifier.set("dist")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named("assemble") {
|
|
|
|
dependsOn("jar")
|
|
|
|
}
|