Skip to content

Commit

Permalink
Updated Upstream (Paper & Purpur)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed May 14, 2024
1 parent 069250d commit 34fef47
Show file tree
Hide file tree
Showing 42 changed files with 477 additions and 4,141 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ij_any_block_comment_add_space = false
ij_any_block_comment_at_first_column = false
ij_any_line_comment_at_first_column = false
ij_any_line_comment_add_space = true
max_line_length = 120
ij_visual_guides = 80

[*.tiny]
indent_style=tab
Expand Down
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto eol=lf

*.sh text eol=lf
gradlew text eol=lf
*.bat text eol=crlf

*.jar binary
59 changes: 31 additions & 28 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import kotlin.io.path.createSymbolicLinkPointingTo

plugins {
java
Expand All @@ -19,9 +20,7 @@ kotlin.jvmToolchain(jdkVersion)
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/") {
content {
onlyForConfigurations(configurations.paperclip.name)
}
content { onlyForConfigurations(configurations.paperclip.name) }
}
}

Expand Down Expand Up @@ -59,19 +58,22 @@ allprojects {
subprojects {
tasks {
withType<JavaCompile>().configureEach {
options.compilerArgs.addAll(listOf("--add-modules=jdk.incubator.vector", "-Xmaxwarns", "1"))
options.encoding = Charsets.UTF_8.name()
options.release = jdkVersion
options.compilerArgs.addAll(listOf(
"--add-modules=jdk.incubator.vector",
"-Xmaxwarns", "1"
))
}

withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}

withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}

withType<Test> {
testLogging {
showStackTraces = true
Expand All @@ -85,7 +87,6 @@ subprojects {
mavenCentral()
maven("https://jitpack.io")
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
}

Expand All @@ -110,23 +111,16 @@ paperweight {
patchDir = layout.projectDirectory.dir("patches/generated-api")
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
}

patchTasks.register("mojangApi") {
isBareDirectory = true
upstreamDirPath = "Paper-MojangAPI"
patchDir = layout.projectDirectory.dir("patches/mojang-api")
outputDir = layout.projectDirectory.dir("$projectName-MojangAPI")
}
}
}

alwaysUpToDate {

paperRepoName.set("org.plazmamc.alwaysuptodate.paper.repository")
paperRepoName.set("paperRepo")
paperBranchName.set("paperBranch")
paperCommitName.set("paperCommit")

purpurRepoName.set("org.plazmamc.alwaysuptodate.purpur.repository")
purpurRepoName.set("purpurRepo")
purpurBranchName.set("purpurBranch")
purpurCommitName.set("purpurCommit")

Expand All @@ -147,33 +141,42 @@ tasks {

generateDevelopmentBundle {
apiCoordinates.set("${project.group}:${projectName.lowercase()}-api")
mojangApiCoordinates.set("${project.group}:${projectName.lowercase()}-mojangapi")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
"https://maven.pkg.github.com/$projectRepo",
"https://papermc.io/repo/repository/maven-public/"
)
}

register("reApplyServerPatches") {
doFirst {
projectDir.resolve("$projectName-Server").deleteRecursively()
}

finalizedBy("applyServerPatches")
}

clean {
doLast {
projectDir.resolve(".gradle/caches").deleteRecursively()
listOf("$projectName-API", "$projectName-MojangAPI", "$projectName-Server", "paper-api-generator", "run").forEach {
listOf(
".gradle/caches",
"$projectName-API",
"$projectName-Server",
"paper-api-generator",
"run",

// remove dev environment files
"0001-fixup.patch",
"compare.txt"
).forEach {
projectDir.resolve(it).deleteRecursively()
}

// remove dev environment files
listOf("0001-fixup.patch", "compare.txt").forEach {
projectDir.resolve(it).delete()
}
}
}
}

publishing {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
}
artifact(tasks.generateDevelopmentBundle) { artifactId = "dev-bundle" }
}
}
14 changes: 0 additions & 14 deletions fxapi

This file was deleted.

14 changes: 0 additions & 14 deletions fxsrv

This file was deleted.

11 changes: 5 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
group = org.plazmamc.plazma
org.gradle.daemon = true
org.gradle.caching = true
org.gradle.parallel = true
Expand All @@ -8,20 +7,20 @@ org.gradle.jvmargs = -Xmx4G -Dfile.encoding=UTF-8 -Dgraal.CompilerConfiguration=
paper.runMemoryGb = 8
paper.runDisableWatchdog = true

