These are just gradle tasks I make that I think are kinda useful. Open to the public!
inject: Combines a source jar file and a second patch file. Useful when editing an existing jar file.
ext {
sourceJar = <abs/relative path>
patchedJar = <output>
}
task inject(type: Zip) {
delete "unpacked"
duplicatesStrategy = "include"
from zipTree("build/libs/${rootProject.name}-${version}.jar")
into "unpacked"
from zipTree("${sourceJar}")
into "unpacked"
from "unpacked/"
include "*"
include "*/*"
archiveFileName = "$patchedJar"
destinationDirectory = layout.buildDirectory
delete "unpacked/"
}
resetAndRun: Useful for minecraft plugin development. Deletes existing configs and plugin data to allow the new version to overwrite them.
task resetAndRun {
delete "run/plugins/$rootProject.name"
finalizedBy(runServer)
}