-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upstream has released updates that appear to apply and compile correctly. [Purpur Changes] PlazmaMC/Purpur@69d3bb4: Updated Upstream (Paper) PlazmaMC/Purpur@ad32b22: fix version command throwing an exception PlazmaMC/Purpur@9dcfdf1: [ci skip] missed this from the upstream PlazmaMC/Purpur@88aa731: Updated Upstream (Paper) PlazmaMC/Purpur@3d25693: Updated Upstream (Paper) PlazmaMC/Purpur@248ba17: Updated Upstream (Paper) PlazmaMC/Purpur@ed1e0ec: Updated Upstream (Paper) PlazmaMC/Purpur@1bbb033: Updated Upstream (Paper) PlazmaMC/Purpur@222387f: Updated Upstream (Paper) PlazmaMC/Purpur@692ff89: [ci skip] specify purpur in version command PlazmaMC/Purpur@7b850ef: [ci skip] Fix version inconsistency in README (#1517) PlazmaMC/Purpur@22fc5f9: Updated Upstream (Paper) PlazmaMC/Purpur@2842b97: Updated Upstream (Paper) PlazmaMC/Purpur@ec1b4fa: Updated Upstream (Paper) PlazmaMC/Purpur@b1464f3: Updated Upstream (Paper) PlazmaMC/Purpur@ee56117: Updated Upstream (Paper) PlazmaMC/Purpur@847719c: one punch!! improvements PlazmaMC/Purpur@1af7456: [ci skip] document mods that patches took inspiration from PlazmaMC/Purpur@224e7c7: Updated Upstream (Paper) PlazmaMC/Purpur@7095128: Add back Pufferfish patches [Paper Changes] PaperMC/Paper@23fe116: Fix missing debug trace PaperMC/Paper@b0c9b9c: Only remove worldgen block entity on changed block (#10794) PaperMC/Paper@9c917fe: [ci skip] Clean up paperclip build-pr workflow (#10802) PaperMC/Paper@9d6f2cc: [ci skip] Rebuild patches (#10803) PaperMC/Paper@84f6e6e: Fix max temper API for llama (#10823) PaperMC/Paper@672c077: handle BODY slot for non-mobs (#10822) PaperMC/Paper@716b868: Use RegistryOps for loadAdvancement (#10799) PaperMC/Paper@d9e659a: Allow firework effects with no colors (#10814) PaperMC/Paper@7e2b682: Fix skipping custom block entity tag (#10812) PaperMC/Paper@ed85aac: Flatten namespaced vanilla command alias redirects (#10821) PaperMC/Paper@a31dc90: Several fixes and new api for experience merging/stacking (#9242) PaperMC/Paper@efd91e5: Add registry-related argument types (#10770) PaperMC/Paper@27d2ed8: Extend fishing API (#10634) PaperMC/Paper@0fcf3e3: Deprecate InvAction#HOTBAR_MOVE_AND_READD (#10784) PaperMC/Paper@8e6554a: Fix sending disconnect packet in phases where it doesn't exist PaperMC/Paper@06e69c8: Use CommandSourceStack in AsyncPlayerSendCommandsEvent (#10826) PaperMC/Paper@a47e11d: fix knockback events (#10831) PaperMC/Paper@3181470: Add entity heal API (#10267) PaperMC/Paper@0513374: Fire TabCompleteEvent for legacy commands (#10834) PaperMC/Paper@5d8e53d: Fix CommandSourceStack#bypassSelectorPermissions (#10837)
- Loading branch information
Showing
25 changed files
with
744 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 59 additions & 11 deletions
70
buildSrc/src/main/kotlin/org/plazmamc/alwaysuptodate/AlwaysUpToDate.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
buildSrc/src/main/kotlin/org/plazmamc/alwaysuptodate/tasks/CheckUpstreamCommit.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.plazmamc.alwaysuptodate.tasks | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.TaskAction | ||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException | ||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateExtension | ||
import org.plazmamc.alwaysuptodate.utils.* | ||
|
||
abstract class CheckUpstreamCommit : Task() { | ||
|
||
@get:Input | ||
abstract val repo: Property<String> | ||
|
||
@get:Input | ||
abstract val ref: Property<String> | ||
|
||
@get:Input | ||
abstract val commitPropertyName: Property<String> | ||
|
||
@TaskAction | ||
fun check() = with(project) { println(checkCommitFor { repo to ref to commitPropertyName }) } | ||
|
||
} | ||
|
||
private fun Project.getLatest(repository: String, branch: String) = | ||
git("ls-remote", repository).readText()?.lines() | ||
?.first("[a-z0-9]{40}\trefs/heads/$branch".toRegex()::matches)?.split("\t")?.first() | ||
?: throw AlwaysUpToDateException("Failed to get latest commit of $repository") | ||
|
||
fun Project.checkCommitFor(block: AlwaysUpToDateExtension.() -> Pair<Pair<Property<String>, Property<String>>, Property<String>>): Boolean = | ||
extension.block().flatten().let { getLatest(extension { it.first }, extension { it.second }) == property { it.third } } |
61 changes: 0 additions & 61 deletions
61
buildSrc/src/main/kotlin/org/plazmamc/alwaysuptodate/tasks/CheckUpstreamCommitTasks.kt
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
buildSrc/src/main/kotlin/org/plazmamc/alwaysuptodate/tasks/CreateCompareComment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.plazmamc.alwaysuptodate.tasks | ||
|
||
import io.papermc.paperweight.util.fromJson | ||
import io.papermc.paperweight.util.gson | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.TaskAction | ||
import org.plazmamc.alwaysuptodate.utils.property | ||
import paper.libs.com.google.gson.JsonObject | ||
import java.net.URI | ||
|
||
abstract class CreateCompareComment : Task() { | ||
|
||
@get:Input | ||
abstract val clear: Property<Boolean> | ||
|
||
@get:Input | ||
abstract val repo: Property<String> | ||
|
||
@get:Input | ||
abstract val ref: Property<String> | ||
|
||
@get:Input | ||
abstract val commitPropertyName: Property<String> | ||
|
||
@TaskAction | ||
fun create() = with(project) { | ||
val builder = StringBuilder() | ||
val rawRepo = URI.create(repo.get()).path.substring(1) | ||
|
||
if (clear.get() || !file("compare.txt").exists()) | ||
builder.append("\n\nUpstream has released updates that appear to apply and compile correctly.") | ||
else | ||
builder.append(file("compare.txt").readText()) | ||
|
||
builder.append("\n\n[${rawRepo.split("/").last()} Changes]\n") | ||
|
||
gson.fromJson<JsonObject>( | ||
URI.create("https://api.github.com/repos/$rawRepo/compare/${property { commitPropertyName }}...${ref.get()}") | ||
.toURL().readText())["commits"].asJsonArray.forEach { obj -> | ||
obj.asJsonObject.let { builder.append("$rawRepo@${it["sha"].asString.subSequence(0, 7)}: ${it["commit"].asJsonObject["message"].asString.split("\n")[0]}\n") } | ||
} | ||
file("compare.txt").writeText(builder.toString()) | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
buildSrc/src/main/kotlin/org/plazmamc/alwaysuptodate/tasks/GenerateMergedAPIPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.plazmamc.alwaysuptodate.tasks | ||
|
||
import io.papermc.paperweight.util.Git | ||
import io.papermc.paperweight.util.path | ||
import org.gradle.api.file.DirectoryProperty | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.InputDirectory | ||
import org.gradle.api.tasks.Internal | ||
import org.gradle.api.tasks.TaskAction | ||
import org.plazmamc.alwaysuptodate.utils.addCommit | ||
import java.io.File | ||
|
||
abstract class GenerateMergedAPIPatch : Task() { | ||
|
||
@get:InputDirectory | ||
abstract val inputDir: DirectoryProperty | ||
|
||
@get:Internal | ||
abstract val workDir: DirectoryProperty | ||
|
||
@get:Input | ||
abstract val commitTitle: Property<String> | ||
|
||
@get:Input | ||
abstract val author: Property<String> | ||
|
||
@get:Input | ||
abstract val license: Property<String> | ||
|
||
@TaskAction | ||
fun generate() = with(workDir.path) { | ||
val dotGit = resolve(".git").toFile().also(java.io.File::deleteRecursively) | ||
|
||
inputDir.path.toFile().copyRecursively(dotGit, overwrite = true) | ||
Git(this).addCommit("${commitTitle.get()}\n\n${license.get()}", "--author=${author.get()}") | ||
} | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
buildSrc/src/main/kotlin/org/plazmamc/alwaysuptodate/tasks/GenerateMergedServerPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.plazmamc.alwaysuptodate.tasks | ||
|
||
import io.papermc.paperweight.util.Git | ||
import io.papermc.paperweight.util.path | ||
import org.gradle.api.file.DirectoryProperty | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.Internal | ||
import org.gradle.api.tasks.TaskAction | ||
import org.plazmamc.alwaysuptodate.utils.addCommit | ||
import java.io.File | ||
import java.nio.file.Path | ||
|
||
abstract class GenerateMergedServerPatch : Task() { | ||
|
||
@get:Internal | ||
abstract val workDir: DirectoryProperty | ||
|
||
@get:Input | ||
abstract val commitTitle: Property<String> | ||
|
||
@get:Input | ||
abstract val author: Property<String> | ||
|
||
@get:Input | ||
abstract val license: Property<String> | ||
|
||
@TaskAction | ||
fun generate() = with(workDir.path) { | ||
val dotGit = resolve(".git").toFile().also(java.io.File::deleteRecursively) | ||
|
||
copySource(this) | ||
|
||
val paper = resolve("../.gradle/caches/paperweight/upstreams/paper/Paper-Server") | ||
copySource(paper) | ||
|
||
Git(paper).addCommit("Vanilla Sources", "--author=Automated <[email protected]>") | ||
|
||
paper.resolve(".git").toFile().copyRecursively(dotGit, overwrite = true) | ||
Git(this).addCommit("${commitTitle.get()}\n\n${license.get()}", "--author=${author.get()}") | ||
} | ||
|
||
} | ||
|
||
internal fun copySource(dir: Path) = with(dir.resolve(".gradle/caches/paperweight/mc-dev-sources")) { | ||
val target = dir.resolve("src/main") | ||
resolve("net").toFile().copyRecursively(target.resolve("java/net").toFile(), overwrite = true) | ||
resolve("com").toFile().copyRecursively(target.resolve("java/com").toFile(), overwrite = true) | ||
resolve("data").toFile().copyRecursively(target.resolve("resources/data").toFile(), overwrite = true) | ||
resolve("assets").toFile().copyRecursively(target.resolve("resources/assets").toFile(), overwrite = true) | ||
} |
Oops, something went wrong.