forked from gpc/fields
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-build.sh
executable file
·48 lines (34 loc) · 1.11 KB
/
travis-build.sh
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
#!/bin/bash
set -e
chmod +x ./travis/*.sh
EXIT_STATUS=0
echo "Test for branch $TRAVIS_BRANCH JDK: $TRAVIS_JDK_VERSION"
./gradlew test --no-daemon || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "test failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "Assemble for branch $TRAVIS_BRANCH JDK: $TRAVIS_JDK_VERSION"
./gradlew assemble --no-daemon || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
echo "assemble failed => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
if [ "${TRAVIS_JDK_VERSION}" == "openjdk11" ] ; then
echo "JDK 11 => exit $EXIT_STATUS"
exit $EXIT_STATUS
fi
filename=$(find build/libs -name "*.jar" | head -1)
filename=$(basename "$filename")
echo "Publishing archives for branch $TRAVIS_BRANCH JDK: $TRAVIS_JDK_VERSION"
if [[ -n $TRAVIS_TAG ]] || [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
echo "Publishing archives"
if [[ -n $TRAVIS_TAG ]]; then
./gradlew bintrayUpload --no-daemon || EXIT_STATUS=$?
else
./gradlew publish --no-daemon || EXIT_STATUS=$?
fi
./gradlew docs || EXIT_STATUS=$?
./travis/publish_docs.sh
fi
exit $EXIT_STATUS