From ad5b65a98e22468536e8f1591f914a622b805d4c Mon Sep 17 00:00:00 2001 From: oddlama Date: Thu, 24 Jun 2021 02:31:20 +0200 Subject: [PATCH] Describe new build process. --- .gitignore | 1 + README.md | 22 +++++++++++++++++++--- remap_patched_paper_for_development.sh | 4 ++-- remap_plugins.sh | 17 ++++++++++------- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index a974935f9..adf64681c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ build libs/ target/ target-obf/ +external/ bin/ diff --git a/README.md b/README.md index fa2abbc1c..593468bba 100644 --- a/README.md +++ b/README.md @@ -167,9 +167,25 @@ You can of course build the plugin yourself. To do that you need at least JDK 16 Before you can proceed, you need to copy the fully patched Paper server jar to `libs/`. This is required so the compiler can find minecraft-native symbols. -1. Copy `cache/patched_{version}.jar` from a paper server to `libs/` (create folder if necessary). -2. Execute `./gradlew build` -3. Resulting jar files will be in `target/` and `target-waterfall/`. +Unfortunately, the update to 1.17 made compiling a lot harder, because we need to +apply deobfuscation mappings ourselves before and after compilation. Therefore +we need to to some preparation before we can compile vane. + +#### Preparation + +This needs to be done only once after cloning the repository, or when the minecraft version changes in the future. + +1. Compile spigot using their BuildTools.jar (you can stop compiling after spigot has finished remapping the inital minecraft.jar) +2. In the directory `work/` you will find a file named similar to `work/bukkit--fields.csrg`. Copy it to the `external/` folder. +2. Download md_5's `SpecialSource-...-shaded.jar` to the `external/` folder. +3. Adjust the path to these files in `./remap_patched_paper_for_development.sh` and `./remap_plugins.sh`. Also set `sign=false` in `./remap_plugins.sh`. +4. From any paper server copy `paper_server/cache/patched_{version}.jar` to `libs/` (create folder if necessary). +5. Execute `./remap_patched_paper_for_development.sh` + +#### Building + +1. Execute `./gradlew build` and afterwards `./remap_plugins.sh` +2. All resulting jar files that can be used on a server will be in `target-obf/`. If you experience "peer not authenticated" issues from gradle, just retry. Seems to be a skittish integration between gradle and maven repositories. diff --git a/remap_patched_paper_for_development.sh b/remap_patched_paper_for_development.sh index 4ce3f21c4..bc98f14f0 100755 --- a/remap_patched_paper_for_development.sh +++ b/remap_patched_paper_for_development.sh @@ -1,7 +1,7 @@ #!/bin/bash -specialsource="$HOME/Downloads/SpecialSource-1.10.0-shaded.jar" -mapping="../spigot/work/bukkit-e3c5450d-fields.csrg" +specialsource="external/SpecialSource-1.10.0-shaded.jar" +mapping="external/bukkit-e3c5450d-fields.csrg" paper_jar="libs/patched_1.17.jar" die() { diff --git a/remap_plugins.sh b/remap_plugins.sh index 8f433b014..bfb19d64a 100755 --- a/remap_plugins.sh +++ b/remap_plugins.sh @@ -1,7 +1,8 @@ #!/bin/bash -specialsource="$HOME/Downloads/SpecialSource-1.10.0-shaded.jar" -mapping="../spigot/work/bukkit-e3c5450d-fields.csrg" +specialsource="external/SpecialSource-1.10.0-shaded.jar" +mapping="external/bukkit-e3c5450d-fields.csrg" +sign=true die() { echo "error: $*" >&2 @@ -18,11 +19,13 @@ for i in target/*.jar; do || die "Could not apply mapping" done -echo "[+] Signing jar files" -for i in target-obf/*.jar; do - gpg --local-user 680AA614E988DE3E84E0DEFA503F6C0684104B0A --armor --detach-sign --sign "$i" \ - || die "Could not sign jar file" -done +if [[ "$sign" == "true" ]]; then + echo "[+] Signing jar files" + for i in target-obf/*.jar; do + gpg --local-user 680AA614E988DE3E84E0DEFA503F6C0684104B0A --armor --detach-sign --sign "$i" \ + || die "Could not sign jar file" + done +fi echo "[+] Creating all-plugins.zip" cd target-obf \