gfan | c351bd0 | 2018-06-11 11:25:36 -0700 | [diff] [blame] | 1 | # Configurations: |
| 2 | # temp file name to hold build result |
| 3 | BUILD_RESULT_FILE=build_result.txt |
| 4 | |
| 5 | # Repo root directory |
| 6 | REPO_ROOT_DIR=. |
| 7 | |
| 8 | |
| 9 | declare projects=( |
| 10 | samples |
| 11 | ) |
| 12 | |
| 13 | for d in "${projects[@]}"; do |
| 14 | pushd ${REPO_ROOT_DIR}/${d} >/dev/null |
| 15 | TERM=dumb ./gradlew -q clean assembleDebug |
| 16 | popd >/dev/null |
| 17 | done |
| 18 | |
| 19 | |
| 20 | # Check the apks that all get built fine |
gfan | c351bd0 | 2018-06-11 11:25:36 -0700 | [diff] [blame] | 21 | declare apks=( |
| 22 | samples/hello-oboe/build/outputs/apk/debug/hello-oboe-debug.apk |
| 23 | samples/MegaDrone/build/outputs/apk/debug/MegaDrone-debug.apk |
| 24 | samples/RhythmGame/build/outputs/apk/debug/RhythmGame-debug.apk |
gerry | 40aa2e7 | 2018-06-15 14:01:51 -0700 | [diff] [blame] | 25 | samples/LiveEffect/build/outputs/apk/debug/LiveEffect-debug.apk |
gfan | c351bd0 | 2018-06-11 11:25:36 -0700 | [diff] [blame] | 26 | ) |
| 27 | |
| 28 | rm -fr ${BUILD_RESULT_FILE} |
| 29 | for apk in "${apks[@]}"; do |
| 30 | if [ ! -f ${REPO_ROOT_DIR}/${apk} ]; then |
| 31 | export SAMPLE_CI_RESULT=1 |
| 32 | echo ${apk} does not build >> ${BUILD_RESULT_FILE} |
| 33 | fi |
| 34 | done |
| 35 | |
| 36 | if [ -f ${BUILD_RESULT_FILE} ]; then |
| 37 | echo "******* Failed Builds ********:" |
| 38 | cat ${BUILD_RESULT_FILE} |
| 39 | else |
| 40 | echo "======= BUILD SUCCESS =======" |
| 41 | fi |
| 42 | |
| 43 | rm -fr ${BUILD_RESULT_FILE} |