2020-07-04 03:03:53 +02:00
|
|
|
#!/bin/sh
|
2021-07-12 22:13:13 +02:00
|
|
|
echo "Checking BuildTools pre-1.17 cache"
|
2020-07-04 03:03:53 +02:00
|
|
|
|
|
|
|
#Local Maven Repo
|
|
|
|
MAVEN_DIR="$HOME/.m2"
|
|
|
|
|
|
|
|
#CraftBukkit in local repo
|
|
|
|
CRAFTBUKKIT="${MAVEN_DIR}/repository/org/bukkit/craftbukkit"
|
|
|
|
|
|
|
|
#Versions
|
2021-02-15 21:00:13 +01:00
|
|
|
array=("1.16.5" "1.16.4" "1.16.3" "1.16.1" "1.15.2" "1.14.4")
|
2020-07-04 03:03:53 +02:00
|
|
|
|
2020-07-04 18:58:58 +02:00
|
|
|
#Download BuildTools jar
|
|
|
|
curl -s -o BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
|
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
|
2020-07-04 15:45:58 +02:00
|
|
|
echo "CraftBukkit version ${i} is cached!"
|
2020-07-06 12:19:51 +02:00
|
|
|
echo "Checking for latest commit! "
|
|
|
|
java -jar BuildTools.jar --rev ${i} --compile craftbukkit --compile-if-changed > /dev/null 2>&1
|
|
|
|
echo "Finished Check."
|
2020-07-04 03:03:53 +02:00
|
|
|
else
|
2020-07-04 15:45:58 +02:00
|
|
|
echo "CraftBukkit version ${i} isn't cached!"
|
2020-07-04 03:03:53 +02:00
|
|
|
echo "Running BuildTools!"
|
2020-07-06 12:19:51 +02:00
|
|
|
java -jar BuildTools.jar --rev ${i} --compile craftbukkit > /dev/null 2>&1
|
2020-07-04 03:03:53 +02:00
|
|
|
echo "Compiled CraftBukkit ${i}"
|
|
|
|
fi
|
|
|
|
done
|