org.plazmamc.alwaysuptodate.paper.repository = https://github.com/PaperMC/Paper
org.plazmamc.alwaysuptodate.purpur.repository = https://github.com/PurpurMC/Purpur

group = org.plazmamc.plazma
projectName = Plazma
projectRepo = PlazmaMC/PlazmaBukkit

version = 1.20.6-R0.1-SNAPSHOT
mcVersion = 1.20.6
jdkVersion = 21

paperRepo = https://github.com/PaperMC/Paper
paperBranch = master
purpurRepo = https://github.com/PurpurMC/Purpur
purpurBranch = ver/1.20.6
pufferfishBranch = ver/1.20
usePufferfish = false

paperCommit = eee55d019fe80372c2e08ccd1d0a94c066cda926
purpurCommit = f9258cd522c14caea3ade7480b01e7e146aa8661
paperCommit = 3fc93581bb876e8149b2ca423375a98f5ca12d27
purpurCommit = c637b74bade41e7be96ed3478bab7c3b923e7d84
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
shadow = "8.1.1"
paperweight = "1.6.3"
paperweight = "1.7.1"
paperclip = "3.0.3"
decompiler = "1.10.1"
remapper = "0.10.1"
Expand Down
52 changes: 52 additions & 0 deletions initDev
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# To initialize your development environment,
# run below command in your terminal:
# source ./initDev

export PROJECT_DIR=$(pwd)

alias api="cd $PROJECT_DIR/*-API"
alias srv="cd $PROJECT_DIR/*-Server"

alias ap="./gradlew --no-rebuild applyPatches"
alias aap="./gradlew --no-rebuild applyAPIPatches"
alias agp="./gradlew --no-rebuild applyGeneratedAPIPatches"
alias asp="./gradlew --no-rebuild applyServerPatches"

alias rp="./gradlew --no-rebuild rebuildPatches"
alias rap="./gradlew --no-rebuild rebuildAPIPatches"
alias rgp="./gradlew --no-rebuild rebuildGeneratedAPIPatches"
alias rsp="./gradlew --no-rebuild rebuildServerPatches"

alias lg="git log --oneline base..HEAD"
alias rc="git rebase --autosquash -i base"
alias rcc="git rebase --continue"

# generate Fixup patches for Server
function fs() {
cd *-Server

git add .
git commit -m "fixup"
git format-patch -1
mv 0001-fixup.patch ../

cd ../
}

# generate Fixup patches for API
function fa() {
cd *-API

git add .
git commit -m "fixup"
git format-patch -1
mv 0001-fixup.patch ../

cd ../
}

# ReApply Server Patches
function rasp() {
rm -rf *-Server
./gradlew applyServerPatches
}
4 changes: 3 additions & 1 deletion libs/api.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sentry = "5.4.0"
fastutil = "8.5.6"
findbugs = "1.3.9"
slf4j-api = "2.0.9"
brigadier = "1.2.9"
bungeechat = "1.20-R0.2"
json-simple = "1.1.1"
annotations = "24.0.1"
Expand All @@ -18,12 +19,13 @@ guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
sentry = { group = "io.sentry", name = "sentry", version.ref = "sentry" }
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
findbugs = { group = "com.google.code.findbugs", name = "jsr305", version.ref = "findbugs" }
brigadier = { group = "com.mojang", name = "brigadier", version.ref = "brigadier" }
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j-api" }
bungeechat = { group = "net.md-5", name = "bungeecord-chat", version.ref = "bungeechat" }
jsonsimple = { group = "com.googlecode.json-simple", name = "json-simple", version.ref = "json-simple" }
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" }

[bundles]
api = [ "guava", "gson", "joml", "fastutil", "slf4j-api", "sentry" ]
api = [ "guava", "gson", "joml", "fastutil", "slf4j-api", "sentry", "brigadier" ]
annotations = [ "annotations", "checkerqual" ]
2 changes: 1 addition & 1 deletion libs/common.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mockito = "5.5.0"
jupiter = "5.10.0"
hamcrest = "2.2"
snakeyaml = "2.2"
adventure = "4.17.0-SNAPSHOT"
adventure = "4.17.0"
commons-lang2 = "2.6"
commons-lang3 = "3.12.0"
maven-provider = "3.9.6"
Expand Down
14 changes: 0 additions & 14 deletions mkapi

This file was deleted.

14 changes: 0 additions & 14 deletions mksrv

This file was deleted.

Loading

0 comments on commit 34fef47

Please sign in to comment.