ChestsPlusPlus/BuildTools/build.sh

30 lines
755 B
Bash
Raw Normal View History

2020-07-04 03:03:53 +02:00
#!/bin/sh
echo "Checking BuildTools cache"
#Download BuildTools jar
2020-07-04 03:03:53 +02:00
curl -o BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
#Local Maven Repo
MAVEN_DIR="$HOME/.m2"
#CraftBukkit in local repo
CRAFTBUKKIT="${MAVEN_DIR}/repository/org/bukkit/craftbukkit"
#Versions
array=("1.16.1" "1.15.2" "1.14.4")
2020-07-04 03:03:53 +02:00
for i in "${array[@]}"
do
VERSION_DIR="${CRAFTBUKKIT}/${i}-R0.1-SNAPSHOT"
if [ -d "$VERSION_DIR" ]; then
echo "CraftBukkit version ${i} is cached!"
2020-07-04 03:03:53 +02:00
else
echo "CraftBukkit version ${i} isn't cached!"
2020-07-04 03:03:53 +02:00
echo "Running BuildTools!"
java -jar BuildTools.jar --rev ${i} --compile craftbukkit | awk 'NR <= 3'
2020-07-04 03:03:53 +02:00
echo "Compiled CraftBukkit ${i}"
fi
done