Guard against invalid remapJar configs (#256)

Proactively throw an error when input and output paths match instead of letting tiny-remapper fail.
This commit is contained in:
Jason Penilla 2024-09-27 19:06:35 -07:00 committed by GitHub
parent 40f78222c0
commit b3467d9f8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,6 +76,13 @@ abstract class RemapJar : JavaLauncherTask() {
@TaskAction
fun run() {
if (inputJar.path.absolute().normalize() == outputJar.path.absolute().normalize()) {
throw PaperweightException(
"Invalid configuration, inputJar and outputJar point to the same path: ${inputJar.path}\n" +
"Consider removing customization of output locations, following the default Gradle conventions."
)
}
if (toNamespace.get() != fromNamespace.get()) {
val logFile = layout.cache.resolve(paperTaskOutput("log"))
TinyRemapper.run(