Skip to content

Commit

Permalink
Guard against invalid remapJar configs (#256)
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 authored Sep 28, 2024
1 parent 40f7822 commit b3467d9
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 b3467d9

Please sign in to comment.