Skip to content

Commit 5f8df32

Browse files
authored
Always make mc-dev-sources when applying patches (#259)
Always create the mc dev sources folder in the server project while applying patches, even if said patching failed. This change allows full sources in IDE during version updates without having to reload the project and rely on dependency resolution to populate the dev sources folder.
1 parent addb21d commit 5f8df32

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/ApplyPaperPatches.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,11 @@ abstract class ApplyPaperPatches : ControllableOutputTask() {
165165
git("tag", "-d", "base").runSilently(silenceErr = true)
166166
git("tag", "base").executeSilently()
167167

168-
applyGitPatches(git, target, outputFile, patchDir.path, printOutput.get(), verbose.get())
169-
170-
makeMcDevSrc(layout.cache, sourceMcDevJar.path, mcDevSources.path, outputDir.path, sourceDir, mcDataDir)
168+
try {
169+
applyGitPatches(git, target, outputFile, patchDir.path, printOutput.get(), verbose.get())
170+
} finally {
171+
makeMcDevSrc(layout.cache, sourceMcDevJar.path, mcDevSources.path, outputDir.path, sourceDir, mcDataDir)
172+
}
171173
}
172174
}
173175

paperweight-patcher/src/main/kotlin/io/papermc/paperweight/patcher/tasks/PatcherApplyGitPatches.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ abstract class PatcherApplyGitPatches : ControllableOutputTask() {
161161
git("tag", "-d", "base").runSilently(silenceErr = true)
162162
git("tag", "base").executeSilently()
163163

164-
applyGitPatches(git, target, output, patchDir.pathOrNull, printOutput.get(), verbose.get())
165-
166-
makeMcDevSrc(layout.cache, sourceMcDevJar.path, mcDevSources.path, outputDir.path, srcDir, dataDir)
164+
try {
165+
applyGitPatches(git, target, output, patchDir.pathOrNull, printOutput.get(), verbose.get())
166+
} finally {
167+
makeMcDevSrc(layout.cache, sourceMcDevJar.path, mcDevSources.path, outputDir.path, srcDir, dataDir)
168+
}
167169
}
168170
}

0 commit comments

Comments
 (0)