aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiniDigger | Martin <[email protected]>2024-11-01 08:58:55 +0100
committerNassim Jahnke <[email protected]>2024-12-12 10:57:30 +0100
commit40ec8fb60696c6d659aed0f3624903db353825d4 (patch)
treee49241cf3c59a2cdaa02d425b4c19af1f2a1fd5d
parent4ea25cd504497ffe27adae101e2ae6caa649d0e1 (diff)
downloadPaper-40ec8fb60696c6d659aed0f3624903db353825d4.tar.gz
Paper-40ec8fb60696c6d659aed0f3624903db353825d4.zip
Move to paperweight v2
Co-authored-by: Nassim Jahnke <[email protected]>
-rw-r--r--.gitignore24
-rw-r--r--build.gradle.kts56
-rw-r--r--paper-server/.gitignore3
-rw-r--r--paper-server/build.gradle.kts94
-rw-r--r--paper-server/patches/features/.gitkeep0
-rw-r--r--settings.gradle.kts2
-rw-r--r--softspoon/.gitignore5
-rw-r--r--softspoon/setup.sh24
8 files changed, 87 insertions, 121 deletions
diff --git a/.gitignore b/.gitignore
index a2adff58b6..2fc295e654 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,20 +28,6 @@ bin/
dist/
manifest.mf
-/work/Temp/
-work/1.*
-work/Minecraft
-work/BuildData
-work/Bukkit
-work/CraftBukkit
-work/Paperclip
-work/Spigot
-work/Spigot-Server
-work/Spigot-API
-work/*.jar
-work/test-server
-work/ForgeFlower
-
# Mac filesystem dust
.DS_Store/
.DS_Store
@@ -63,14 +49,10 @@ out/
run/
logs/
-Paper-Server
-Paper-API
-Paperclip.jar
-paperclip.jar
-paperclip-*.jar
-paperclip.properties
-
!gradle/wrapper/gradle-wrapper.jar
test-plugin.settings.gradle.kts
paper-api-generator.settings.gradle.kts
+
+# Don't track patched vanilla submodules
+paper-server/src/vanilla/
diff --git a/build.gradle.kts b/build.gradle.kts
index cce2a91f72..b265f02abd 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -11,7 +11,7 @@ import kotlin.io.path.*
plugins {
java
`maven-publish`
- id("io.papermc.paperweight.core") version "1.7.7"
+ id("io.papermc.paperweight.core") version "2.0.0-SNAPSHOT"
}
allprojects {
@@ -53,59 +53,21 @@ subprojects {
}
}
-val spigotDecompiler: Configuration by configurations.creating
-
-repositories {
- mavenCentral()
- maven(paperMavenPublicUrl) {
- content {
- onlyForConfigurations(
- configurations.paperclip.name,
- spigotDecompiler.name,
- )
- }
- }
-}
-
dependencies {
- paramMappings("net.fabricmc:yarn:1.21.4+build.1:mergedv2")
- remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
- decompiler("org.vineflower:vineflower:1.10.1")
- spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.13")
- paperclip("io.papermc:paperclip:3.0.3")
+ mache("io.papermc:mache:1.21.4+build.3")
}
paperweight {
- minecraftVersion = providers.gradleProperty("mcVersion")
- serverProject = project(":paper-server")
-
- paramMappingsRepo = paperMavenPublicUrl
- remapRepo = paperMavenPublicUrl
- decompileRepo = paperMavenPublicUrl
-
- craftBukkit {
- fernFlowerJar = layout.file(spigotDecompiler.elements.map { it.single().asFile })
- }
+ softSpoon = true
+ minecraftVersion = "1.21.4"
+ // macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java")
+ // gitFilePatches = true
paper {
- spigotApiPatchDir = layout.projectDirectory.dir("patches/api")
- spigotServerPatchDir = layout.projectDirectory.dir("patches/server")
-
- mappingsPatch = layout.projectDirectory.file("build-data/mappings-patch.tiny")
- reobfMappingsPatch = layout.projectDirectory.file("build-data/reobf-mappings-patch.tiny")
-
- reobfPackagesToFix.addAll(
- "co.aikar.timings",
- "com.destroystokyo.paper",
- "com.mojang",
- "io.papermc.paper",
- "ca.spottedleaf",
- "net.kyori.adventure.bossbar",
- "net.minecraft",
- "org.bukkit.craftbukkit",
- "org.spigotmc",
- )
+ paperServerDir = file("paper-server")
}
+
+ serverProject = project(":paper-server")
}
tasks.generateDevelopmentBundle {
diff --git a/paper-server/.gitignore b/paper-server/.gitignore
index 3811c0d849..083ccfdb5f 100644
--- a/paper-server/.gitignore
+++ b/paper-server/.gitignore
@@ -40,9 +40,6 @@ dependency-reduced-pom.xml
*.iws
.idea/
-/src/main/resources/achievement
-/src/main/resources/lang
-
# vs code
/.vscode
/.factorypath
diff --git a/paper-server/build.gradle.kts b/paper-server/build.gradle.kts
index c056b0fa1b..56f9075087 100644
--- a/paper-server/build.gradle.kts
+++ b/paper-server/build.gradle.kts
@@ -78,9 +78,6 @@ dependencies {
// Paper end - spark
}
-paperweight {
- craftBukkitPackageVersion.set("v1_21_R3") // also needs to be updated in MappingEnvironment
-}
tasks.jar {
archiveClassifier.set("dev")
@@ -107,7 +104,6 @@ tasks.jar {
"Build-Time" to Instant.now().toString(),
"Git-Branch" to gitBranch, // Paper
"Git-Commit" to gitHash, // Paper
- "CraftBukkit-Package-Version" to paperweight.craftBukkitPackageVersion.get(), // Paper
)
for (tld in setOf("net", "com", "org")) {
attributes("$tld/bukkit", "Sealed" to true)
@@ -127,27 +123,27 @@ publishing {
}
// Paper start
-val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
- badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;")
- jarToScan.set(tasks.serverJar.flatMap { it.archiveFile })
- classpath.from(configurations.compileClasspath)
-}
-tasks.check {
- dependsOn(scanJar)
-}
+// val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
+// badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;")
+// jarToScan.set(tasks.serverJar.flatMap { it.archiveFile })
+// classpath.from(configurations.compileClasspath)
+// }
+// tasks.check {
+// dependsOn(scanJar)
+// }
// Paper end
// Paper start - use TCA for console improvements
-tasks.serverJar {
- from(alsoShade.elements.map {
- it.map { f ->
- if (f.asFile.isFile) {
- zipTree(f.asFile)
- } else {
- f.asFile
- }
- }
- })
-}
+// tasks.serverJar {
+// from(alsoShade.elements.map {
+// it.map { f ->
+// if (f.asFile.isFile) {
+// zipTree(f.asFile)
+// } else {
+// f.asFile
+// }
+// }
+// })
+// }
// Paper end - use TCA for console improvements
tasks.test {
@@ -204,22 +200,22 @@ fun TaskContainer.registerRunTask(
block(this)
}
-val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatMap { it.elements }
- .zip(configurations.vanillaServer.map { it.singleFile.absolutePath }) { runtime, vanilla ->
- runtime.filterNot { it.asFile.absolutePath == vanilla }
- }
-
-tasks.registerRunTask("runServer") {
- description = "Spin up a test server from the Mojang mapped server jar"
- classpath(tasks.includeMappings.flatMap { it.outputJar })
- classpath(runtimeClasspathWithoutVanillaServer)
-}
-
-tasks.registerRunTask("runReobfServer") {
- description = "Spin up a test server from the reobfJar output jar"
- classpath(tasks.reobfJar.flatMap { it.outputJar })
- classpath(runtimeClasspathWithoutVanillaServer)
-}
+// val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatMap { it.elements }
+// .zip(configurations.vanillaServer.map { it.singleFile.absolutePath }) { runtime, vanilla ->
+// runtime.filterNot { it.asFile.absolutePath == vanilla }
+// }
+//
+// tasks.registerRunTask("runServer") {
+// description = "Spin up a test server from the Mojang mapped server jar"
+// classpath(tasks.includeMappings.flatMap { it.outputJar })
+// classpath(runtimeClasspathWithoutVanillaServer)
+// }
+//
+// tasks.registerRunTask("runReobfServer") {
+// description = "Spin up a test server from the reobfJar output jar"
+// classpath(tasks.reobfJar.flatMap { it.outputJar })
+// classpath(runtimeClasspathWithoutVanillaServer)
+// }
tasks.registerRunTask("runDevServer") {
description = "Spin up a test server without assembling a jar"
@@ -232,18 +228,18 @@ tasks.registerRunTask("runBundler") {
classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreateBundlerJar>("createMojmapBundlerJar").flatMap { it.outputZip })
mainClass.set(null as String?)
}
-tasks.registerRunTask("runReobfBundler") {
- description = "Spin up a test server from the reobf bundler jar"
- classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreateBundlerJar>("createReobfBundlerJar").flatMap { it.outputZip })
- mainClass.set(null as String?)
-}
+// tasks.registerRunTask("runReobfBundler") {
+// description = "Spin up a test server from the reobf bundler jar"
+// classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreateBundlerJar>("createReobfBundlerJar").flatMap { it.outputZip })
+// mainClass.set(null as String?)
+// }
tasks.registerRunTask("runPaperclip") {
description = "Spin up a test server from the Mojang mapped Paperclip jar"
classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreatePaperclipJar>("createMojmapPaperclipJar").flatMap { it.outputZip })
mainClass.set(null as String?)
}
-tasks.registerRunTask("runReobfPaperclip") {
- description = "Spin up a test server from the reobf Paperclip jar"
- classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreatePaperclipJar>("createReobfPaperclipJar").flatMap { it.outputZip })
- mainClass.set(null as String?)
-}
+// tasks.registerRunTask("runReobfPaperclip") {
+// description = "Spin up a test server from the reobf Paperclip jar"
+// classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreatePaperclipJar>("createReobfPaperclipJar").flatMap { it.outputZip })
+// mainClass.set(null as String?)
+// }
diff --git a/paper-server/patches/features/.gitkeep b/paper-server/patches/features/.gitkeep
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/paper-server/patches/features/.gitkeep
diff --git a/settings.gradle.kts b/settings.gradle.kts
index cdd32ab6ef..9503dfc6a6 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -33,7 +33,7 @@ if (!file(".git").exists()) {
rootProject.name = "paper"
-for (name in listOf("Paper-API", "Paper-Server")) {
+for (name in listOf("paper-api", "paper-server")) {
val projName = name.lowercase(Locale.ENGLISH)
include(projName)
file(name).mkdirs()
diff --git a/softspoon/.gitignore b/softspoon/.gitignore
new file mode 100644
index 0000000000..a6dfc5f56d
--- /dev/null
+++ b/softspoon/.gitignore
@@ -0,0 +1,5 @@
+buildtools
+spigot-mapped
+spigot-decomp
+vine-decomp
+vineflower.jar
diff --git a/softspoon/setup.sh b/softspoon/setup.sh
new file mode 100644
index 0000000000..065a6b7a19
--- /dev/null
+++ b/softspoon/setup.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+mkdir "buildtools" || true
+(
+ cd buildtools || exit
+ wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
+ #java -jar BuildTools.jar --rev 4369 # random 1.21.3 version
+)
+
+echo "copying spigot-mapped"
+mkdir "spigot-mapped" || true
+cp -r buildtools/work/decompile-7331f017/classes spigot-mapped
+
+echo "copying spigot-decomp"
+mkdir "spigot-decomp" || true
+cp -r buildtools/work/decompile-7331f017/net spigot-decomp/net
+
+echo "making vine-decomp"
+mkdir "vine-decomp" || true
+wget https://s01.oss.sonatype.org/content/repositories/snapshots/org/vineflower/vineflower/1.11.0-SNAPSHOT/vineflower-1.11.0-20240911.205325-50.jar -O vineflower.jar
+# todo double check vineflower version and arguments, rn this is mache stuff
+java -jar vineflower.jar --synthetic-not-set=true --ternary-constant-simplification=true --include-runtime=current --decompile-complex-constant-dynamic=true --indent-string=" " --decompile-inner=true --remove-bridge=true --decompile-generics=true --ascii-strings=false --remove-synthetic=true --include-classpath=true --inline-simple-lambdas=true --ignore-invalid-bytecode=false --bytecode-source-mapping=true --dump-code-lines=true --override-annotation=false --skip-extra-files=true spigot-mapped/classes vine-decomp
+
+# todo spigot and vf decompile a paper (old) remapped jar (just steal from some paper project cache folder)