Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
/jars | ||
/out | ||
.idea/ | ||
.buildtools/ | ||
*.iml | ||
*.classpath | ||
*.project | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,9 @@ | ||
language: java | ||
|
||
branches: | ||
only: | ||
- 2.x | ||
- 1.13 | ||
|
||
cache: | ||
directories: | ||
- .buildtools | ||
- $HOME/.m2 | ||
|
||
before_install: | ||
- mkdir -p .buildtools | ||
- cd .buildtools | ||
- wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar | ||
- rm -r work/ | ||
- java -jar BuildTools.jar --rev 1.8 | ||
- java -jar BuildTools.jar --rev 1.8.3 | ||
- cd .. | ||
- scripts/buildtools.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
mkdir -p .buildtools | ||
pushd .buildtools | ||
|
||
is_installed() { | ||
mvn dependency:get -q -Dartifact=$1 -DremoteRepositories=file://$HOME/.m2/repository 1>/dev/null 2>&1 | ||
return $? | ||
} | ||
|
||
ensure_buildtools() { | ||
if [ ! -f "BuildTools.jar" ]; then | ||
echo "Downloading BuildTools..." | ||
wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar | ||
fi | ||
} | ||
|
||
run_buildtools() { | ||
ensure_buildtools | ||
java -jar BuildTools.jar --rev $1 | ||
if [ $? -ne 0 ]; then | ||
echo "Running BuildTools for CB $1 failed! Aborting." | ||
popd | ||
exit 255 | ||
else | ||
echo "Successfully built version $1" | ||
fi | ||
} | ||
|
||
# Check CB 1.8 | ||
is_installed org.bukkit:craftbukkit:1.8-R0.1-SNAPSHOT | ||
is_18=$? # 0 = present, 1 = not present | ||
|
||
# Check CB 1.8.3 | ||
is_installed org.bukkit:craftbukkit:1.8.3-R0.1-SNAPSHOT | ||
is_183=$? | ||
|
||
if [ $is_18 -ne 0 ]; then | ||
echo "Installing CraftBukkit 1.8..." | ||
run_buildtools 1.8 | ||
else | ||
echo "CraftBukkit 1.8 installed; skipping BuildTools..." | ||
fi | ||
|
||
if [ $is_183 -ne 0 ]; then | ||
echo "Installing CraftBukkit 1.8.3..." | ||
run_buildtools 1.8.3 | ||
else | ||
echo "CraftBukkit 1.8.3 installed; skipping BuildTools..." | ||
fi | ||
|
||
popd |