diff --git a/.gitignore b/.gitignore index 31fe126dc..6b3caedca 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ docs/build/ Purpur-Server Purpur-API mc-dev +purpurclip.jar diff --git a/purpur b/purpur index ad439fbe5..15ff3c346 100755 --- a/purpur +++ b/purpur @@ -56,6 +56,17 @@ case "$1" in mvn -e clean install && cd ../${FORK_NAME}-Server && mvn -e clean install ) ;; + "jar" | "purpurclip") + ( + basedir + cd "$basedir" + if [ "$2" != "fast" ]; then + scripts/upstream.sh + fi + ./scripts/apply.sh "$basedir" + ./scripts/purpurclip.sh + ) + ;; "d" | "de" | "deploy") ( basedir diff --git a/scripts/purpurclip.sh b/scripts/purpurclip.sh new file mode 100755 index 000000000..5c987ddde --- /dev/null +++ b/scripts/purpurclip.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +( +set -e +basedir="$(cd "$1" && pwd -P)" +workdir="$basedir/Paper/work" +mcver=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) +purpurjar="$basedir/Purpur-Server/target/purpur-$mcver.jar" +vanillajar="$workdir/Minecraft/$mcver/$mcver.jar" + +( + cd "$workdir/Paperclip" + mvn clean package "-Dmcver=$mcver" "-Dpaperjar=$purpurjar" "-Dvanillajar=$vanillajar" +) +cp "$workdir/Paperclip/assembly/target/paperclip-${mcver}.jar" "$basedir/purpurclip.jar" + +echo "" +echo "" +echo "" +echo "Build success!" +echo "Copied final jar to $(cd "$basedir" && pwd -P)/purpurclip.jar" +) || exit 1