fix issues relating to some root structure changes
This commit is contained in:
parent
59e26185ee
commit
87220867d9
2 changed files with 12 additions and 13 deletions
|
@ -59,6 +59,10 @@ abstract class ApplyServerSourceAndNmsPatches : BaseTask() {
|
||||||
if (paperDecompiledSource.isPresent && Files.notExists(nmsFile)) {
|
if (paperDecompiledSource.isPresent && Files.notExists(nmsFile)) {
|
||||||
nmsFile = paperDecompiledSource.file(fileName).get().path
|
nmsFile = paperDecompiledSource.file(fileName).get().path
|
||||||
}
|
}
|
||||||
|
if (Files.notExists(nmsFile)) {
|
||||||
|
// we add new files within src/main/resources/data/minecraft/ but they don't exist in the nms source
|
||||||
|
return@forEach
|
||||||
|
}
|
||||||
val patchFile = patchDir.resolve(fileName).resolveSibling((patchedFile.name + ".patch")) // keep extension
|
val patchFile = patchDir.resolve(fileName).resolveSibling((patchedFile.name + ".patch")) // keep extension
|
||||||
|
|
||||||
val commandText =
|
val commandText =
|
||||||
|
@ -85,9 +89,9 @@ abstract class ApplyServerSourceAndNmsPatches : BaseTask() {
|
||||||
val patchName = patch.name.split("-", limit = 2)[1]
|
val patchName = patch.name.split("-", limit = 2)[1]
|
||||||
println("Applying Patch: $patchName")
|
println("Applying Patch: $patchName")
|
||||||
val excludeArray = directoriesToPatch.get().map { "--exclude=$it/**" }.toTypedArray()
|
val excludeArray = directoriesToPatch.get().map { "--exclude=$it/**" }.toTypedArray()
|
||||||
git("am", "--ignore-whitespace", *excludeArray, patch.toPath().absolutePathString()).execute()
|
git("am", "--ignore-whitespace", "--include=src/main/resources/data/minecraft/datapacks/paper/**", *excludeArray, "--include=**", patch.toPath().absolutePathString()).execute()
|
||||||
val includeArray = directoriesToPatch.get().map { "--include=$it/**" }.toTypedArray()
|
val includeArray = directoriesToPatch.get().map { "--include=$it/**" }.toTypedArray()
|
||||||
git("apply", "--ignore-whitespace", *includeArray, patch.toPath().absolutePathString()).execute()
|
git("apply", "--ignore-whitespace", "--exclude=src/main/resources/data/minecraft/datapacks/paper/**", *includeArray, patch.toPath().absolutePathString()).execute()
|
||||||
|
|
||||||
val (sourceFiles, dataFiles) = McDev.readPatchLines(listOf(patch.toPath()))
|
val (sourceFiles, dataFiles) = McDev.readPatchLines(listOf(patch.toPath()))
|
||||||
createPerFileDiff(sourcePatchesDir, sourceFiles, "src/main/java/")
|
createPerFileDiff(sourcePatchesDir, sourceFiles, "src/main/java/")
|
||||||
|
|
|
@ -32,18 +32,13 @@ abstract class FinalizePaperHistory : BaseTask() {
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun run() {
|
fun run() {
|
||||||
Git.checkForGit()
|
Git.checkForGit()
|
||||||
|
val deletionsArr = deletions.get().toTypedArray()
|
||||||
|
if (deletionsArr.isEmpty()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
Git(paperDir).let { git ->
|
Git(paperDir).let { git ->
|
||||||
val paperMojangApi = outputDir.path.resolve("Paper-MojangAPI/src/main/java")
|
git("rm", "-r", *deletionsArr).execute()
|
||||||
paperMojangApi.copyRecursivelyTo(outputDir.path.resolve("paper-api/src/main/java"))
|
git("commit", "-m", "OWW! That fork is HARD!", "--author=Automated <auto@mated.null>").execute()
|
||||||
paperMojangApi.deleteRecursive()
|
|
||||||
git("add", "paper-api/src/main/java", "Paper-MojangAPI").execute()
|
|
||||||
git("commit", "--message", "Merge Paper-MojangAPI into Paper API", "--author=Automated <auto@mated.null>").execute()
|
|
||||||
|
|
||||||
val deletionsArr = deletions.get().toTypedArray()
|
|
||||||
if (deletionsArr.isNotEmpty()) {
|
|
||||||
git("rm", "-r", *deletionsArr).execute()
|
|
||||||
git("commit", "-m", "OWW! That fork is HARD!", "--author=Automated <auto@mated.null>").execute()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue