-
Notifications
You must be signed in to change notification settings - Fork 0
/
runall
executable file
·61 lines (49 loc) · 1.23 KB
/
runall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
function detectos()
{
myname="$(uname -s)"
case "${myname}" in
Linux*) ostype="linux";;
Darwin*) ostype="macos";;
CYGWIN*) ostype="windows";;
*) ostype="unknown";;
esac
}
function initwin()
{
export JAVA_HOME="C:/users/public/wpilib/2021/jdk"
echo "initialzing for windows"
}
function initmacos()
{
echo "initialzing for macos"
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home"
}
function initlinux()
{
echo "initialzing for linux"
export JAVA_HOME=~/wpilib/2021/jdk
}
echo -n "Cleaning the build to ensure a fresh build ... "
./gradlew --console=plain clean > /dev/null 2>&1
echo done
tmpfile=$(mktemp -dt "$(basename $0).XXXXXXXXXX")
echo -n "Building robot code ... "
./gradlew --console=plain build > $tmpfile/out 2>&1
if [ $? -ne 0 ]; then
echo FAILED
echo
echo
cat $tmpfile/out
echo
echo
echo ==========================================================================
echo "The build of the robot code failed, therefore the simulation tests were skipped."
echo "Please fix the build errors and run this script again"
rm -rf $tmpfile
exit 1
fi
echo build complete and all unit tests passed.
echo
echo
./runtests