WorldEdit/worldedit-mod/build.gradle.kts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.7 KiB
Plaintext
Raw Normal View History

import net.fabricmc.loom.task.RemapJarTask
plugins {
base
}
applyCommonConfiguration()
tasks.register<Jar>("jar") {
val remapFabric = project(":worldedit-fabric").tasks.named<RemapJarTask>("remapShadowJar")
dependsOn(
remapFabric,
project(":worldedit-forge").tasks.named("reobfShadowJar")
)
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")
}
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" } }
)
}
2022-03-18 01:18:46 +08:00
duplicatesStrategy = DuplicatesStrategy.FAIL
archiveClassifier.set("dist")
}
tasks.named("assemble") {
dependsOn("jar")
}