Skip to content

Commit

Permalink
Describe new build process.
Browse files Browse the repository at this point in the history
  • Loading branch information
oddlama committed Jun 24, 2021
1 parent 414dc04 commit ad5b65a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ build
libs/
target/
target-obf/
external/
bin/
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<checksum>-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.
Expand Down
4 changes: 2 additions & 2 deletions remap_patched_paper_for_development.sh
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
17 changes: 10 additions & 7 deletions remap_plugins.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 \
Expand Down

0 comments on commit ad5b65a

Please sign in to comment.