Skip to content

Commit

Permalink
Guard against invalid remapJar configs
Browse files Browse the repository at this point in the history
Proactively throw an error when input and output paths match instead of letting tiny-remapper fail.
  • Loading branch information
jpenilla committed Sep 25, 2024
1 parent 40f7822 commit 6f8e3fa
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6f8e3fa

Please sign in to comment.