@@ -28,7 +28,6 @@ import io.papermc.paperweight.core.util.ApplySourceATs
2828import io.papermc.paperweight.core.util.coreExt
2929import io.papermc.paperweight.tasks.*
3030import io.papermc.paperweight.util.*
31- import io.papermc.paperweight.util.constants.PAPER_PATH
3231import io.papermc.paperweight.util.constants.paperTaskOutput
3332import java.util.concurrent.TimeUnit
3433import kotlin.io.path.*
@@ -60,6 +59,10 @@ abstract class SetupForkMinecraftSources : JavaLauncherTask() {
6059 @get:OutputDirectory
6160 abstract val outputDir: DirectoryProperty
6261
62+ @get:OutputDirectory
63+ @get:Optional
64+ abstract val oldOutputDir: DirectoryProperty
65+
6366 @get:Internal
6467 abstract val atWorkingDir: DirectoryProperty
6568
@@ -88,6 +91,9 @@ abstract class SetupForkMinecraftSources : JavaLauncherTask() {
8891 @get:Input
8992 abstract val identifier: Property <String >
9093
94+ @get:Internal
95+ abstract val forkName: Property <String >
96+
9197 @get:Input
9298 @get:Optional
9399 abstract val oldCommit: Property <String >
@@ -100,6 +106,7 @@ abstract class SetupForkMinecraftSources : JavaLauncherTask() {
100106 atWorkingDir.set(layout.cache.resolve(paperTaskOutput(name = " ${name} _atWorkingDir" )))
101107 mappingsWorkingDir.set(layout.cache.resolve(paperTaskOutput(name = " ${name} _mappingsWorkingDir" )))
102108 additionalRemoteName.convention(" old" )
109+ forkName.convention(project.coreExt.activeFork.map { it.name.capitalized() })
103110 }
104111
105112 @TaskAction
@@ -151,12 +158,12 @@ abstract class SetupForkMinecraftSources : JavaLauncherTask() {
151158 }
152159
153160 private fun setupOld () {
154- val name = project.coreExt.activeFork. get().name.capitalized ()
161+ val name = forkName. get()
155162 logger.lifecycle(" Setting up $name commit ${oldCommit.get()} to use as base for 3-way apply..." )
156163
157164 val rootProjectDir = layout.projectDirectory.dir(" ../" ).path
158- val oldDir = layout.cache. resolve(" $PAPER_PATH /old $name / ${ oldCommit.get()} " )
159- val oldLog = layout.cache. resolve(" $PAPER_PATH /old $name / ${oldCommit.get()} .log" )
165+ val oldDir = oldOutputDir.get().path. resolve(oldCommit.get())
166+ val oldLog = oldOutputDir.get().path. resolve(" ${oldCommit.get()} .log" )
160167
161168 val oldGit: Git
162169 if (oldDir.exists()) {
0 commit comments