From 6ca806725bcc14aa3c96fab8cb1e6b890dd79251 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Sat, 16 Nov 2024 21:48:32 +0800 Subject: [PATCH] chore: Always make mc-dev-sources when applying patches --------- Co-authored-by: Bjarne Koll --- .../paperweight/patcher/tasks/PatcherApplyGitPatches.kt | 8 +++++--- .../io/papermc/paperweight/tasks/ApplyPaperPatches.kt | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/leavesweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/tasks/PatcherApplyGitPatches.kt b/leavesweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/tasks/PatcherApplyGitPatches.kt index 3107d84..c69b803 100644 --- a/leavesweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/tasks/PatcherApplyGitPatches.kt +++ b/leavesweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/tasks/PatcherApplyGitPatches.kt @@ -161,8 +161,10 @@ abstract class PatcherApplyGitPatches : ControllableOutputTask() { git("tag", "-d", "base").runSilently(silenceErr = true) git("tag", "base").executeSilently() - applyGitPatches(git, target, output, patchDir.pathOrNull, printOutput.get(), verbose.get()) - - makeMcDevSrc(layout.cache, sourceMcDevJar.path, mcDevSources.path, outputDir.path, srcDir, dataDir) + try { + applyGitPatches(git, target, output, patchDir.pathOrNull, printOutput.get(), verbose.get()) + } finally { + makeMcDevSrc(layout.cache, sourceMcDevJar.path, mcDevSources.path, outputDir.path, srcDir, dataDir) + } } } diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/ApplyPaperPatches.kt b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/ApplyPaperPatches.kt index c45df65..36b4ab0 100644 --- a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/ApplyPaperPatches.kt +++ b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/ApplyPaperPatches.kt @@ -165,9 +165,11 @@ abstract class ApplyPaperPatches : ControllableOutputTask() { git("tag", "-d", "base").runSilently(silenceErr = true) git("tag", "base").executeSilently() - applyGitPatches(git, target, outputFile, patchDir.path, printOutput.get(), verbose.get()) - - makeMcDevSrc(layout.cache, sourceMcDevJar.path, mcDevSources.path, outputDir.path, sourceDir, mcDataDir) + try { + applyGitPatches(git, target, outputFile, patchDir.path, printOutput.get(), verbose.get()) + } finally { + makeMcDevSrc(layout.cache, sourceMcDevJar.path, mcDevSources.path, outputDir.path, sourceDir, mcDataDir) + } } }