Rename work dir

This commit is contained in:
Mariell Hoversholm 2021-03-16 18:30:17 +01:00
parent c8d844ab71
commit ba1031ca7c
7 changed files with 23 additions and 18 deletions

View file

@ -97,9 +97,10 @@ echo "Importing MC Dev"
applyPatch "work/Spigot/Spigot-API" Paper-API HEAD && applyPatch "work/Spigot/Spigot-API" Paper-API HEAD &&
applyPatch "work/Spigot/Spigot-Server" Paper-Server HEAD applyPatch "work/Spigot/Spigot-Server" Paper-Server HEAD
cd "$basedir" cd "$basedir"
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
# if we have previously ran ./paper mcdev, update it # if we have previously ran ./paper mcdev, update it
if [ -d "$workdir/Minecraft/$minecraftversion/src" ]; then if [ -d "$workdir/Minecraft/$minecraftversion-$revision/src" ]; then
./scripts/makemcdevsrc.sh "$basedir" ./scripts/makemcdevsrc.sh "$basedir"
fi fi
) || ( ) || (

View file

@ -8,7 +8,7 @@ workdir="$basedir/work"
revision="$(cat "$basedir"/revision.txt | tr -d '\n')" revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
windows="$([[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]] && echo "true" || echo "false")" windows="$([[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]] && echo "true" || echo "false")"
decompiledir="$workdir/Minecraft/$minecraftversion" decompiledir="$workdir/Minecraft/$minecraftversion-$revision"
spigotdecompiledir="$decompiledir/spigot" spigotdecompiledir="$decompiledir/spigot"
forgedecompiledir="$decompiledir/forge" forgedecompiledir="$decompiledir/forge"
forgeflowerversion="1.5.380.19" forgeflowerversion="1.5.380.19"
@ -21,7 +21,7 @@ forgefloweroptions="-dgs=1 -hdc=0 -asc=1 -udv=1 -jvn=1"
forgeflowercachefile="$decompiledir/forgeflowercache" forgeflowercachefile="$decompiledir/forgeflowercache"
forgeflowercachevalue="$forgeflowerurl - $forgeflowerversion - $forgefloweroptions"; forgeflowercachevalue="$forgeflowerurl - $forgeflowerversion - $forgefloweroptions";
classdir="$decompiledir/classes" classdir="$decompiledir/classes"
versionjson="$workdir/Minecraft/$minecraftversion/$minecraftversion.json" versionjson="$workdir/Minecraft/$minecraftversion-$revision/$minecraftversion.json"
if [[ ! -f "$versionjson" ]]; then if [[ ! -f "$versionjson" ]]; then
echo "Downloading $minecraftversion JSON Data" echo "Downloading $minecraftversion JSON Data"
@ -74,7 +74,7 @@ if [ ! -d "$classdir" ]; then
mkdir -p "$classdir" mkdir -p "$classdir"
cd "$classdir" cd "$classdir"
set +e set +e
jar xf "$decompiledir/$minecraftversion-$revision-mapped.jar" net/minecraft jar xf "$decompiledir/$minecraftversion-mapped.jar" net/minecraft
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
cd "$basedir" cd "$basedir"
echo "Failed to extract NMS classes." echo "Failed to extract NMS classes."

View file

@ -11,9 +11,10 @@ gitcmd="git -c commit.gpgsign=false"
workdir="$basedir/work" workdir="$basedir/work"
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
decompiledir="$workdir/Minecraft/$minecraftversion/forge" revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
decompiledir="$workdir/Minecraft/$minecraftversion-$revision/forge"
# replace for now # replace for now
decompiledir="$workdir/Minecraft/$minecraftversion/spigot" decompiledir="$workdir/Minecraft/$minecraftversion-$revision/spigot"
export importedmcdev="" export importedmcdev=""
function import { function import {
export importedmcdev="$importedmcdev $1" export importedmcdev="$importedmcdev $1"
@ -41,7 +42,7 @@ function importLibrary {
target="$workdir/Spigot/Spigot-Server/src/main/java/${file}" target="$workdir/Spigot/Spigot-Server/src/main/java/${file}"
targetdir=$(dirname "$target") targetdir=$(dirname "$target")
mkdir -p "${targetdir}" mkdir -p "${targetdir}"
base="$workdir/Minecraft/$minecraftversion/libraries/${group}/${lib}/$file" base="$workdir/Minecraft/$minecraftversion-$revision/libraries/${group}/${lib}/$file"
if [ ! -f "$base" ]; then if [ ! -f "$base" ]; then
echo "Missing $base" echo "Missing $base"
exit 1 exit 1

View file

@ -5,8 +5,9 @@ set -e
PS1="$" PS1="$"
basedir="$(cd "$1" && pwd -P)" basedir="$(cd "$1" && pwd -P)"
workdir="$basedir/work" workdir="$basedir/work"
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
spigotdecompiledir="$workdir/Minecraft/$minecraftversion/spigot" spigotdecompiledir="$workdir/Minecraft/$minecraftversion-$revision/spigot"
nms="$spigotdecompiledir" nms="$spigotdecompiledir"
cb="src/main/java" cb="src/main/java"
gitcmd="git -c commit.gpgsign=false" gitcmd="git -c commit.gpgsign=false"

View file

@ -7,8 +7,9 @@ PS1="$"
basedir="$(cd "$1" && pwd -P)" basedir="$(cd "$1" && pwd -P)"
cd "$basedir" cd "$basedir"
workdir="$basedir/work" workdir="$basedir/work"
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
decompiledir="$workdir/Minecraft/$minecraftversion" decompiledir="$workdir/Minecraft/$minecraftversion-$revision"
nms="$decompiledir/spigot/net/minecraft/server" nms="$decompiledir/spigot/net/minecraft/server"
papernms="Paper-Server/src/main/java/net/minecraft/server" papernms="Paper-Server/src/main/java/net/minecraft/server"
mcdevsrc="${decompiledir}/src/net/minecraft/server" mcdevsrc="${decompiledir}/src/net/minecraft/server"

View file

@ -4,9 +4,10 @@
set -e set -e
basedir="$(cd "$1" && pwd -P)" basedir="$(cd "$1" && pwd -P)"
workdir="$basedir/work" workdir="$basedir/work"
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
mcver=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4) mcver=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
paperjar="$basedir/Paper-Server/target/paper-$mcver.jar" paperjar="$basedir/Paper-Server/target/paper-$mcver.jar"
vanillajar="$workdir/Minecraft/$mcver/$mcver.jar" vanillajar="$workdir/Minecraft/$mcver-$revision/$mcver.jar"
( (
cd "$workdir/Paperclip" cd "$workdir/Paperclip"

View file

@ -13,7 +13,7 @@ accesstransforms="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.
classmappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep classMappings | cut -d '"' -f 4) classmappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep classMappings | cut -d '"' -f 4)
membermappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep memberMappings | cut -d '"' -f 4) membermappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep memberMappings | cut -d '"' -f 4)
packagemappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep packageMappings | cut -d '"' -f 4) packagemappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep packageMappings | cut -d '"' -f 4)
decompiledir="$workdir/Minecraft/$minecraftversion" decompiledir="$workdir/Minecraft/$minecraftversion-$revision"
jarpath="$decompiledir/$minecraftversion" jarpath="$decompiledir/$minecraftversion"
mkdir -p "$decompiledir" mkdir -p "$decompiledir"
@ -46,8 +46,8 @@ fi
# These specialsource commands are from https://hub.spigotmc.org/stash/projects/SPIGOT/repos/builddata/browse/info.json # These specialsource commands are from https://hub.spigotmc.org/stash/projects/SPIGOT/repos/builddata/browse/info.json
echo "Applying class mappings..." echo "Applying class mappings..."
if [ ! -f "$jarpath-$revision-cl.jar" ]; then if [ ! -f "$jarpath-cl.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --only com/mojang/math --auto-lvt BASIC --auto-member SYNTHETIC -i "$jarpath.jar" -m "$classmappings" -o "$jarpath-$revision-cl.jar" 1>/dev/null java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --only com/mojang/math --auto-lvt BASIC --auto-member SYNTHETIC -i "$jarpath.jar" -m "$classmappings" -o "$jarpath-cl.jar" 1>/dev/null
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
echo "Failed to apply class mappings." echo "Failed to apply class mappings."
exit 1 exit 1
@ -55,8 +55,8 @@ if [ ! -f "$jarpath-$revision-cl.jar" ]; then
fi fi
echo "Applying member mappings..." echo "Applying member mappings..."
if [ ! -f "$jarpath-$revision-m.jar" ]; then if [ ! -f "$jarpath-m.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --only com/mojang/math --auto-member LOGGER --auto-member TOKENS -i "$jarpath-$revision-cl.jar" -m "$membermappings" -o "$jarpath-$revision-m.jar" 1>/dev/null java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --only com/mojang/math --auto-member LOGGER --auto-member TOKENS -i "$jarpath-cl.jar" -m "$membermappings" -o "$jarpath-m.jar" 1>/dev/null
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
echo "Failed to apply member mappings." echo "Failed to apply member mappings."
exit 1 exit 1
@ -64,8 +64,8 @@ if [ ! -f "$jarpath-$revision-m.jar" ]; then
fi fi
echo "Creating remapped jar..." echo "Creating remapped jar..."
if [ ! -f "$jarpath-$revision-mapped.jar" ]; then if [ ! -f "$jarpath-mapped.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource.jar" --only . --only net/minecraft --only com/mojang/math -i "$jarpath-$revision-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-$revision-mapped.jar" 1>/dev/null java -jar "$workdir/BuildData/bin/SpecialSource.jar" --only . --only net/minecraft --only com/mojang/math -i "$jarpath-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-mapped.jar" 1>/dev/null
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
echo "Failed to create remapped jar." echo "Failed to create remapped jar."
exit 1 exit 1
@ -74,7 +74,7 @@ fi
echo "Installing remapped jar..." echo "Installing remapped jar..."
cd "$workdir/CraftBukkit" # Need to be in a directory with a valid POM at the time of install. cd "$workdir/CraftBukkit" # Need to be in a directory with a valid POM at the time of install.
mvn install:install-file -q -Dfile="$jarpath-$revision-mapped.jar" -Dpackaging=jar -DgroupId=io.papermc -DartifactId=minecraft-server -Dversion="$minecraftversion-$revision-SNAPSHOT" mvn install:install-file -q -Dfile="$jarpath-mapped.jar" -Dpackaging=jar -DgroupId=io.papermc -DartifactId=minecraft-server -Dversion="$minecraftversion-SNAPSHOT"
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
echo "Failed to install remapped jar." echo "Failed to install remapped jar."
exit 1 exit 1