From 22de75dedd4dcf048f7b7d08bb252017b4147165 Mon Sep 17 00:00:00 2001 From: mechoriet Date: Sat, 15 Apr 2023 22:18:53 +0200 Subject: [PATCH] changed so setup only sets up paperspigot so we can cache that and panda patch on applies pandapaper --- .github/workflows/build.yml | 2 +- scripts/applyPatches.sh | 23 +++++++++++++---------- scripts/build.sh | 1 + 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 24866d68..2ad331d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: with: # npm cache files are stored in `~/.npm` on Linux/macOS path: ~/base - key: cache-paper-base-${{ github.ref_name }} + key: cache-paper-base - if: ${{ steps.cache-base.outputs.cache-hit != 'true' }} name: Setup build environment run: ./panda setup diff --git a/scripts/applyPatches.sh b/scripts/applyPatches.sh index 70a24f3c..a698a799 100755 --- a/scripts/applyPatches.sh +++ b/scripts/applyPatches.sh @@ -105,18 +105,21 @@ if [ "$2" == "--setup" ] || [ "$2" == "--jar" ]; then echo "Importing MC Dev" ./scripts/importmcdev.sh "$basedir" || exit 1 + if [ "$2" == "--setup" ]; then + exit 1 + fi elif [ ! -d "base/Paper/PaperSpigot-Server" ]; then echo "Upstream directory does not exist. Did you forget to run 'panda setup'?" exit 1 +else + # Apply PandaSpigot + ( + applyPatch "base/Paper/PaperSpigot-API" PandaSpigot-API HEAD patches/api && + applyPatch "base/Paper/PaperSpigot-Server" PandaSpigot-Server HEAD patches/server + cd "$basedir" + ) || ( + echo "Failed to apply Paper Patches" + exit 1 + ) || exit 1 fi - -# Apply PandaSpigot -( - applyPatch "base/Paper/PaperSpigot-API" PandaSpigot-API HEAD patches/api && - applyPatch "base/Paper/PaperSpigot-Server" PandaSpigot-Server HEAD patches/server - cd "$basedir" -) || ( - echo "Failed to apply Paper Patches" - exit 1 -) || exit 1 ) || exit 1 diff --git a/scripts/build.sh b/scripts/build.sh index 60e18cbf..485920ed 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -15,6 +15,7 @@ if [ "$2" == "--setup" ] || [ "$2" == "--jar" ]; then ./scripts/decompile.sh "$basedir" ./scripts/init.sh "$basedir" fi +./scripts/applyPatches.sh "$basedir" "$2" if [ "$2" == "--jar" ]; then ./gradlew build && ./scripts/paperclip.sh "$basedir"