From f46463e08209f7c3e3cc951871c03a7b60d59f45 Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 13:38:19 -0500 Subject: [PATCH 01/34] Update yapfa --- yapfa | 301 ++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 185 insertions(+), 116 deletions(-) diff --git a/yapfa b/yapfa index 82a5b428..afa1a84b 100755 --- a/yapfa +++ b/yapfa @@ -1,132 +1,201 @@ #!/usr/bin/env bash -# get base dir regardless of execution location -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -SOURCE=$([[ "$SOURCE" = /* ]] && echo "$SOURCE" || echo "$PWD/${SOURCE#./}") -basedir=$(dirname "$SOURCE") -. "$basedir"/scripts/init.sh +# Akarin Build Script -paperstash() { - STASHED=$(git stash) +############################################################################ +# Multicore building # +# By JosephWorks # +# -------------------------------------------------------------------------# +# To use multicore building, use "$mvncmd" instead of "maven" # +# 20-50% speed improvement is quite common. # +############################################################################ + +# Exit immediately if a command exits with a non-zero status +set -e + +source "./scripts/functions.sh" + +function setupUpstreamAndPatch { + basedir + if [ "$1" == "--updatePaper" ]; then + $scriptdir/updateUpstream.sh "$basedir" 1 || exit 1 + else + if [ "$1" != "--skipPaper" ]; then + $scriptdir/updateUpstream.sh "$basedir" 0 || exit 1 # not update submodule + fi + fi + $scriptdir/applyPatches.sh "$basedir" || exit 1 } -paperunstash() { - if [[ "$STASHED" != "No local changes to save" ]] ; then - git stash pop - fi -} failed=0 case "$1" in - "rb" | "rbp" | "rebuild") - ( - set -e - cd "$basedir" - scripts/rebuildpatches.sh "$basedir" || exit 1 - ) || failed=1 - ;; - "p" | "patch" | "apply") - ( - set -e - cd "$basedir" - scripts/apply.sh "$basedir" || exit 1 - ) || failed=1 - ;; - "b" | "bu" | "build") - ( - basedir - mvn -N install - cd ${FORK_NAME}-API - mvn clean install && cd ../${FORK_NAME}-Server && mvn clean install - ) || failed=1 - ;; - "jar" | "paperclip") + "r" | "rb" | "rbp" | "rebuild") ( + set -e + basedir + $scriptdir/importSources.sh "$basedir" || exit 1 + $scriptdir/rebuildPatches.sh "$basedir" || exit 1 + ) || failed=1 + ;; + "a" | "p" | "patch" | "apply") + ( + set -e + setupUpstreamAndPatch $2 || exit 1 + ) || failed=1 + ;; + "b" | "bu" | "build" | "install") + ( + set -e + setupUpstreamAndPatch $2 || exit 1 + basedir + $mvncmd -N install || exit 1 + cd ${FORK_NAME}-API + $mvncmd -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -e clean install || exit 1 + ) || failed=1 + ;; + "j" | "launcher" | "jar" | "paperclip") + ( + setupUpstreamAndPatch $2 || exit 1 basedir - cd "$basedir" - ./scripts/paperclip.sh + $mvncmd -N install surefire-report:report + cd ${FORK_NAME}-API + $mvncmd -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -e clean install surefire-report:report + basedir + $scriptdir/installLauncher.sh "$basedir" + ) || failed=1 + ;; + "d" | "de" | "deploy") + ( + basedir + $mvncmd -N install + cd ${FORK_NAME}-API + $mvncmd clean deploy && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd clean install ) ;; - "d" | "de" | "deploy") - ( - basedir - mvn -N install - cd ${FORK_NAME}-API - mvn clean deploy && cd ../${FORK_NAME}-Server && mvn clean install - ) || failed=1 - ;; - "up" | "upstream") - ( - cd "$basedir" - scripts/upstream.sh "$2" || exit 1 - if [ "$2" == "up" ]; then - (scripts/apply.sh "$basedir" && scripts/rebuildpatches.sh "$basedir" && scripts/commitup.sh) || exit 1 - fi - ) || failed=1 - ;; - "cup" | "commitup" | "upc" | "upcommit") - ( - cd "$basedir" - scripts/commitup.sh || exit 1 - ) || failed=1 - ;; - "r" | "root") - cd "$basedir" - ;; - "a" | "api") - cd "$basedir/YAPFA-API" - ;; - "s" | "server") - cd "$basedir/YAPFA-Server" - ;; - "setup") - if [[ -f ~/.bashrc ]] ; then - NAME="ec" - if [[ ! -z "${2+x}" ]] ; then - NAME="$2" - fi - (grep "alias $NAME=" ~/.bashrc > /dev/null) && (sed -i "s|alias $NAME=.*|alias $NAME='. $SOURCE'|g" ~/.bashrc) || (echo "alias $NAME='. $SOURCE'" >> ~/.bashrc) - alias "$NAME=. $SOURCE" - echo "You can now just type '$NAME' at any time to access the paper tool." - fi - ;; - *) - echo "YAPFA build tool command. This provides a variety of commands to build and manage the PaperMC build" - echo "environment. For all of the functionality of this command to be available, you must first run the" - echo "'setup' command. View below for details. For essential building and patching, you do not need to do the setup." - echo "" - echo " Normal commands:" - echo " * rb, rebuild | Rebuild patches, can be called from anywhere." - echo " * p, patch | Apply all patches to top of Paper without building it. Can be run from anywhere." - echo " * up, upstream | Build Paper upstream, pass arg up to update paper. Can be run from anywhere." - echo " * b, build | Build API and Server but no deploy. Can be ran anywhere." - echo " * d, deploy | Build and Deploy API jar and build Server. Can be ran anywhere." - echo "" - echo " These commands require the setup command before use:" - echo " * r, root | Change directory to the root of the project." - echo " * a. api | Move to the Paper-API directory." - echo " * s, server | Move to the Paper-Server directory." - echo " * e, edit | Use to edit a specific patch, give it the argument \"server\" or \"api\"" - echo " | respectively to edit the correct project. Use the argument \"continue\" after" - echo " | the changes have been made to finish and rebuild patches. Can be called from anywhere." - echo "" - echo " * setup | Add an alias to .bashrc to allow full functionality of this script. Run as:" - echo " | . ./paper setup" - echo " | After you run this command you'll be able to just run 'paper' from anywhere." - echo " | The default name for the resulting alias is 'paper', you can give an argument to override" - echo " | this default, such as:" - echo " | . ./paper setup example" - echo " | Which will allow you to run 'example' instead." - ;; + "u" | "up" | "upstream" | "update") + ( + basedir + $scriptdir/updateUpstream.sh "$basedir" 1 + ) + ;; + "r" | "root") + basedir + ;; + "a" | "api") + cd "$basedir/Akarin-API" + ;; + "s" | "server") + cd "$basedir/Akarin-Server" + ;; + "c" | "clean") + rm -rf Akarin-API + rm -rf Akarin-Server + rm -rf Paper + echo "Cleaned build files" + ;; + "e" | "edit") + case "$2" in + "s" | "server") + export AKARIN_LAST_EDIT="$basedir/Akarin-Server" + cd "$basedir/Akarin-Server" + ( + set -e + gitstash + cd "$basedir/Paper/Paper-Server" + $gitcmd fetch --all + # Create the upstream branch in Paper project with current state + $gitcmd checkout master # possibly already in + $gitcmd branch -D upstream || true + $gitcmd branch -f upstream HEAD + cd "$basedir/Akarin-Server" + $gitcmd rebase -i upstream/upstream + gitunstash + ) + ;; + "a" | "api") + export AKARIN_LAST_EDIT="$basedir/Akarin-API" + cd "$basedir/Akarin-API" + ( + set -e + gitstash + cd "$basedir/Paper/Paper-API" + $gitcmd fetch --all + # Create the upstream branch in Paper project with current state + $gitcmd checkout master # possibly already in + $gitcmd branch -D upstream || true + $gitcmd branch -f upstream HEAD + cd "$basedir/Akarin-API" + $gitcmd rebase -i upstream/upstream + gitunstash + ) + ;; + "c" | "continue") + cd "$AKARIN_LAST_EDIT" + unset AKARIN_LAST_EDIT + ( + set -e + $gitcmd add . + $gitcmd commit --amend + $gitcmd rebase --continue + basedir + $scriptdir/rebuildPatches.sh "$basedir" + ) + ;; + *) + echo "You must edit either the api or server." + ;; + esac + ;; + "setup") + if [[ -f ~/.bashrc ]] ; then + NAME="akarin" + if [[ ! -z "${2+x}" ]] ; then + NAME="$2" + fi + (grep "alias $NAME=" ~/.bashrc > /dev/null) && (sed -i "s|alias $NAME=.*|alias $NAME='. $SOURCE'|g" ~/.bashrc) || (echo "alias $NAME='. $SOURCE'" >> ~/.bashrc) + alias "$NAME=. $SOURCE" + echo "You can now just type '$NAME' at any time to access the akarin tool." + fi + ;; + *) + echo "Akarin build tool command. This provides a variety of commands to build and manage the Akarin build" + echo "environment. For all of the functionality of this command to be available, you must first run the" + echo "'setup' command. View below for details. For essential building and patching, you do not need to do the setup." + echo "" + echo " Normal commands:" + echo " * r, rebuild | Rebuild patches, can be called from anywhere." + echo " * p, patch | Apply all patches to top of Paper without building it. Can be run from anywhere." + echo " * u, update | Update and patch the Paper submodule. Can be run from anywhere." + echo " * b, build | Build the projects, including the API and the Server. Can be ran anywhere." + echo " * j, jar | Build the projects and build the launcher jar. Can be ran anywhere." + echo " * d, deploy | Build the projects and deploy through Maven. Can be ran anywhere." + echo "" + echo " These commands require the setup command before use:" + echo " * r, root | Change directory to the root of the project." + echo " * a. api | Move to the Akarin-API directory." + echo " * s, server | Move to the Akarin-Server directory." + echo " * e, edit | Use to edit a specific patch, give it the argument \"server\" or \"api\"" + echo " | respectively to edit the correct project. Use the argument \"continue\" after" + echo " | the changes have been made to finish and rebuild patches. Can be called from anywhere." + echo "" + echo " * setup | Add an alias to .bashrc to allow full functionality of this script. Run as:" + echo " | . ./akarin setup" + echo " | After you run this command you'll be able to just run 'akarin' from anywhere." + echo " | The default name for the resulting alias is 'akarin', you can give an argument to override" + echo " | this default, such as:" + echo " | . ./akarin setup example" + echo " | Which will allow you to run 'example' instead." + ;; esac -unset -f paperstash -unset -f paperunstash -if [ "$failed" == "1" ]; then +unset RCPATH +unset SOURCE +unset basedir +unset -f color +unset -f colorend +unset -f gitstash +unset -f gitunstash +if [[ "$failed" == "1" ]]; then unset failed false else From 5566583015474ec33e05eb288dab6886f925b297 Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 13:40:14 -0500 Subject: [PATCH 02/34] Update yapfa --- yapfa | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yapfa b/yapfa index afa1a84b..70e62936 100755 --- a/yapfa +++ b/yapfa @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Akarin Build Script +# YAPFA Build Script ############################################################################ # Multicore building # @@ -158,7 +158,7 @@ case "$1" in fi ;; *) - echo "Akarin build tool command. This provides a variety of commands to build and manage the Akarin build" + echo "YAPFA build tool command. This provides a variety of commands to build and manage the YAPFA build" echo "environment. For all of the functionality of this command to be available, you must first run the" echo "'setup' command. View below for details. For essential building and patching, you do not need to do the setup." echo "" @@ -172,18 +172,18 @@ case "$1" in echo "" echo " These commands require the setup command before use:" echo " * r, root | Change directory to the root of the project." - echo " * a. api | Move to the Akarin-API directory." - echo " * s, server | Move to the Akarin-Server directory." + echo " * a. api | Move to the YAPFA-API directory." + echo " * s, server | Move to the YAPFA-Server directory." echo " * e, edit | Use to edit a specific patch, give it the argument \"server\" or \"api\"" echo " | respectively to edit the correct project. Use the argument \"continue\" after" echo " | the changes have been made to finish and rebuild patches. Can be called from anywhere." echo "" echo " * setup | Add an alias to .bashrc to allow full functionality of this script. Run as:" - echo " | . ./akarin setup" + echo " | . ./YAPFA setup" echo " | After you run this command you'll be able to just run 'akarin' from anywhere." echo " | The default name for the resulting alias is 'akarin', you can give an argument to override" echo " | this default, such as:" - echo " | . ./akarin setup example" + echo " | . ./YAPFA setup example" echo " | Which will allow you to run 'example' instead." ;; esac From b8c158bd4112ae2b53e74fdd65d19166eb86ff5f Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Wed, 15 Jul 2020 13:49:36 -0500 Subject: [PATCH 03/34] Fix --- scripts/apply.sh | 79 --------------------- scripts/applyPatches.sh | 95 +++++++++++++++++++++++++ scripts/commitUpstream.sh | 30 ++++++++ scripts/commitup.sh | 16 ----- scripts/functions.sh | 131 +++++++++++++++++++++++++++++++++++ scripts/generateImports.sh | 46 +++++++++++++ scripts/generatesources.sh | 43 ------------ scripts/importSources.sh | 138 +++++++++++++++++++++++++++++++++++++ scripts/init.sh | 46 ------------- scripts/installLauncher.sh | 31 +++++++++ scripts/paperclip.sh | 25 ------- scripts/push.sh | 13 ---- scripts/rebuildpatches.sh | 87 +++++++++++------------ scripts/updateUpstream.sh | 87 +++++++++++++++++++++++ scripts/upstream.sh | 60 ---------------- scripts/upstreamCommit.sh | 33 --------- 16 files changed, 599 insertions(+), 361 deletions(-) delete mode 100755 scripts/apply.sh create mode 100644 scripts/applyPatches.sh create mode 100644 scripts/commitUpstream.sh delete mode 100755 scripts/commitup.sh create mode 100644 scripts/functions.sh create mode 100644 scripts/generateImports.sh delete mode 100755 scripts/generatesources.sh create mode 100644 scripts/importSources.sh delete mode 100755 scripts/init.sh create mode 100644 scripts/installLauncher.sh delete mode 100755 scripts/paperclip.sh delete mode 100755 scripts/push.sh create mode 100644 scripts/updateUpstream.sh delete mode 100755 scripts/upstream.sh delete mode 100644 scripts/upstreamCommit.sh diff --git a/scripts/apply.sh b/scripts/apply.sh deleted file mode 100755 index 0682a3a7..00000000 --- a/scripts/apply.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# get base dir regardless of execution location -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -. $(dirname $SOURCE)/init.sh -PS1="$" - -tuinityVer=$(cat current-tuinity) -gpgsign="$(git config commit.gpgsign || echo "false")" - -echo "Rebuilding Forked projects.... " -function applyPatch { - what=$1 - what_name=$(basename $what) - target=$2 - branch=$3 - patch_folder=$4 - - cd "$basedir/$what" - git fetch --all - git branch -f upstream "$branch" >/dev/null - - cd "$basedir" - if [ ! -d "$basedir/$target" ]; then - mkdir "$basedir/$target" - cd "$basedir/$target" - git init - git remote add origin $5 - cd "$basedir" - fi - cd "$basedir/$target" - - # Disable GPG signing before AM, slows things down and doesn't play nicely. - # There is also zero rational or logical reason to do so for these sub-repo AMs. - # Calm down kids, it's re-enabled (if needed) immediately after, pass or fail. - git config commit.gpgsign false - - echo "Resetting $target to $what_name..." - git remote rm upstream > /dev/null 2>&1 - git remote add upstream $basedir/$what >/dev/null 2>&1 - (git am --abort ; git rebase --abort) 1>&2 2>/dev/null || true - git checkout master 2>/dev/null - git fetch upstream >/dev/null 2>&1 - git reset --hard upstream/upstream - echo " Applying patches to $target..." - statusfile=".git/patch-apply-failed" - rm -f "$statusfile" - git am --abort >/dev/null 2>&1 - git am --3way --ignore-whitespace "$basedir/patches/$patch_folder/"*.patch - if [ "$?" != "0" ]; then - echo 1 > "$statusfile" - echo " Something did not apply cleanly to $target." - echo " Please review above details and finish the apply then" - echo " save the changes with rebuildPatches.sh" - exit 1 - else - rm -f "$statusfile" - echo " Patches applied cleanly to $target" - fi -} -function enableCommitSigningIfNeeded { - if [[ "$gpgsign" == "true" ]]; then - git config commit.gpgsign true - fi -} - -( - (applyPatch Tuinity/Tuinity-API ${FORK_NAME}-API HEAD api $API_REPO && - applyPatch Tuinity/Tuinity-Server ${FORK_NAME}-Server HEAD server $SERVER_REPO) || exit 1 - enableCommitSigningIfNeeded -) || ( - echo "Failed to apply patches" - enableCommitSigningIfNeeded - exit 1 -) || exit 1 diff --git a/scripts/applyPatches.sh b/scripts/applyPatches.sh new file mode 100644 index 00000000..7bf957f5 --- /dev/null +++ b/scripts/applyPatches.sh @@ -0,0 +1,95 @@ +#!/usr/bin/env bash + +# SCRIPT HEADER start +basedir=$1 +source "$basedir/scripts/functions.sh" +echo " " +echo "----------------------------------------" +echo " $(bashcolor 1 32)Task$(bashcolorend) - Apply Patches" +echo " This will apply all of YAPFA patches on top of the Paper." +echo " " +echo " $(bashcolor 1 32)Subtask:$(bashcolorend)" +echo " - Import Sources" +echo " " +echo " $(bashcolor 1 32)Modules:$(bashcolorend)" +echo " - $(bashcolor 1 32)1$(bashcolorend) : API" +echo " - $(bashcolor 1 32)2$(bashcolorend) : Server" +echo "----------------------------------------" +# SCRIPT HEADER end + +needimport=$2 + +function applyPatch { + baseproject=$1 + basename=$(basename $baseproject) + target=$2 + branch=$3 + patch_folder=$4 + + # Skip if that software have no patch + haspatch=-f "$basedir/patches/$patch_folder/"*.patch >/dev/null 2>&1 # too many files + if [ ! haspatch ]; then + echo " $(bashcolor 1 33)($5/$6) Skipped$(bashcolorend) - No patch found for $target under patches/$patch_folder" + return + fi + + echo " $(bashcolor 1 32)($5/$6)$(bashcolorend) - Setup upstream project.." + cd "$basedir/$baseproject" + $gitcmd fetch --all &> /dev/null + # Create the upstream branch in Paper project with current state + $gitcmd checkout master >/dev/null 2>&1 # possibly already in + $gitcmd branch -D upstream &> /dev/null + $gitcmd branch -f upstream "$branch" &> /dev/null && $gitcmd checkout upstream &> /dev/null + + if [[ $needimport != "1" ]]; then + if [ $baseproject != "Paper/Paper-API" ]; then + echo " $(bashcolor 1 32)($5/$6)$(bashcolorend) - Import new introduced NMS files.." + basedir && $scriptdir/importSources.sh $basedir 1 || exit 1 + fi + fi + + basedir + # Create source project dirs + if [ ! -d "$basedir/$target" ]; then + mkdir "$basedir/$target" + cd "$basedir/$target" + # $gitcmd remote add origin "$5" + fi + cd "$basedir/$target" + $gitcmd init > /dev/null 2>&1 + + echo " " + echo " $(bashcolor 1 32)($5/$6)$(bashcolorend) - Reset $target to $basename.." + # Add the generated Paper project as the upstream remote of subproject + $gitcmd remote rm upstream &> /dev/null + $gitcmd remote add upstream "$basedir/$baseproject" &> /dev/null + # Ensure that we are in the branch we want so not overriding things + $gitcmd checkout master &> /dev/null || $gitcmd checkout -b master &> /dev/null + $gitcmd fetch upstream &> /dev/null + # Reset our source project to Paper + cd "$basedir/$target" && $gitcmd reset --hard upstream/upstream &> /dev/null + echo " " + + echo " $(bashcolor 1 32)($5/$6)$(bashcolorend) - Apply patches to $target.." + # Abort previous applying operation + $gitcmd am --abort >/dev/null 2>&1 + # Apply our patches on top Paper in our dirs + $gitcmd am --no-utf8 --3way --ignore-whitespace "$basedir/patches/$patch_folder/"*.patch + + if [ "$?" != "0" ]; then + echo " Something did not apply cleanly to $target." + echo " Please review above details and finish the apply then" + echo " save the changes with rebuildPatches.sh" + echo " or use 'git am --abort' to cancel this applying." + echo " $(bashcolor 1 33)($5/$6) Suspended$(bashcolorend) - Resolve the conflict or abort the apply" + echo " " + cd "$basedir/$target" + exit 1 + else + echo " $(bashcolor 1 32)($6/$6) Succeed$(bashcolorend) - Patches applied cleanly to $target" + echo " " + fi +} + +(applyPatch Tuinity/Tuinity-API ${FORK_NAME}-API HEAD api $API_REPO 0 2 && +applyPatch Tuinity/Tuinity-Server ${FORK_NAME}-Server HEAD server $SERVER_REPO 1 2) || exit 1 diff --git a/scripts/commitUpstream.sh b/scripts/commitUpstream.sh new file mode 100644 index 00000000..74752c7f --- /dev/null +++ b/scripts/commitUpstream.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +echo "[YAPFA] State: Commit Upstream" + +( +set -e + +function changeLog() { + base=$(git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1) + cd $1 && git log --oneline ${base}...HEAD +} +paper=$(changeLog Tuinity) + +updated="" +logsuffix="" +if [ ! -z "$paper" ]; then + logsuffix="$logsuffix\nTuinity Changes:\n$paper" + if [ -z "$updated" ]; then updated="Tuinity"; else updated="$updated/Tuinity"; fi +fi +disclaimer="Upstream has released updates that appears to apply and compile correctly" + +if [ ! -z "$1" ]; then + disclaimer="$@" +fi + +log="Updated Upstream ($updated)\n\n${disclaimer}${logsuffix}" + +echo -e "$log" | git commit -F - + +) || exit 1 diff --git a/scripts/commitup.sh b/scripts/commitup.sh deleted file mode 100755 index 8919502c..00000000 --- a/scripts/commitup.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -( -set -e -PS1="$" - -function changelog() { - base=$(git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1) - cd $1 && git log --oneline ${base}...HEAD -} -tuinity=$(changelog Tuinity) - -log="Updated Tuinity \n\nUpdating our baseline Tuinity reference\n\nTuinity changes since last:\n$tuinity" - -echo -e "$log" | git commit -F - - -) || exit 1 diff --git a/scripts/functions.sh b/scripts/functions.sh new file mode 100644 index 00000000..4e9dd5f3 --- /dev/null +++ b/scripts/functions.sh @@ -0,0 +1,131 @@ +#!/usr/bin/env bash +# CONFIG set +FORK_NAME="YAPFA" +API_REPO="" +SERVER_REPO="" +PAPER_API_REPO="" +PAPER_SERVER_REPO="" +MCDEV_REPO="" + +# Added Multithreading to builds +# By JosephWorks +mvncmd="mvn -T 1.5C" + +gitcmd="git -c commit.gpgsign=false -c core.quotepath=false -c core.safecrlf=false -c i18n.commit.encoding=UTF-8 -c i18n.logoutputencoding=UTF-8" + +# DIR configure +# resolve shell-specifics +case "$(echo "$SHELL" | sed -E 's|/usr(/local)?||g')" in + "/bin/zsh") + RCPATH="$HOME/.zshrc" + SOURCE="${BASH_SOURCE[0]:-${(%):-%N}}" + ;; + *) + RCPATH="$HOME/.bashrc" + if [[ -f "$HOME/.bash_aliases" ]]; then + RCPATH="$HOME/.bash_aliases" + fi + SOURCE="${BASH_SOURCE[0]}" + ;; +esac + +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +SOURCE=$([[ "$SOURCE" = /* ]] && echo "$SOURCE" || echo "$PWD/${SOURCE#./}") +scriptdir=$(dirname "$SOURCE") +basedir=$(dirname "$scriptdir") + +function basedir { + cd "$basedir" +} + +function paperdir { + cd "$basedir/Tuinity" +} + +gitcmd() { + $gitcmd "$@" +} + +# COLOUR functions +color() { + if [ $2 ]; then + echo -e "\e[$1;$2m" + else + echo -e "\e[$1m" + fi +} + +colorend() { + echo -e "\e[m" +} + +function bashcolor { + if [ $2 ]; then + echo -e "\e[$1;$2m" + else + echo -e "\e[$1m" + fi +} + +function bashcolorend { + echo -e "\e[m" +} + +# GIT functions +gitstash() { + STASHED=$($gitcmd stash 2>/dev/null|| return 0) # errors are ok +} + +gitunstash() { + if [[ "$STASHED" != "No local changes to save" ]] ; then + $gitcmd stash pop 2>/dev/null|| return 0 # errors are ok + fi +} + +function gethead { + basedir + git log -1 --oneline +} + +function gitpush { + if [ "$(git config minecraft.push-${FORK_NAME})" == "1" ]; then + echo "Push - $1 ($3) to $2" + ( + basedir + git remote rm script-push > /dev/null 2>&1 + git remote add script-push $2 >/dev/null 2>&1 + git push script-push $3 -f + ) + fi +} + +# PATCH functions +function cleanupPatches { + cd "$1" + for patch in *.patch; do + gitver=$(tail -n 2 $patch | grep -ve "^$" | tail -n 1) + diffs=$(git diff --staged $patch | grep -E "^(\+|\-)" | grep -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|.index|Date\: )") + + testver=$(echo "$diffs" | tail -n 2 | grep -ve "^$" | tail -n 1 | grep "$gitver") + if [ "x$testver" != "x" ]; then + diffs=$(echo "$diffs" | tail -n +3) + fi + + if [ "x$diffs" == "x" ] ; then + git reset HEAD $patch >/dev/null + git checkout -- $patch >/dev/null + fi + done +} + +function containsElement { + local e + for e in "${@:2}"; do + [[ "$e" == "$1" ]] && return 0; + done + return 1 +} diff --git a/scripts/generateImports.sh b/scripts/generateImports.sh new file mode 100644 index 00000000..eedf840f --- /dev/null +++ b/scripts/generateImports.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +echo "[YAPFA] State: Generate Imports" + +# For a description of this script, see updateUpstream.sh. + +# get base dir regardless of execution location +basedir=$1 + +source "$basedir/scripts/functions.sh" + +paperworkdir="$basedir/Tuinity/Paper/work" +minecraftversion=$(cat $paperworkdir/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) +decompile="$paperworkdir/Minecraft/$minecraftversion/spigot" + +# create dev dir +basedir +mkdir -p mc-dev/src/net/minecraft/server +cd mc-dev + +# prepare to push +if [ ! -d ".git" ]; then + $gitcmd init +fi + +# reset dev files to raw nms in spigot naming +rm src/net/minecraft/server/*.java +cp $decompile/net/minecraft/server/*.java src/net/minecraft/server + +# diff and only preserve new added files +paperserver="$basedir/Tuinity/Tuinity-Server/src/main/java/net/minecraft/server" +cd $basedir/mc-dev/src/net/minecraft/server/ + +for file in $(/bin/ls $paperserver) +do + if [ -f "$file" ]; then + rm -f "$file" + fi +done + +# push the dev project +cd $basedir/mc-dev +$gitcmd add . -A +$gitcmd commit . -m "YAPFA-base" +$gitcmd tag -a "YAPFA-base" -m "YAPFA-base" 2>/dev/null +# gitpush . $MCDEV_REPO $paperVer diff --git a/scripts/generatesources.sh b/scripts/generatesources.sh deleted file mode 100755 index 2eae5c94..00000000 --- a/scripts/generatesources.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -. $(dirname $SOURCE)/init.sh - - -cd $basedir -tuinityVer=$(cat current-tuinity) - -minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) -decompile="Tuinity/work/Minecraft/$minecraftversion/spigot" - -mkdir -p mc-dev/src/net/minecraft/server - -cd mc-dev -if [ ! -d ".git" ]; then - git init -fi - -rm src/net/minecraft/server/*.java -for i in $basedir/$decompile/net/minecraft/server/*.java; -do - cp "$i" src/net/minecraft/server -done - - -base="$basedir/Tuinity/Tuinity-Server/src/main/java/net/minecraft/server" -cd $basedir/mc-dev/src/net/minecraft/server/ -for file in $(/bin/ls $base) -do - if [ -f "$file" ]; then - rm -f "$file" - fi -done -cd $basedir/mc-dev -git add . -A -git commit . -m "mc-dev" -git tag -a "$tuinityVer" -m "$tuinityVer" 2>/dev/null diff --git a/scripts/importSources.sh b/scripts/importSources.sh new file mode 100644 index 00000000..bf467fbf --- /dev/null +++ b/scripts/importSources.sh @@ -0,0 +1,138 @@ +#!/usr/bin/env bash + +maintask=$2 +if [[ $maintask == "0" ]]; then + TASKTITLE="Import Sources" +else + TASKTITLE="Import Sources (Subtask)" +fi + +# SCRIPT HEADER start +basedir=$1 +source "$basedir/scripts/functions.sh" +echo " " +echo "----------------------------------------" +echo " $(bashcolor 1 32)Task$(bashcolorend) - $TASKTITLE" +echo " This will import unimported newly added/mod sources to Paper workspace" +echo "----------------------------------------" +# SCRIPT HEADER end + +# For a description of this script, see updateUpstream.sh. +paperworkdir="$basedir/Tuinity/Paper/work" +paperserverdir="$basedir/Tuinity/Tuinity-Server" +papersrcdir="$paperserverdir/src/main/java" +papernmsdir="$papersrcdir/net/minecraft/server" + +( + # fast-fail if Paper not set + if [ ! -d "$papernmsdir" ]; then + echo " $(bashcolor 1 31)Exception$(bashcolorend) - Paper sources not generated, run updateUpstream.sh to setup." + exit 1 + fi +) + +minecraftversion=$(cat "$basedir"/Tuinity/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) +decompiledir=$paperworkdir/Minecraft/$minecraftversion/spigot + +nms="net/minecraft/server" +export IMPORT_LOG="" # for commit message, list all files and source for libs +basedir + +function importToPaperWorkspace { + if [ -f "$papernmsdir/$1.java" ]; then + # echo " $(bashcolor 1 33)Skipped$(bashcolorend) - Already imported $1.java" + return 0 + fi + + file="$1.java" + target="$papernmsdir/$file" + base="$decompiledir/$nms/$file" + + if [[ ! -f "$target" ]]; then + export IMPORT_LOG="$IMPORT_LOG Import: $file\n"; + echo "Import: $file" + cp "$base" "$target" + fi +} + +function importLibraryToPaperWorkspace { + group=$1 + lib=$2 + prefix=$3 + shift 3 + for file in "$@"; do + file="$prefix/$file" + target="$papersrcdir/$file" + targetdir=$(dirname "$target") + mkdir -p "${targetdir}" + + base="$paperworkdir/Minecraft/$minecraftversion/libraries/${group}/${lib}/$file" + if [ ! -f "$base" ]; then + echo " $(bashcolor 1 31)Exception$(bashcolorend) - Cannot find file $file.java of lib $lib in group $group to import, re-decomplie or remove the import." + exit 1 + fi + + export IMPORT_LOG="$IMPORT_LOG Import: $file from lib $lib\n"; + echo "Import: $file ($lib)" + sed 's/\r$//' "$base" > "$target" || exit 1 + done +} + +( + # Reset to last NORMAL commit if already have imported before + cd "$paperserverdir" + lastcommit=$(git log -1 --pretty=oneline --abbrev-commit) + if [[ "$lastcommit" = *"Extra dev imports of YAPFA"* ]]; then + git reset --hard HEAD^ + fi +) + +# Filter and import every files which have patch to modify +patchedFiles=$(cat patches/server/* | grep "+++ b/src/main/java/net/minecraft/server/" | sort | uniq | sed 's/\+\+\+ b\/src\/main\/java\/net\/minecraft\/server\///g' | sed 's/.java//g') + +patchedFilesNonNMS=$(cat patches/server/* | grep "create mode " | grep -Po "src/main/java/net/minecraft/server/(.*?).java" | sort | uniq | sed 's/src\/main\/java\/net\/minecraft\/server\///g' | sed 's/.java//g') + +( + cd "$paperserverdir" + $gitcmd fetch --all &> /dev/null + # Create the upstream branch in Paper project with current state + $gitcmd checkout master >/dev/null 2>&1 # possibly already in + $gitcmd branch -D upstream &>/dev/null + $gitcmd branch -f upstream HEAD && $gitcmd checkout upstream +) + +basedir +for f in $patchedFiles; do + containsElement "$f" ${patchedFilesNonNMS[@]} + if [ "$?" == "1" ]; then + if [ ! -f "$papersrcdir/$nms/$f.java" ]; then + if [ ! -f "$decompiledir/$nms/$f.java" ]; then + echo " $(bashcolor 1 31)Exception$(bashcolorend) - Cannot find NMS file $f.java to import, re-decomplie or remove the import." + exit 1 + else + importToPaperWorkspace $f + fi + fi + fi +done + +# NMS import format: +# importToPaperWorkspace MinecraftServer + +# Library import format (multiple files are supported): +# importLibraryToPaperWorkspace com.mojang datafixerupper com/mojang/datafixers/util Either.java + +# Submit imports by commit with file descriptions +( + cd "$paperserverdir" + # rm -rf nms-patches + git add . &> /dev/null + echo -e "Extra dev imports of YAPFA\n\n$IMPORT_LOG" | git commit src -F - &> /dev/null + echo " $(bashcolor 1 32)Succeed$(bashcolorend) - Sources have been imported to Paper/Paper-Server (branch upstream)" + + if [[ $maintask != "0" ]]; then # this is magical + echo "----------------------------------------" + echo " Subtask finished" + echo "----------------------------------------" + fi +) diff --git a/scripts/init.sh b/scripts/init.sh deleted file mode 100755 index a781f3dc..00000000 --- a/scripts/init.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -sourceBase=$(dirname $SOURCE)/../ -cd "${basedir:-$sourceBase}" - -basedir=$(pwd -P) -cd - - -FORK_NAME="YAPFA" - -function bashColor { -if [ $2 ]; then - echo -e "\e[$1;$2m" -else - echo -e "\e[$1m" -fi -} -function bashColorReset { - echo -e "\e[m" -} - -function cleanupPatches { - cd "$1" - for patch in *.patch; do - gitver=$(tail -n 2 $patch | grep -ve "^$" | tail -n 1) - diffs=$(git diff --staged $patch | grep -E "^(\+|\-)" | grep -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|.index|Date\: )") - - testver=$(echo "$diffs" | tail -n 2 | grep -ve "^$" | tail -n 1 | grep "$gitver") - if [ "x$testver" != "x" ]; then - diffs=$(echo "$diffs" | tail -n +3) - fi - - if [ "x$diffs" == "x" ] ; then - git reset HEAD $patch >/dev/null - git checkout -- $patch >/dev/null - fi - done -} -function basedir { - cd "$basedir" -} -function gethead { - ( - cd "$1" - git log -1 --oneline - ) -} diff --git a/scripts/installLauncher.sh b/scripts/installLauncher.sh new file mode 100644 index 00000000..fff5e9a2 --- /dev/null +++ b/scripts/installLauncher.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# SCRIPT HEADER start +basedir=$1 +source "$basedir/scripts/functions.sh" +echo " " +echo "----------------------------------------" +echo " $(bashcolor 1 32)Task$(bashcolorend) - Install Launcher" +echo " This will build a launcher that similar to Paperclip by the server jar." +echo " " +echo "----------------------------------------" +# SCRIPT HEADER end + +# Copied from https://github.com/PaperMC/Paper/blob/d54ce6c17fb7a35238d6b9f734d30a4289886773/scripts/paperclip.sh +# License from Paper applies to this file + +set -e +paperworkdir="$basedir/Tuinity/Paper/work" +mcver=$(cat "$paperworkdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) +serverjar="$basedir/YAPFA-Server/target/YAPFA-$mcver.jar" +vanillajar="$paperworkdir/Minecraft/$mcver/$mcver.jar" + +( + cd "$paperworkdir/Paperclip" + mvn clean package "-Dmcver=$mcver" "-Dpaperjar=$serverjar" "-Dvanillajar=$vanillajar" +) +mkdir -p "$basedir/target" +cp "$paperworkdir/Paperclip/assembly/target/paperclip-${mcver}.jar" "$basedir/target/YAPFA-${mcver}-launcher.jar" + +echo "" +echo " $(bashcolor 1 32)Success$(bashcolorend) - Saved launcher jar to target/YAPFA-${mcver}-launcher.jar" diff --git a/scripts/paperclip.sh b/scripts/paperclip.sh deleted file mode 100755 index 8622dfe2..00000000 --- a/scripts/paperclip.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -# Copied from https://github.com/PaperMC/Paper/blob/d54ce6c17fb7a35238d6b9f734d30a4289886773/scripts/paperclip.sh -# License from Paper applies to this file - -( -set -e -basedir="$(cd "$1" && pwd -P)" -workdir="$basedir/Tuinity/Paper/work" -mcver=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) -paperjar="$basedir/YAPFA-Server/target/yapfa-$mcver.jar" -vanillajar="$workdir/Minecraft/$mcver/$mcver.jar" - -( - cd "$workdir/Paperclip" - mvn clean package "-Dmcver=$mcver" "-Dpaperjar=$paperjar" "-Dvanillajar=$vanillajar" -) -cp "$workdir/Paperclip/assembly/target/paperclip-${mcver}.jar" "$basedir/yapfa-paperclip.jar" - -echo "" -echo "" -echo "" -echo "Build success!" -echo "Copied final jar to $(cd "$basedir" && pwd -P)/yapfa-paperclip.jar" -) || exit 1 diff --git a/scripts/push.sh b/scripts/push.sh deleted file mode 100755 index 92d3646b..00000000 --- a/scripts/push.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# get base dir regardless of execution location -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -. $(dirname $SOURCE)/init.sh - -minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) - -basedir diff --git a/scripts/rebuildpatches.sh b/scripts/rebuildpatches.sh index 27ba16a4..c3b02bba 100755 --- a/scripts/rebuildpatches.sh +++ b/scripts/rebuildpatches.sh @@ -1,51 +1,46 @@ -#!/bin/bash -# get base dir regardless of execution location -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ ${SOURCE} != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -. $(dirname ${SOURCE})/init.sh +#!/usr/bin/env bash + +# SCRIPT HEADER start +basedir=$1 +source "$basedir/scripts/functions.sh" +echo " " +echo "----------------------------------------" +echo " $(bashcolor 1 32)Task$(bashcolorend) - Rebuild Patches" +echo " This will diff the sources of YAPFA and Paper to build patches." +echo " " +echo " $(bashcolor 1 32)Modules:$(bashcolorend)" +echo " - $(bashcolor 1 32)1$(bashcolorend) : API" +echo " - $(bashcolor 1 32)2$(bashcolorend) : Server" +echo "----------------------------------------" +# SCRIPT HEADER end -PS1="$" -echo "Rebuilding patch files from current fork state..." function savePatches { - what=$1 - cd ${basedir}/${what}/ + targetname=$1 + basedir + mkdir -p $basedir/patches/$2 + if [ -d ".git/rebase-apply" ]; then + # in middle of a rebase, be smarter + echo "REBASE DETECTED - PARTIAL SAVE" + last=$(cat ".git/rebase-apply/last") + next=$(cat ".git/rebase-apply/next") + declare -a files=("$basedir/patches/$2/"*.patch) + for i in $(seq -f "%04g" 1 1 $last) + do + if [ $i -lt $next ]; then + rm "${files[`expr $i - 1`]}" + fi + done + else + rm -rf $basedir/patches/$2/*.patch + fi - mkdir -p ${basedir}/patches/$2 - if [ -d ".git/rebase-apply" ]; then - # in middle of a rebase, be smarter - echo "REBASE DETECTED - PARTIAL SAVE" - last=$(cat ".git/rebase-apply/last") - next=$(cat ".git/rebase-apply/next") - declare -a files=("$basedir/patches/$2/"*.patch) - for i in $(seq -f "%04g" 1 1 ${last}) - do - if [ ${i} -lt ${next} ]; then - rm "${files[`expr ${i} - 1`]}" - fi - done - else - rm ${basedir}/patches/$2/*.patch - fi - - git format-patch --quiet -N -o ${basedir}/patches/$2 upstream/upstream - cd ${basedir} - git add -A ${basedir}/patches/$2 - cleanupPatches ${basedir}/patches/$2/ - echo " Patches saved for $what to patches/$2" + cd "$basedir/$targetname" + $gitcmd format-patch --no-signature --zero-commit --full-index --no-stat -N -o "$basedir/patches/$2" upstream/upstream >/dev/null + basedir + $gitcmd add -A "$basedir/patches/$2" + echo " $(bashcolor 1 32)($3/$4)$(bashcolorend) - Patches saved for $targetname to patches/$2" } -savePatches ${FORK_NAME}-API api -if [ -f "$basedir/${FORK_NAME}-API/.git/patch-apply-failed" ]; then - echo "$(bashColor 1 31)[[[ WARNING ]]] $(bashColor 1 33)- Not saving Tuinity-Server as it appears ${FORK_NAME}-API did not apply clean.$(bashColorReset)" - echo "$(bashColor 1 33)If this is a mistake, delete $(bashColor 1 34)${FORK_NAME}-API/.git/patch-apply-failed$(bashColor 1 33) and run rebuild again.$(bashColorReset)" - echo "$(bashColor 1 33)Otherwise, rerun ./tuinity patch to have a clean Tuinity-API apply so the latest Tuinity-Server can build.$(bashColorReset)" -else - savePatches ${FORK_NAME}-Server server - ${basedir}/scripts/push.sh -fi - - +savePatches ${FORK_NAME}-API api 1 2 +savePatches ${FORK_NAME}-Server server 2 2 +# gitpushproject diff --git a/scripts/updateUpstream.sh b/scripts/updateUpstream.sh new file mode 100644 index 00000000..a05c0c64 --- /dev/null +++ b/scripts/updateUpstream.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash + +# SCRIPT HEADER start +basedir=$1 +source "$basedir/scripts/functions.sh" +echo "----------------------------------------" +echo " $(bashcolor 1 32)Task$(bashcolorend) - Update Upstream" +echo " This will update and patch Paper, importing necessary sources for patching." +#echo " " +#echo " $(bashcolor 1 32)Subtask:$(bashcolorend)" +#echo " - Import Sources" +echo " " +echo " $(bashcolor 1 32)Projects:$(bashcolorend)" +echo " - $(bashcolor 1 32)1$(bashcolorend) : Paper" +echo " - $(bashcolor 1 32)2$(bashcolorend) : YAPFA" +echo "----------------------------------------" +# SCRIPT HEADER end + +# This script are capable of patching paper which have the same effect with renewing the source codes of paper to its corresponding remote/official state, and also are able to reset the patches of paper to its head commit to override dirty changes which needs a argument with --resetPaper. + +# After the patching, it will copying sources that do no exist in the YAPFA workspace but referenced in YAPFA patches into our workspace, depending on the content of our patches, this will be addressed by calling importSources.sh. + +# Following by invoking generateImports.sh, it will generate new added/imported files of paper compared to the original decompiled sources into mc-dev folder under the root dir of the project, whose intention is unclear yet. + +# exit immediately if a command exits with a non-zero status +set -e + +subtasks=1 +updatepaper=$2 +if [ "$updatepaper" == "1" ]; then + echo " $(bashcolor 1 32)(0/$subtasks)$(bashcolorend) - Update Git submodules.." + $gitcmd submodule update --init --remote +fi + +if [[ "$2" == "--resetPaper" ]]; then + echo " $(bashcolor 1 32)(0/$subtasks)$(bashcolorend) - Reset Paper submodule.." + paperdir + $gitcmd fetch && $gitcmd reset --hard origin/master + basedir + $gitcmd add Paper +fi + +# patch paper +echo " $(bashcolor 1 32)(0/$subtasks)$(bashcolorend) - Apply patches of Tuinity.." +echo " " +paperVer=$(gethead Tuinity) +paperdir +./tuinity patch + +#cd "Paper-Server" +#mcVer=$($mvncmd -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=minecraft_version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }') + +#echo " $(bashcolor 1 32)(1/$subtasks)$(bashcolorend) - Import necessary sources.." +#basedir +#"$basedir"/scripts/importSources.sh $1 + +#minecraftversion=$(cat "$basedir"/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) +#version=$(echo -e "Paper: $paperVer\nmc-dev:$importedmcdev") +#tag="${minecraftversion}-${mcVer}-$(echo -e $version | shasum | awk '{print $2}')" +#echo "$tag" > "$basedir"/current-paper + +# "$basedir"/scripts/generateImports.sh $1 # unused + +#echo " $(bashcolor 1 32)(1/$subtasks)$(bashcolorend) - Tagging Paper submodules.." +#function tag { +# paperdir && cd $1 +# if [ "$3" == "1" ]; then +# git tag -d "$tag" 2>/dev/null +# fi +# echo -e "$(date)\n\n$version" | git tag -a "$tag" -F - 2>/dev/null +#} + +#echo -e "$version" + +#forcetag=0 +#if [ "$(cat "$basedir"/current-paper)" != "$tag" ]; then +# forcetag=1 +#fi + +#tag Paper-API $forcetag +#tag Paper-Server $forcetag + +echo " $(bashcolor 1 32)($subtasks/$subtasks) Succeed$(bashcolorend) - Submodules have been updated, regenerated and imported, run 'YAPFA patch' to test/fix patches, and by 'YAPFA rbp' to rebuild patches that fixed with the updated upstream." +echo " " + +# gitpush Paper-API $PAPER_API_REPO $tag +# gitpush Paper-Server $PAPER_SERVER_REPO $tag diff --git a/scripts/upstream.sh b/scripts/upstream.sh deleted file mode 100755 index ef1c716b..00000000 --- a/scripts/upstream.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# get base dir regardless of execution location -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -. $(dirname $SOURCE)/init.sh - -if [[ "$1" == up* ]]; then - ( - cd "$basedir/Tuinity/" - git fetch && git reset --hard origin/ver/1.14 - cd ../ - git add Tuinity - ) -fi - -tuinityVer=$(gethead Tuinity) -cd "$basedir/Tuinity/" - -./tuinity patch - -cd "Tuinity-Server" -mcVer=$(mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=minecraft_version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }') - -basedir -. $basedir/scripts/importmcdev.sh - -minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) -version=$(echo -e "Tuinity: $tuinityVer\nmc-dev:$importedmcdev") -tag="${minecraftversion}-${mcVer}-$(echo -e $version | shasum | awk '{print $1}')" -echo "$tag" > $basedir/current-tuinity -git add "$basedir/current-tuinity" - -$basedir/scripts/generatesources.sh - -cd Tuinity/ - -function tag { -( - cd $1 - if [ "$2" == "1" ]; then - git tag -d "$tag" 2>/dev/null - fi - echo -e "$(date)\n\n$version" | git tag -a "$tag" -F - 2>/dev/null -) -} -echo "Tagging as $tag" -echo -e "$version" - -forcetag=0 -if [ "$(cat $basedir/current-tuinity)" != "$tag" ]; then - forcetag=1 -fi - -tag Tuinity-API $forcetag -tag Tuinity-Server $forcetag - diff --git a/scripts/upstreamCommit.sh b/scripts/upstreamCommit.sh deleted file mode 100644 index 721699f3..00000000 --- a/scripts/upstreamCommit.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -( -set -e -PS1="$" - -function changelog() { - base=$(git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1) - cd $1 && git log --oneline ${base}...ORIGIN/ver/1.16 -} -tuinity=$(changelog Tuinity) -#paper=$(changelog Tuinity/Paper) - -updated="" -logsuffix="" -if [ ! -z "$tuinity" ]; then - logsuffix="$logsuffix\n\nTuinity Changes:\n$tuinity" - if [ -z "$updated" ]; then updated="Tuinity"; else updated="$updated/Tuinity"; fi -fi -#if [ ! -z "$paper" ]; then -# logsuffix="$logsuffix\n\nPaper Changes:\n$paper" -# if [ -z "$updated" ]; then updated="Paper"; else updated="$updated/Paper"; fi -#fi -disclaimer="Upstream has released updates that appears to apply and compile correctly" - -if [ ! -z "$1" ]; then - disclaimer="$@" -fi - -log="${UP_LOG_PREFIX}Updated Upstream ($updated)\n\n${disclaimer}${logsuffix}" - -echo -e "$log" - -) || exit 1 \ No newline at end of file From c5ed9e9af78d93bc60be0288c616b1630e1d1fa2 Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 14:01:05 -0500 Subject: [PATCH 04/34] useless test commit --- yapfa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yapfa b/yapfa index 70e62936..3f27e5d7 100755 --- a/yapfa +++ b/yapfa @@ -1,5 +1,5 @@ #!/usr/bin/env bash - + # YAPFA Build Script ############################################################################ From 0181a85ebaee430a4682ee01077f10820330278e Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 14:01:41 -0500 Subject: [PATCH 05/34] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0167c287..5b1073ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ name: CI - + on: [push] jobs: From 8063647e7647f1e11a3e758a4bafc43407b7e8d4 Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 14:05:39 -0500 Subject: [PATCH 06/34] Update build.yml --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d405122..a11a7f91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,12 +31,7 @@ jobs: git submodule update --init --recursive git config --global user.email "ci@github.com" git config --global user.name "Github CI" - yapfaDir=`pwd` ./patchPaper.sh - cd Tuinity - mvn -N install - ./tuinity patch - cd $yapfaDir ./yapfa patch ./yapfa build ./yapfa paperclip From ad83ab3d3e8c1f4c844895f7c90a802fd74bc0d7 Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 14:05:56 -0500 Subject: [PATCH 07/34] Update build.yml --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a11a7f91..fccff2c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,9 +31,6 @@ jobs: git submodule update --init --recursive git config --global user.email "ci@github.com" git config --global user.name "Github CI" - ./patchPaper.sh - ./yapfa patch - ./yapfa build ./yapfa paperclip - name: Upload Artifact uses: actions/upload-artifact@v2-preview From 71f53b7f1d50a0e92d8ae69cbb2fd249f4662599 Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 14:07:30 -0500 Subject: [PATCH 08/34] Update importSources.sh --- scripts/importSources.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/importSources.sh b/scripts/importSources.sh index bf467fbf..2037a32e 100644 --- a/scripts/importSources.sh +++ b/scripts/importSources.sh @@ -118,10 +118,12 @@ done # NMS import format: # importToPaperWorkspace MinecraftServer - +importToPaperWorkspace PistonExtendsChecker +importToPaperWorkspace EnumDirection # Library import format (multiple files are supported): # importLibraryToPaperWorkspace com.mojang datafixerupper com/mojang/datafixers/util Either.java - +importLibraryToPaperWorkspace com.mojang authlib com/mojang/authlib yggdrasil/YggdrasilGameProfileRepository.java +importLibraryToPaperWorkspace com.mojang datafixerupper com/mojang/datafixers/util Either.java # Submit imports by commit with file descriptions ( cd "$paperserverdir" From f204802b3b088116d8a451aec776d0e28684665d Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Wed, 15 Jul 2020 14:09:04 -0500 Subject: [PATCH 09/34] Fix --- README.md | 6 +- fetchUpstream.sh | 12 ---- patchPaper.sh | 1 - scripts/importmcdev_paper.sh | 122 ----------------------------------- 4 files changed, 1 insertion(+), 140 deletions(-) delete mode 100644 fetchUpstream.sh delete mode 100755 patchPaper.sh delete mode 100755 scripts/importmcdev_paper.sh diff --git a/README.md b/README.md index dc67a292..bd2c1e0d 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,7 @@ ## Building and setting up Run the following commands in the root directory: ``` -git submodule init -git submodule update -./fetchUpstream.sh -./yapfa build -./yapfa paperclip +./yapfa jar ``` ## LICENSE diff --git a/fetchUpstream.sh b/fetchUpstream.sh deleted file mode 100644 index 3a7e3213..00000000 --- a/fetchUpstream.sh +++ /dev/null @@ -1,12 +0,0 @@ -cd Tuinity -git clean -fx -git clean -fd -git fetch -git reset --hard origin/ver/1.16 -git submodule update --init --recursive -f -cd .. -sh patchPaper.sh -cd Tuinity -./tuinity paperclip -cd .. -./yapfa patch \ No newline at end of file diff --git a/patchPaper.sh b/patchPaper.sh deleted file mode 100755 index 2183b818..00000000 --- a/patchPaper.sh +++ /dev/null @@ -1 +0,0 @@ -cp -f ./scripts/importmcdev_paper.sh ./Tuinity/Paper/scripts/importmcdev.sh \ No newline at end of file diff --git a/scripts/importmcdev_paper.sh b/scripts/importmcdev_paper.sh deleted file mode 100755 index 9b2e567c..00000000 --- a/scripts/importmcdev_paper.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env bash - -( -set -e -nms="net/minecraft/server" -export MODLOG="" -PS1="$" -basedir="$(cd "$1" && pwd -P)" -source "$basedir/scripts/functions.sh" -gitcmd="git -c commit.gpgsign=false" - -workdir="$basedir/work" -minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) -decompiledir="$workdir/Minecraft/$minecraftversion/forge" -# replace for now -decompiledir="$workdir/Minecraft/$minecraftversion/spigot" -export importedmcdev="" -function import { - export importedmcdev="$importedmcdev $1" - file="${1}.java" - target="$workdir/Spigot/Spigot-Server/src/main/java/$nms/$file" - base="$decompiledir/$nms/$file" - - if [[ ! -f "$target" ]]; then - export MODLOG="$MODLOG Imported $file from mc-dev\n"; - #echo "Copying $base to $target" - cp "$base" "$target" || exit 1 - else - echo "UN-NEEDED IMPORT: $file" - fi -} - -function importLibrary { - group=$1 - lib=$2 - prefix=$3 - shift 3 - for file in "$@"; do - file="$prefix/$file" - target="$workdir/Spigot/Spigot-Server/src/main/java/${file}" - targetdir=$(dirname "$target") - mkdir -p "${targetdir}" - base="$workdir/Minecraft/$minecraftversion/libraries/${group}/${lib}/$file" - if [ ! -f "$base" ]; then - echo "Missing $base" - exit 1 - fi - export MODLOG="$MODLOG Imported $file from $lib\n"; - sed 's/\r$//' "$base" > "$target" || exit 1 - done -} - -( - cd "$workdir/Spigot/Spigot-Server/" - lastlog=$($gitcmd log -1 --oneline) - if [[ "$lastlog" = *"mc-dev Imports"* ]]; then - $gitcmd reset --hard HEAD^ - fi -) - - - -files=$(cat "$basedir/Spigot-Server-Patches/"* | grep "+++ b/src/main/java/net/minecraft/server/" | sort | uniq | sed 's/\+\+\+ b\/src\/main\/java\/net\/minecraft\/server\///g' | sed 's/.java//g') - -nonnms=$(grep -R "new file mode" -B 1 "$basedir/Spigot-Server-Patches/" | grep -v "new file mode" | grep -oE "net\/minecraft\/server\/.*.java" | grep -oE "[A-Za-z]+?.java$" --color=none | sed 's/.java//g') -function containsElement { - local e - for e in "${@:2}"; do - [[ "$e" == "$1" ]] && return 0; - done - return 1 -} -set +e -for f in $files; do - containsElement "$f" ${nonnms[@]} - if [ "$?" == "1" ]; then - if [ ! -f "$workdir/Spigot/Spigot-Server/src/main/java/net/minecraft/server/$f.java" ]; then - if [ ! -f "$decompiledir/$nms/$f.java" ]; then - echo "$(color 1 31) ERROR!!! Missing NMS$(color 1 34) $f $(colorend)"; - else - import $f - fi - fi - fi -done - -######################################################## -######################################################## -######################################################## -# NMS IMPORTS -# Temporarily add new NMS dev imports here before you run paper patch -# but after you have paper rb'd your changes, remove the line from this file before committing. -# we do not need any lines added to this file for NMS - -import PistonExtendsChecker -import EnumDirection -#import EnumAxisCycle # doesn't compile without fixes, copied into patch -# import TileEntityPiston # doesn't compile without fixes, copied into patch - - - -######################################################## -######################################################## -######################################################## -# LIBRARY IMPORTS -# These must always be mapped manually, no automatic stuff -# -# # group # lib # prefix # many files - -# dont forget \ at end of each line but last -importLibrary com.mojang authlib com/mojang/authlib yggdrasil/YggdrasilGameProfileRepository.java -importLibrary com.mojang datafixerupper com/mojang/datafixers/util Either.java - -######################################################## -######################################################## -######################################################## -set -e -cd "$workdir/Spigot/Spigot-Server/" -rm -rf nms-patches applyPatches.sh makePatches.sh >/dev/null 2>&1 -$gitcmd add . -A >/dev/null 2>&1 -echo -e "mc-dev Imports\n\n$MODLOG" | $gitcmd commit . -F - -) From 1aa6aae4ab7b8b765329bd3221a36fc5860d2c6f Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 14:10:48 -0500 Subject: [PATCH 10/34] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fccff2c1..03b387da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,10 +27,10 @@ jobs: - name: Build YAPFA run: | - git submodule init - git submodule update --init --recursive + git submodule update --init --recursive -f git config --global user.email "ci@github.com" git config --global user.name "Github CI" + sudo chmod -R -f 777 scripts ./yapfa paperclip - name: Upload Artifact uses: actions/upload-artifact@v2-preview From 8bf2a0d27812b800bff6662dd0d92bc7457a7646 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Wed, 15 Jul 2020 14:32:56 -0500 Subject: [PATCH 11/34] ok might possibly do something maybe --- .github/workflows/build.yml | 2 +- README.md | 2 +- scripts/installLauncher.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03b387da..f4bff751 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,4 +36,4 @@ jobs: uses: actions/upload-artifact@v2-preview with: name: YAPFA-${{ matrix.java }} - path: yapfa-paperclip.jar + path: target/YAPFA-1.16.1-paperclip.jar diff --git a/README.md b/README.md index bd2c1e0d..da850d04 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ ### villager.villagersHideAtNight ``Default``:``false`` Addon for ``villager.simplerVillagerBehavior``, gives villagers the ability to drink an invisibility potion like wandering traders at night to make it less likely for them to be killed since (for now) they don't stay at the village/use their houses at night and no ability for them to respawn. ## Building and setting up -Run the following commands in the root directory: +Run the following command in the root directory: ``` ./yapfa jar diff --git a/scripts/installLauncher.sh b/scripts/installLauncher.sh index fff5e9a2..54b1f9ca 100644 --- a/scripts/installLauncher.sh +++ b/scripts/installLauncher.sh @@ -25,7 +25,7 @@ vanillajar="$paperworkdir/Minecraft/$mcver/$mcver.jar" mvn clean package "-Dmcver=$mcver" "-Dpaperjar=$serverjar" "-Dvanillajar=$vanillajar" ) mkdir -p "$basedir/target" -cp "$paperworkdir/Paperclip/assembly/target/paperclip-${mcver}.jar" "$basedir/target/YAPFA-${mcver}-launcher.jar" +cp "$paperworkdir/Paperclip/assembly/target/paperclip-${mcver}.jar" "$basedir/target/YAPFA-${mcver}-paperclip.jar" echo "" echo " $(bashcolor 1 32)Success$(bashcolorend) - Saved launcher jar to target/YAPFA-${mcver}-launcher.jar" From 3134a5cfdafb0c51761a17cbc3900b52550f58b1 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Wed, 15 Jul 2020 14:48:29 -0500 Subject: [PATCH 12/34] Fix 2 --- .gitmodules | 3 ++- current-tuinity | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 73179f45..85c6a88e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "Tuinity"] path = Tuinity - url = https://github.com/Spottedleaf/Tuinity + url = https://github.com/tsao-chi/Tuinity-autoupstreamupdate.git + branch = ver/1.16 diff --git a/current-tuinity b/current-tuinity index dace6a38..c40c2296 100644 --- a/current-tuinity +++ b/current-tuinity @@ -1 +1 @@ -1.15.2--055421230a1bb70eefcf15d57ad8551e1e9d47b1 +1.16.1--8c602452d2ded22cb7322c41de5c78395b5f1348 \ No newline at end of file From 79bbf4a9227debed4448ad81c44461af87d87d64 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Wed, 15 Jul 2020 14:53:13 -0500 Subject: [PATCH 13/34] behold! My fix! --- Tuinity | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tuinity b/Tuinity index 8750b612..8c602452 160000 --- a/Tuinity +++ b/Tuinity @@ -1 +1 @@ -Subproject commit 8750b612cd178886035069475341d515e9135a84 +Subproject commit 8c602452d2ded22cb7322c41de5c78395b5f1348 From 8f0f00816d1ee32962cfec9967e9b1e902177e0a Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 14:59:26 -0500 Subject: [PATCH 14/34] Update build.yml --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4bff751..d2b5fbb5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,12 @@ jobs: git config --global user.email "ci@github.com" git config --global user.name "Github CI" sudo chmod -R -f 777 scripts + cd Tuinity + cd paper + ./paper patch + cd ..// + ./tuinity jar + cd ..// ./yapfa paperclip - name: Upload Artifact uses: actions/upload-artifact@v2-preview From 796dfb7a23a346f2bee88b7af4a3193126485f17 Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 15:06:37 -0500 Subject: [PATCH 15/34] very cool fix that is very useful and does some thonking on it's own --- .github/workflows/build.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2b5fbb5..a66930bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,25 +18,30 @@ jobs: uses: actions/setup-java@v1.3.0 with: java-version: ${{ matrix.java }} - - - uses: actions/cache@v1.1.2 + - name: Pull Maven Cache + uses: actions/cache@v1.1.2 + id: maven-cache with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-maven- - + - name: Setup YAPFA Project + run: | + git submodule update --init --recursive -f + git config --global user.email "ci@github.com" + git config --global user.name "Github CI" + sudo chmod -R -f 777 scripts + - name: Build Maven Depends + if: steps.maven-cache.outputs.cache-hit != 'true' + run: | + cd Tuinity + cd Paper + ./paper patch + cd ..// + ./tuinity jar + cd ..// - name: Build YAPFA run: | - git submodule update --init --recursive -f - git config --global user.email "ci@github.com" - git config --global user.name "Github CI" - sudo chmod -R -f 777 scripts - cd Tuinity - cd paper - ./paper patch - cd ..// - ./tuinity jar - cd ..// ./yapfa paperclip - name: Upload Artifact uses: actions/upload-artifact@v2-preview From ad54fc31b13e56373ccf0f1f7ffdab463497bf7d Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Wed, 15 Jul 2020 16:18:28 -0500 Subject: [PATCH 16/34] idk might work --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a66930bb..f7d8f6d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: run: | cd Tuinity cd Paper - ./paper patch + ./paper jar cd ..// ./tuinity jar cd ..// From 9a7bb0fe583b5547d138cb5a96f3514f4e88fabb Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Wed, 15 Jul 2020 16:39:10 -0500 Subject: [PATCH 17/34] CaPs --- scripts/installLauncher.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/installLauncher.sh b/scripts/installLauncher.sh index 54b1f9ca..1d06e950 100644 --- a/scripts/installLauncher.sh +++ b/scripts/installLauncher.sh @@ -17,7 +17,7 @@ echo "----------------------------------------" set -e paperworkdir="$basedir/Tuinity/Paper/work" mcver=$(cat "$paperworkdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) -serverjar="$basedir/YAPFA-Server/target/YAPFA-$mcver.jar" +serverjar="$basedir/YAPFA-Server/target/yapfa-$mcver.jar" vanillajar="$paperworkdir/Minecraft/$mcver/$mcver.jar" ( From a2ef4f64b797798de9f573918478ff634a1a9090 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Wed, 15 Jul 2020 16:56:58 -0500 Subject: [PATCH 18/34] Faster No Cache Build --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f7d8f6d0..ba618feb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,8 +35,6 @@ jobs: if: steps.maven-cache.outputs.cache-hit != 'true' run: | cd Tuinity - cd Paper - ./paper jar cd ..// ./tuinity jar cd ..// From 504e5d781fe0c251390f17f685b894502c70a3e9 Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 17:30:41 -0500 Subject: [PATCH 19/34] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index da850d04..630da26e 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,10 @@ ### villager.villagersHideAtNight ``Default``:``false`` Addon for ``villager.simplerVillagerBehavior``, gives villagers the ability to drink an invisibility potion like wandering traders at night to make it less likely for them to be killed since (for now) they don't stay at the village/use their houses at night and no ability for them to respawn. ## Building and setting up -Run the following command in the root directory: +Run the following commands in the root directory: ``` +git submodule update --init --recursive --force ./yapfa jar ``` @@ -57,4 +58,4 @@ ## LICENSE See [EMC](https://github.com/starlis/empirecraft), [Lithium](https://github.com/jellysquid3/lithium-fabric), [Akarin](https://github.com/Akarin-project/Akarin), [Purpur](https://github.com/pl3xgaming/Purpur) and [Tuinity](https://github.com/Spottedleaf/Tuinity) for the license of material used/modified by this project. -**By using this project you accept the Mojang EULA! Starting the server-jar requires that you have read and accepted the EULA because of [this patch](https://github.com/tr7zw/YAPFA/blob/master/patches/server/0017-EMC-Accept-the-EULA.patch)!** \ No newline at end of file +**By using this project you accept the Mojang EULA! Starting the server-jar requires that you have read and accepted the EULA because of [this patch](https://github.com/tr7zw/YAPFA/blob/master/patches/server/0017-EMC-Accept-the-EULA.patch)!** From 9486f23579a8613a075050d89da0daab8922b9c1 Mon Sep 17 00:00:00 2001 From: budgidiere Date: Wed, 15 Jul 2020 17:31:05 -0500 Subject: [PATCH 20/34] Update build.yml --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ba618feb..d4e2a844 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,6 @@ jobs: if: steps.maven-cache.outputs.cache-hit != 'true' run: | cd Tuinity - cd ..// ./tuinity jar cd ..// - name: Build YAPFA From 2ddbe13b702d38135d9de6562badb7a931ee1960 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 21:02:27 -0500 Subject: [PATCH 21/34] Changes --- .github/workflows/build.yml | 2 +- scripts/fetchUpstream.sh | 8 ++++ yapfa | 84 ++++++++++++++++--------------------- 3 files changed, 45 insertions(+), 49 deletions(-) create mode 100644 scripts/fetchUpstream.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4e2a844..32c78854 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: cd ..// - name: Build YAPFA run: | - ./yapfa paperclip + ./yapfa full - name: Upload Artifact uses: actions/upload-artifact@v2-preview with: diff --git a/scripts/fetchUpstream.sh b/scripts/fetchUpstream.sh new file mode 100644 index 00000000..e2427d87 --- /dev/null +++ b/scripts/fetchUpstream.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +cd $1 +cd Tuinity +git clean -fx +git clean -fd +git fetch +git reset --hard origin/ver/1.16 +git submodule update --init --recursive -f \ No newline at end of file diff --git a/yapfa b/yapfa index 3f27e5d7..a0186027 100755 --- a/yapfa +++ b/yapfa @@ -15,18 +15,6 @@ set -e source "./scripts/functions.sh" -function setupUpstreamAndPatch { - basedir - if [ "$1" == "--updatePaper" ]; then - $scriptdir/updateUpstream.sh "$basedir" 1 || exit 1 - else - if [ "$1" != "--skipPaper" ]; then - $scriptdir/updateUpstream.sh "$basedir" 0 || exit 1 # not update submodule - fi - fi - $scriptdir/applyPatches.sh "$basedir" || exit 1 -} - failed=0 case "$1" in "r" | "rb" | "rbp" | "rebuild") @@ -40,38 +28,23 @@ case "$1" in "a" | "p" | "patch" | "apply") ( set -e - setupUpstreamAndPatch $2 || exit 1 + $scriptdir/applyPatches.sh "$basedir" || exit 1 ) || failed=1 ;; "b" | "bu" | "build" | "install") ( - set -e - setupUpstreamAndPatch $2 || exit 1 - basedir - $mvncmd -N install || exit 1 - cd ${FORK_NAME}-API - $mvncmd -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -e clean install || exit 1 - ) || failed=1 - ;; - "j" | "launcher" | "jar" | "paperclip") - ( - setupUpstreamAndPatch $2 || exit 1 basedir $mvncmd -N install surefire-report:report cd ${FORK_NAME}-API $mvncmd -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -e clean install surefire-report:report + ) || failed=1 + ;; + "j" | "launcher" | "jar" | "paperclip") + ( basedir $scriptdir/installLauncher.sh "$basedir" ) || failed=1 ;; - "d" | "de" | "deploy") - ( - basedir - $mvncmd -N install - cd ${FORK_NAME}-API - $mvncmd clean deploy && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd clean install - ) - ;; "u" | "up" | "upstream" | "update") ( basedir @@ -82,22 +55,37 @@ case "$1" in basedir ;; "a" | "api") - cd "$basedir/Akarin-API" + cd "$basedir/YAPFA-API" ;; "s" | "server") - cd "$basedir/Akarin-Server" + cd "$basedir/YAPFA-Server" + ;; + "fup" | "fetchupstream") + $scriptdir/fetchUpstream.sh "$basedir" || exit 1 ;; "c" | "clean") - rm -rf Akarin-API - rm -rf Akarin-Server + rm -rf YAPFA-API + rm -rf YAPFA-Server rm -rf Paper echo "Cleaned build files" ;; + "f" | "fu" | "full" | "fullbuild") + ( + basedir + $scriptdir/updateUpstream.sh "$basedir" || exit 1 + set -e + $scriptdir/applyPatches.sh "$basedir" || exit 1 + basedir + $mvncmd -N install surefire-report:report + cd ${FORK_NAME}-API + $mvncmd -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -e clean install surefire-report:report + ) || failed=1 + ;; "e" | "edit") case "$2" in "s" | "server") - export AKARIN_LAST_EDIT="$basedir/Akarin-Server" - cd "$basedir/Akarin-Server" + export YAPFA_LAST_EDIT="$basedir/YAPFA-Server" + cd "$basedir/YAPFA-Server" ( set -e gitstash @@ -107,14 +95,14 @@ case "$1" in $gitcmd checkout master # possibly already in $gitcmd branch -D upstream || true $gitcmd branch -f upstream HEAD - cd "$basedir/Akarin-Server" + cd "$basedir/YAPFA-Server" $gitcmd rebase -i upstream/upstream gitunstash ) ;; "a" | "api") - export AKARIN_LAST_EDIT="$basedir/Akarin-API" - cd "$basedir/Akarin-API" + export YAPFA_LAST_EDIT="$basedir/YAPFA-API" + cd "$basedir/YAPFA-API" ( set -e gitstash @@ -124,14 +112,14 @@ case "$1" in $gitcmd checkout master # possibly already in $gitcmd branch -D upstream || true $gitcmd branch -f upstream HEAD - cd "$basedir/Akarin-API" + cd "$basedir/YAPFA-API" $gitcmd rebase -i upstream/upstream gitunstash ) ;; "c" | "continue") - cd "$AKARIN_LAST_EDIT" - unset AKARIN_LAST_EDIT + cd "$YAPFA_LAST_EDIT" + unset YAPFA_LAST_EDIT ( set -e $gitcmd add . @@ -148,13 +136,13 @@ case "$1" in ;; "setup") if [[ -f ~/.bashrc ]] ; then - NAME="akarin" + NAME="YAPFA" if [[ ! -z "${2+x}" ]] ; then NAME="$2" fi (grep "alias $NAME=" ~/.bashrc > /dev/null) && (sed -i "s|alias $NAME=.*|alias $NAME='. $SOURCE'|g" ~/.bashrc) || (echo "alias $NAME='. $SOURCE'" >> ~/.bashrc) alias "$NAME=. $SOURCE" - echo "You can now just type '$NAME' at any time to access the akarin tool." + echo "You can now just type '$NAME' at any time to access the YAPFA tool." fi ;; *) @@ -180,8 +168,8 @@ case "$1" in echo "" echo " * setup | Add an alias to .bashrc to allow full functionality of this script. Run as:" echo " | . ./YAPFA setup" - echo " | After you run this command you'll be able to just run 'akarin' from anywhere." - echo " | The default name for the resulting alias is 'akarin', you can give an argument to override" + echo " | After you run this command you'll be able to just run 'YAPFA' from anywhere." + echo " | The default name for the resulting alias is 'YAPFA', you can give an argument to override" echo " | this default, such as:" echo " | . ./YAPFA setup example" echo " | Which will allow you to run 'example' instead." From 6267d053e4b4ca973fadc816fcba3d5bd6958b95 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 21:12:04 -0500 Subject: [PATCH 22/34] mmmm yes --- Tuinity | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tuinity b/Tuinity index 8c602452..74a062e0 160000 --- a/Tuinity +++ b/Tuinity @@ -1 +1 @@ -Subproject commit 8c602452d2ded22cb7322c41de5c78395b5f1348 +Subproject commit 74a062e04c76d21296f7e6d176261c51503ce4b0 From 5793d94973fb4e34a12e071e59eb49607fcdad46 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 21:28:27 -0500 Subject: [PATCH 23/34] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32c78854..f6b5dbb9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - java: [11, 8] + java: [11, 8, latest] steps: - uses: actions/checkout@v2 From d55638bb791284c3af4967a2d94b8c981d79b311 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 21:30:31 -0500 Subject: [PATCH 24/34] test2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f6b5dbb9..54c41fa4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - java: [11, 8, latest] + java: [11, 8, 14, 15ea, 16ea] steps: - uses: actions/checkout@v2 From 91d85c69f7ae9667ff7abc9c5fbfa0c4c1e050a5 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 21:42:43 -0500 Subject: [PATCH 25/34] test3 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54c41fa4..9fb2e1b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - java: [11, 8, 14, 15ea, 16ea] + java: [11, 8, 14, 15-ea, 16e-a] steps: - uses: actions/checkout@v2 From 167b30d28e8f323a2896ca429d7cf9f9e56ffc0a Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 21:43:50 -0500 Subject: [PATCH 26/34] fixtypo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fb2e1b2..fd7c87c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - java: [11, 8, 14, 15-ea, 16e-a] + java: [11, 8, 14, 15-ea, 16-ea] steps: - uses: actions/checkout@v2 From b1cf45596a3e32e8121b61b488cde0050cb22f03 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 21:45:56 -0500 Subject: [PATCH 27/34] fallback 1 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd7c87c3..9c2842fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - java: [11, 8, 14, 15-ea, 16-ea] + java: [11, 8, 14, 15-ea] steps: - uses: actions/checkout@v2 From acf32c3f2f8aa82fc3297e6e6b0c88c6d2f4d1a5 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 21:55:24 -0500 Subject: [PATCH 28/34] Use Java version maybe --- yapfa | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/yapfa b/yapfa index a0186027..1f356562 100755 --- a/yapfa +++ b/yapfa @@ -15,6 +15,8 @@ set -e source "./scripts/functions.sh" +JAVA_VERSION=`java -version 2>&1 |awk 'NR==1{ gsub(/"/,""); print $3 }'` + failed=0 case "$1" in "r" | "rb" | "rbp" | "rebuild") @@ -36,7 +38,7 @@ case "$1" in basedir $mvncmd -N install surefire-report:report cd ${FORK_NAME}-API - $mvncmd -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -e clean install surefire-report:report + $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install surefire-report:report ) || failed=1 ;; "j" | "launcher" | "jar" | "paperclip") @@ -78,7 +80,7 @@ case "$1" in basedir $mvncmd -N install surefire-report:report cd ${FORK_NAME}-API - $mvncmd -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -e clean install surefire-report:report + $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install surefire-report:report ) || failed=1 ;; "e" | "edit") From 8dcb34fe2e8021463da7f497b1a0e0e654daf357 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 22:05:44 -0500 Subject: [PATCH 29/34] fix? --- yapfa | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/yapfa b/yapfa index 1f356562..2849c229 100755 --- a/yapfa +++ b/yapfa @@ -35,16 +35,17 @@ case "$1" in ;; "b" | "bu" | "build" | "install") ( - basedir - $mvncmd -N install surefire-report:report - cd ${FORK_NAME}-API - $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install surefire-report:report + echo "$JAVA_VERSION" + basedir + $mvncmd -N install surefire-report:report + cd ${FORK_NAME}-API + $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install surefire-report:report ) || failed=1 ;; "j" | "launcher" | "jar" | "paperclip") ( - basedir - $scriptdir/installLauncher.sh "$basedir" + basedir + $scriptdir/installLauncher.sh "$basedir" ) || failed=1 ;; "u" | "up" | "upstream" | "update") @@ -73,6 +74,7 @@ case "$1" in ;; "f" | "fu" | "full" | "fullbuild") ( + echo "$JAVA_VERSION" basedir $scriptdir/updateUpstream.sh "$basedir" || exit 1 set -e @@ -80,7 +82,7 @@ case "$1" in basedir $mvncmd -N install surefire-report:report cd ${FORK_NAME}-API - $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -source $JAVA_VERSION -target $JAVA_VERSION -e clean install surefire-report:report + $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install surefire-report:report ) || failed=1 ;; "e" | "edit") From 574af2bfefe59afc89456b8b8284ea8ef4b21906 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 22:18:15 -0500 Subject: [PATCH 30/34] fixed maybe --- .github/workflows/build.yml | 6 +++++- yapfa | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c2842fc..85845014 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - java: [11, 8, 14, 15-ea] + java: [11, 8, 14] steps: - uses: actions/checkout@v2 @@ -25,6 +25,10 @@ jobs: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-maven- + - uses: s4u/maven-settings-action@v2.1.0 + name: Use ${{ matrix.java }} as the java target and source + with: + properties: '[{"maven.compiler.source": "${{ matrix.java }}"}, {"maven.compiler.target": "${{ matrix.java }}"}]' - name: Setup YAPFA Project run: | git submodule update --init --recursive -f diff --git a/yapfa b/yapfa index 2849c229..8952f927 100755 --- a/yapfa +++ b/yapfa @@ -39,7 +39,7 @@ case "$1" in basedir $mvncmd -N install surefire-report:report cd ${FORK_NAME}-API - $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install surefire-report:report + $mvncmd -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -e clean install surefire-report:report ) || failed=1 ;; "j" | "launcher" | "jar" | "paperclip") @@ -82,7 +82,7 @@ case "$1" in basedir $mvncmd -N install surefire-report:report cd ${FORK_NAME}-API - $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -source "$JAVA_VERSION" -target "$JAVA_VERSION" -e clean install surefire-report:report + $mvncmd -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -e clean install surefire-report:report ) || failed=1 ;; "e" | "edit") From 785b97355c946278e6099109f5186a07b2a11eab Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 22:25:05 -0500 Subject: [PATCH 31/34] fix artifact --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85845014..146894f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,4 +48,4 @@ jobs: uses: actions/upload-artifact@v2-preview with: name: YAPFA-${{ matrix.java }} - path: target/YAPFA-1.16.1-paperclip.jar + path: target/yapfa-1.16.1-paperclip.jar From 08f9503b24b82be72b1150838da78617f4d21788 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 22:27:33 -0500 Subject: [PATCH 32/34] update git ignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9a84b756..d4d774c4 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ mc-dev .project .idea yapfa-paperclip.jar + +target/site/surefire-report.html From f81182895ef86630f41ed68e9fdf8e538060ea16 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 16 Jul 2020 22:44:48 -0500 Subject: [PATCH 33/34] Real Fix --- .github/workflows/build.yml | 2 +- yapfa | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 146894f3..85845014 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,4 +48,4 @@ jobs: uses: actions/upload-artifact@v2-preview with: name: YAPFA-${{ matrix.java }} - path: target/yapfa-1.16.1-paperclip.jar + path: target/YAPFA-1.16.1-paperclip.jar diff --git a/yapfa b/yapfa index 8952f927..eaada59a 100755 --- a/yapfa +++ b/yapfa @@ -83,7 +83,8 @@ case "$1" in $mvncmd -N install surefire-report:report cd ${FORK_NAME}-API $mvncmd -e clean install && (cd ../Tuinity/Paper/Paper-MojangAPI && $mvncmd -e clean install) && cd ../${FORK_NAME}-Server && $mvncmd -e clean install surefire-report:report - ) || failed=1 + $scriptdir/installLauncher.sh "$basedir" || exit 1 + ) || failed=1 ;; "e" | "edit") case "$2" in From e366cd2f34ef7c9ee6ab66ad8481bf88a4c60d4b Mon Sep 17 00:00:00 2001 From: budgidiere Date: Fri, 17 Jul 2020 10:39:18 -0500 Subject: [PATCH 34/34] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85845014..4e61ea6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,9 +26,9 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-maven- - uses: s4u/maven-settings-action@v2.1.0 - name: Use ${{ matrix.java }} as the java target and source + name: Use ${{ matrix.java }} as the java target with: - properties: '[{"maven.compiler.source": "${{ matrix.java }}"}, {"maven.compiler.target": "${{ matrix.java }}"}]' + properties: '[{"maven.compiler.target": "${{ matrix.java }}"}]' - name: Setup YAPFA Project run: | git submodule update --init --recursive -f