From 7effde04b101e875c050904b4852816d3c44f10a Mon Sep 17 00:00:00 2001 From: DemonWav Date: Sat, 2 Apr 2016 18:34:27 -0500 Subject: [PATCH] Rebuild patches after we continue from a paper edit. --- paper | 50 +++++++++++++++++++++++---------------- scripts/applyPatches.sh | 2 +- scripts/build.sh | 2 +- scripts/decompile.sh | 2 +- scripts/importmcdev.sh | 2 +- scripts/init.sh | 2 +- scripts/makemcdevsrc.sh | 2 +- scripts/paperclip.sh | 11 +++++---- scripts/rebuildPatches.sh | 2 +- scripts/remap.sh | 2 +- scripts/upstreamMerge.sh | 2 +- 11 files changed, 44 insertions(+), 35 deletions(-) diff --git a/paper b/paper index bac5d89e66..9d0e260c38 100755 --- a/paper +++ b/paper @@ -49,29 +49,37 @@ case "$1" in cd "$basedir" ;; "e" | "edit") - if [[ "$2" = "server" ]] ; then - cd "$basedir/Paper-Server" - export LAST_EDIT=$(pwd) + case "$2" in + "server") + cd "$basedir/Paper-Server" + export LAST_EDIT=$(pwd) - paperstash - git rebase -i upstream/upstream - paperunstash - elif [[ "$2" = "api" ]] ; then - cd "$basedir/Paper-API" - export LAST_EDIT=$(pwd) + paperstash + git rebase -i upstream/upstream + paperunstash + ;; + "api") + cd "$basedir/Paper-API" + export LAST_EDIT=$(pwd) - paperstash - git rebase -i upstream/upstream - paperunstash - elif [[ "$2" = "continue" ]] ; then - cd "$LAST_EDIT" - git add . - git rebase --continue - unset LAST_EDIT - scripts/rebuildPatches.sh "$basedir" - else - echo "You must edit either the api or server." - fi + paperstash + git rebase -i upstream/upstream + paperunstash + ;; + "continue") + cd "$LAST_EDIT" + git add . + git rebase --continue + unset LAST_EDIT + ( + cd "$basedir" + scripts/rebuildPatches.sh "$basedir" + ) + ;; + *) + echo "You must edit either the api or server." + ;; + esac ;; "setup") if [[ -f ~/.bashrc ]] ; then diff --git a/scripts/applyPatches.sh b/scripts/applyPatches.sh index 3c4d3a2a24..ef40406c95 100755 --- a/scripts/applyPatches.sh +++ b/scripts/applyPatches.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash PS1="$" -basedir="$1" +basedir=$(realpath "$1") workdir="$basedir/work" echo "Rebuilding Forked projects.... " diff --git a/scripts/build.sh b/scripts/build.sh index e5281754ba..4fee2815d7 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -basedir="$1" +basedir=$(realpath "$1") (git submodule update --init && ./scripts/remap.sh "$basedir" && ./scripts/decompile.sh "$basedir" && ./scripts/init.sh "$basedir" && ./scripts/applyPatches.sh "$basedir") || ( echo "Failed to build Paper" diff --git a/scripts/decompile.sh b/scripts/decompile.sh index 9dc9691690..7acd0a881f 100755 --- a/scripts/decompile.sh +++ b/scripts/decompile.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash PS1="$" -basedir="$1" +basedir=$(realpath "$1") workdir="$basedir/work" minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) decompiledir="$workdir/$minecraftversion" diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index 829a5ea1a8..e95d06deb5 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -3,7 +3,7 @@ nms="net/minecraft/server" export MODLOG="" PS1="$" -basedir="$1" +basedir=$(realpath "$1") workdir="$basedir/work" minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) diff --git a/scripts/init.sh b/scripts/init.sh index af9b1b9032..e2f3354c86 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash PS1="$" -basedir="$1" +basedir=$(realpath "$1") workdir="$basedir/work" minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) decompiledir="$workdir/$minecraftversion" diff --git a/scripts/makemcdevsrc.sh b/scripts/makemcdevsrc.sh index b5ea7daeab..a689356c48 100755 --- a/scripts/makemcdevsrc.sh +++ b/scripts/makemcdevsrc.sh @@ -2,7 +2,7 @@ PS1="$" -basedir="$1" +basedir=$(realpath "$1") workdir="$basedir/work" minecraftversion=$(cat "$basedir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) decompiledir="$workdir/$minecraftversion" diff --git a/scripts/paperclip.sh b/scripts/paperclip.sh index 4be65ac26f..0e2a4e80b3 100755 --- a/scripts/paperclip.sh +++ b/scripts/paperclip.sh @@ -1,17 +1,18 @@ #!/usr/bin/env bash -basedir="$1" +basedir=$(realpath "$1") workdir="$basedir/work" mcver=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) paperjar="../../Paper-Server/target/paper-$mcver.jar" vanillajar="../$mcver/$mcver.jar" -cd "$workdir/Paperclip" -mvn clean package "-Dmcver=$mcver" "-Dpaperjar=$paperjar" "-Dvanillajar=$vanillajar" || exit 1 -cd .. +( + cd "$workdir/Paperclip" + mvn clean package "-Dmcver=$mcver" "-Dpaperjar=$paperjar" "-Dvanillajar=$vanillajar" || exit 1 +) cp "$workdir/Paperclip/target/paperclip-${mcver}.jar" "$basedir/paperclip.jar" echo "" echo "" echo "" echo "Build success!" -echo "Copied final jar to $basedir/paperclip.jar" +echo "Copied final jar to "$(realpath "$basedir/paperclip.jar") diff --git a/scripts/rebuildPatches.sh b/scripts/rebuildPatches.sh index 6416e42e85..f4848b208f 100755 --- a/scripts/rebuildPatches.sh +++ b/scripts/rebuildPatches.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash PS1="$" -basedir="$1" +basedir=$(realpath "$1") workdir="$basedir/work" echo "Rebuilding patch files from current fork state..." git config core.safecrlf false diff --git a/scripts/remap.sh b/scripts/remap.sh index abfde02e6a..8e6b21ad19 100755 --- a/scripts/remap.sh +++ b/scripts/remap.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash PS1="$" -basedir="$1" +basedir=$(realpath "$1") workdir="$basedir/work" minecraftversion=$(cat ${workdir}/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) minecrafthash=$(cat ${workdir}/BuildData/info.json | grep minecraftHash | cut -d '"' -f 4) diff --git a/scripts/upstreamMerge.sh b/scripts/upstreamMerge.sh index 16dfaf48d1..7b36205070 100755 --- a/scripts/upstreamMerge.sh +++ b/scripts/upstreamMerge.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash PS1="$" -basedir="$1" +basedir=$(realpath "$1") workdir="$basedir/work" function update {