2020-07-04 03:03:53 +02:00
|
|
|
#!/bin/sh
|
2022-01-12 20:57:07 +01:00
|
|
|
echo "Checking BuildTools 1.18+ cache"
|
2020-07-04 03:03:53 +02:00
|
|
|
|
|
|
|
#Local Maven Repo
|
|
|
|
MAVEN_DIR="$HOME/.m2"
|
|
|
|
|
|
|
|
#CraftBukkit in local repo
|
2021-07-12 22:18:13 +02:00
|
|
|
SPIGOT="${MAVEN_DIR}/repository/org/spigotmc/spigot"
|
2020-07-04 03:03:53 +02:00
|
|
|
|
|
|
|
#Versions
|
2022-06-26 17:22:30 +02:00
|
|
|
array=("1.18.1" "1.18.2" "1.19")
|
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
|
2021-07-12 22:18:13 +02:00
|
|
|
VERSION_DIR="${SPIGOT}/${i}-R0.1-SNAPSHOT"
|
2020-07-04 03:03:53 +02:00
|
|
|
|
|
|
|
if [ -d "$VERSION_DIR" ]; then
|
2021-07-12 22:18:13 +02:00
|
|
|
echo "Spigot version ${i} is cached in ${VERSION_DIR}!"
|
2020-07-06 12:19:51 +02:00
|
|
|
echo "Checking for latest commit! "
|
2021-07-12 22:18:13 +02:00
|
|
|
java -jar BuildTools.jar --rev ${i} --compile-if-changed --remapped > /dev/null 2>&1
|
2020-07-06 12:19:51 +02:00
|
|
|
echo "Finished Check."
|
2020-07-04 03:03:53 +02:00
|
|
|
else
|
2021-07-12 22:18:13 +02:00
|
|
|
echo "Spigot version ${i} isn't cached!"
|
2020-07-04 03:03:53 +02:00
|
|
|
echo "Running BuildTools!"
|
2021-07-12 22:18:13 +02:00
|
|
|
java -jar BuildTools.jar --rev ${i} --remapped > /dev/null 2>&1
|
|
|
|
echo "Compiled Spigot ${i} in ${VERSION_DIR}"
|
2020-07-04 03:03:53 +02:00
|
|
|
fi
|
|
|
|
done
|