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-Server" Paper-Server HEAD
cd "$basedir"
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
# 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"
fi
) || (

View File

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

View File

@ -11,9 +11,10 @@ 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"
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
decompiledir="$workdir/Minecraft/$minecraftversion-$revision/forge"
# replace for now
decompiledir="$workdir/Minecraft/$minecraftversion/spigot"
decompiledir="$workdir/Minecraft/$minecraftversion-$revision/spigot"
export importedmcdev=""
function import {
export importedmcdev="$importedmcdev $1"
@ -41,7 +42,7 @@ function importLibrary {
target="$workdir/Spigot/Spigot-Server/src/main/java/${file}"
targetdir=$(dirname "$target")
mkdir -p "${targetdir}"
base="$workdir/Minecraft/$minecraftversion/libraries/${group}/${lib}/$file"
base="$workdir/Minecraft/$minecraftversion-$revision/libraries/${group}/${lib}/$file"
if [ ! -f "$base" ]; then
echo "Missing $base"
exit 1

View File

@ -5,8 +5,9 @@ set -e
PS1="$"
basedir="$(cd "$1" && pwd -P)"
workdir="$basedir/work"
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
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"
cb="src/main/java"
gitcmd="git -c commit.gpgsign=false"

View File

@ -7,8 +7,9 @@ PS1="$"
basedir="$(cd "$1" && pwd -P)"
cd "$basedir"
workdir="$basedir/work"
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
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"
papernms="Paper-Server/src/main/java/net/minecraft/server"
mcdevsrc="${decompiledir}/src/net/minecraft/server"

View File

@ -4,9 +4,10 @@
set -e
basedir="$(cd "$1" && pwd -P)"
workdir="$basedir/work"
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
mcver=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
paperjar="$basedir/Paper-Server/target/paper-$mcver.jar"
vanillajar="$workdir/Minecraft/$mcver/$mcver.jar"
vanillajar="$workdir/Minecraft/$mcver-$revision/$mcver.jar"
(
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)
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)
decompiledir="$workdir/Minecraft/$minecraftversion"
decompiledir="$workdir/Minecraft/$minecraftversion-$revision"
jarpath="$decompiledir/$minecraftversion"
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
echo "Applying class mappings..."
if [ ! -f "$jarpath-$revision-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
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-cl.jar" 1>/dev/null
if [ "$?" != "0" ]; then
echo "Failed to apply class mappings."
exit 1
@ -55,8 +55,8 @@ if [ ! -f "$jarpath-$revision-cl.jar" ]; then
fi
echo "Applying member mappings..."
if [ ! -f "$jarpath-$revision-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
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-cl.jar" -m "$membermappings" -o "$jarpath-m.jar" 1>/dev/null
if [ "$?" != "0" ]; then
echo "Failed to apply member mappings."
exit 1
@ -64,8 +64,8 @@ if [ ! -f "$jarpath-$revision-m.jar" ]; then
fi
echo "Creating remapped jar..."
if [ ! -f "$jarpath-$revision-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
if [ ! -f "$jarpath-mapped.jar" ]; then
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
echo "Failed to create remapped jar."
exit 1
@ -74,7 +74,7 @@ fi
echo "Installing remapped jar..."
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
echo "Failed to install remapped jar."
exit 1