Skip to content

Commit

Permalink
Override snappy temp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Dec 9, 2024
1 parent 6ceb7e8 commit e556389
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import codechicken.diffpatch.cli.PatchOperation
import codechicken.diffpatch.util.LoggingOutputStream
import codechicken.diffpatch.util.archiver.ArchiveFormat
import io.papermc.paperweight.restamp.SetupVanillaRestampWorker
import io.papermc.paperweight.restamp.setSnappyTempDir
import io.papermc.paperweight.tasks.*
import io.papermc.paperweight.util.*
import java.nio.file.Path
Expand Down Expand Up @@ -186,6 +187,7 @@ abstract class SetupVanilla : JavaLauncherTask() {
maxHeapSize = "2G"
executable(launcher.get().executablePath.path.absolutePathString())
classpath.from(restamp)
setSnappyTempDir(temporaryDir)
}
}
queue.submit(SetupVanillaRestampWorker::class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package io.papermc.paperweight.tasks.softspoon

import io.papermc.paperweight.restamp.ApplySourceATWorker
import io.papermc.paperweight.restamp.setSnappyTempDir
import io.papermc.paperweight.tasks.*
import io.papermc.paperweight.util.*
import javax.inject.Inject
Expand Down Expand Up @@ -65,6 +66,7 @@ abstract class ApplySourceAT : JavaLauncherTask() {
forkOptions {
maxHeapSize = "2G"
executable(launcher.get().executablePath.path.absolutePathString())
setSnappyTempDir(temporaryDir)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import codechicken.diffpatch.cli.DiffOperation
import codechicken.diffpatch.util.LogLevel
import codechicken.diffpatch.util.LoggingOutputStream
import io.papermc.paperweight.restamp.RebuildFilePatchesRestampWorker
import io.papermc.paperweight.restamp.setSnappyTempDir
import io.papermc.paperweight.tasks.*
import io.papermc.paperweight.util.*
import java.io.PrintStream
Expand Down Expand Up @@ -110,6 +111,7 @@ abstract class RebuildFilePatches : JavaLauncherTask() {
maxHeapSize = "2G"
executable(launcher.get().executablePath.path.absolutePathString())
classpath.from(restamp)
setSnappyTempDir(temporaryDir)
}
}
val filesWithNewAtsPath = temporaryDir.toPath().resolve("filesWithNewAts.txt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package io.papermc.paperweight.restamp

import java.io.BufferedWriter
import java.io.File
import java.io.StringWriter
import java.nio.file.Path
import kotlin.io.path.*
Expand All @@ -31,6 +32,11 @@ import org.cadixdev.at.AccessTransform
import org.cadixdev.at.AccessTransformSet
import org.cadixdev.at.ModifierChange
import org.cadixdev.at.io.AccessTransformFormat
import org.gradle.process.JavaForkOptions

fun JavaForkOptions.setSnappyTempDir(dir: File) {
systemProperties["org.xerial.snappy.tempdir"] = dir.absolutePath
}

fun atFromString(input: String): AccessTransform {
var last = input.length - 1
Expand Down

0 comments on commit e556389

Please sign in to comment.