Skip to content

Commit a1a2374

Browse files
committed
🔧 chore(build): update build configuration and patch exclusions
- remove folia-patches from canvasApi patchDir excludes - update Gradle wrapper version to 9.6.1 - change channel in gradle.properties from STABLE to ALPHA
1 parent 0d1313b commit a1a2374

6 files changed

Lines changed: 61 additions & 10 deletions

File tree

‎.github/workflows/upstream.yml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,12 @@ jobs:
151151
- name: Apply patches (with fuzzy fallback)
152152
if: env.SKIP == 'false'
153153
run: |
154-
./gradlew applyAllPatches --no-scan --stacktrace || \
155-
./gradlew applyCanvasSingleFilePatchesFuzzy --no-scan || \
156-
echo "APPLY_FAILED=true" >> $GITHUB_ENV
157-
./gradlew rebuildCanvasSingleFilePatches --no-scan || true
158-
./gradlew applyAllPatches --no-scan --stacktrace || echo "APPLY_FAILED=true" >> $GITHUB_ENV
154+
./gradlew applyAllPatches || ./gradlew applyCanvasSingleFilePatchesFuzzy || echo "APPLY_FAILED=true" >> $GITHUB_ENV
155+
./gradlew rebuildCanvasSingleFilePatches
156+
./gradlew applyAllPatches || echo "APPLY_FAILED=true" >> $GITHUB_ENV
157+
./gradlew rebuildPaperApiPatches
158+
./gradlew rebuildAllServerPatches
159+
./gradlew compileJava || echo "BUILD_FAILED=true" >> $GITHUB_ENV
159160
continue-on-error: true
160161

161162
- name: Rebuild patches

‎.idea/misc.xml‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/vcs.xml‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build.gradle.kts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ paperweight {
3333
}
3434
patchDir("canvasApi") {
3535
upstreamPath = "canvas-api"
36-
excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches", "folia-patches")
36+
excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches")
3737
patchesDir = file("surf-canvas-api/canvas-patches")
3838
outputDir = file("canvas-api")
3939
}

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ group=dev.slne.surf
22

33
apiVersion=26.2
44
mcVersion=26.2
5-
channel=STABLE
5+
channel=ALPHA
66

77
canvasBranch=main
88
canvasCommit=b348d591024dbbbfd400a4a23ebb4a65d609d654

‎surf-canvas-server/build.gradle.kts.patch‎

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
--- a/canvas-server/build.gradle.kts
22
+++ b/canvas-server/build.gradle.kts
3-
@@ -39,7 +_,29 @@
3+
@@ -1,4 +_,3 @@
4+
-import io.papermc.fill.model.BuildChannel
5+
import io.papermc.paperweight.attribute.DevBundleOutput
6+
import io.papermc.paperweight.util.*
7+
import java.time.Instant
8+
@@ -9,7 +_,7 @@
9+
`maven-publish`
10+
idea
11+
id("io.canvasmc.weaver.core")
12+
- id("io.papermc.fill.gradle") version "1.0.12"
13+
+ id("io.papermc.fill.gradle") version "1.0.11"
14+
}
15+
16+
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
17+
@@ -20,8 +_,8 @@
18+
}
19+
20+
val mergeMinecraftATs by tasks.registering<MergeAccessTransforms> {
21+
- firstFile.set(paperweight.activeFork.flatMap { it.buildDataDir.file("${it.name}.at") })
22+
- secondFile.set(paperweight.activeFork.flatMap { it.buildDataDir.file("folia.at") })
23+
+ firstFile.set(paperweight.forks.named("canvas").flatMap { it.buildDataDir.file("${it.name}.at") })
24+
+ secondFile.set(paperweight.forks.named("canvas").flatMap { it.buildDataDir.file("folia.at") })
25+
}
26+
27+
paperweight {
28+
@@ -39,7 +_,28 @@
429
}
530
}
631

@@ -17,7 +42,6 @@
1742
+ excludes = setOf(
1843
+ "src/minecraft",
1944
+ "paper-patches",
20-
+ "folia-patches",
2145
+ "minecraft-patches",
2246
+ "build.gradle.kts",
2347
+ "build.gradle.kts.patch"
@@ -57,7 +81,17 @@
5781
implementation("ca.spottedleaf:leafpile:1.0.0")
5882
implementation("org.jline:jline-terminal-ffm:3.29.0") // use ffm on java 22+
5983
implementation("org.jline:jline-terminal-jni:3.29.0") // fall back to jni on java 21
60-
@@ -210,16 +_,16 @@
84+
@@ -202,24 +_,24 @@
85+
manifest {
86+
val git = Git(rootProject.layout.projectDirectory.path)
87+
val mcVersion = rootProject.providers.gradleProperty("mcVersion").get()
88+
- val build = System.getenv("BUILD_NUMBER") ?: null
89+
- val buildTime = providers.environmentVariable("BUILD_STARTED_AT").map(Instant::parse).orElse(Instant.EPOCH).get()
90+
+ val build = System.getenv("BUILD_NUMBER") ?: -1
91+
+ val buildTime = if (build != -1) Instant.now() else Instant.EPOCH
92+
val gitHash = git.exec(providers, "rev-parse", "--short=7", "HEAD").get().trim()
93+
val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
94+
val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim()
6195
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
6296
attributes(
6397
"Main-Class" to "org.bukkit.craftbukkit.Main",
@@ -79,3 +113,12 @@
79113
"Build-Number" to (build ?: ""),
80114
"Build-Time" to buildTime.toString(),
81115
"Git-Branch" to gitBranch,
116+
@@ -358,7 +_,7 @@
117+
}
118+
119+
/* fill {
120+
- project("paper")
121+
+ project("folia")
122+
versionFamily(paperweight.minecraftVersion.map { it.split(".", "-").takeWhile { part -> part.toIntOrNull() != null }.take(2).joinToString(".") })
123+
version(paperweight.minecraftVersion)
124+

0 commit comments

Comments
 (0)