Use revision file

This commit is contained in:
Mariell Hoversholm 2021-03-16 17:35:55 +01:00
parent 6ea816d217
commit dc29362b55
3 changed files with 13 additions and 9 deletions

1
revision.txt Normal file
View file

@ -0,0 +1 @@
R0.2

View file

@ -5,6 +5,7 @@ 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)
windows="$([[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]] && echo "true" || echo "false")"
decompiledir="$workdir/Minecraft/$minecraftversion"
@ -73,7 +74,7 @@ if [ ! -d "$classdir" ]; then
mkdir -p "$classdir"
cd "$classdir"
set +e
jar xf "$decompiledir/$minecraftversion-mapped.jar" net/minecraft
jar xf "$decompiledir/$minecraftversion-$revision-mapped.jar" net/minecraft
if [ "$?" != "0" ]; then
cd "$basedir"
echo "Failed to extract NMS classes."

View file

@ -5,7 +5,8 @@ set -e
PS1="$"
basedir="$(cd "$1" && pwd -P)"
workdir="$basedir/work"
minecraftversion="$(cat "${workdir}/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)"-R0.2
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
minecraftversion="$(cat "${workdir}/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)"
minecraftserverurl=$(cat "${workdir}/BuildData/info.json" | grep serverUrl | cut -d '"' -f 4)
minecrafthash=$(cat "${workdir}/BuildData/info.json" | grep minecraftHash | cut -d '"' -f 4)
accesstransforms="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep accessTransforms | cut -d '"' -f 4)
@ -43,9 +44,10 @@ if [ "$checksum" != "$minecrafthash" ]; then
exit 1
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-cl.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --auto-lvt BASIC --auto-member SYNTHETIC -i "$jarpath.jar" -m "$classmappings" -o "$jarpath-cl.jar" 1>/dev/null
if [ ! -f "$jarpath-$revision-cl.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --only com/minecraft/math --auto-lvt BASIC --auto-member SYNTHETIC -i "$jarpath.jar" -m "$classmappings" -o "$jarpath-$revision-cl.jar" 1>/dev/null
if [ "$?" != "0" ]; then
echo "Failed to apply class mappings."
exit 1
@ -53,8 +55,8 @@ if [ ! -f "$jarpath-cl.jar" ]; then
fi
echo "Applying member mappings..."
if [ ! -f "$jarpath-m.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --auto-member LOGGER --auto-member TOKENS -i "$jarpath-cl.jar" -m "$membermappings" -o "$jarpath-m.jar" 1>/dev/null
if [ ! -f "$jarpath-$revision-m.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --only com/minecraft/math --auto-member LOGGER --auto-member TOKENS -i "$jarpath-$revision-cl.jar" -m "$membermappings" -o "$jarpath-$revision-m.jar" 1>/dev/null
if [ "$?" != "0" ]; then
echo "Failed to apply member mappings."
exit 1
@ -62,8 +64,8 @@ if [ ! -f "$jarpath-m.jar" ]; then
fi
echo "Creating remapped jar..."
if [ ! -f "$jarpath-mapped.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource.jar" --only . --only net/minecraft -i "$jarpath-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-mapped.jar" 1>/dev/null
if [ ! -f "$jarpath-$revision-mapped.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource.jar" --only . --only net/minecraft --only com/minecraft/math -i "$jarpath-$revision-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-$revision-mapped.jar" 1>/dev/null
if [ "$?" != "0" ]; then
echo "Failed to create remapped jar."
exit 1
@ -72,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-mapped.jar" -Dpackaging=jar -DgroupId=io.papermc -DartifactId=minecraft-server -Dversion="$minecraftversion-SNAPSHOT"
mvn install:install-file -q -Dfile="$jarpath-$revision-mapped.jar" -Dpackaging=jar -DgroupId=io.papermc -DartifactId=minecraft-server -Dversion="$minecraftversion-$revision-SNAPSHOT"
if [ "$?" != "0" ]; then
echo "Failed to install remapped jar."
exit 1