forked from google/protobuf.dart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis.sh
executable file
·59 lines (52 loc) · 1.31 KB
/
travis.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
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Created with package:mono_repo v2.1.0
if [[ -z ${PKGS} ]]; then
echo -e '\033[31mPKGS environment variable must be set!\033[0m'
exit 1
fi
if [[ "$#" == "0" ]]; then
echo -e '\033[31mAt least one task argument must be provided!\033[0m'
exit 1
fi
EXIT_CODE=0
for PKG in ${PKGS}; do
echo -e "\033[1mPKG: ${PKG}\033[22m"
pushd "${PKG}" || exit $?
pub upgrade --no-precompile || exit $?
for TASK in "$@"; do
echo
echo -e "\033[1mPKG: ${PKG}; TASK: ${TASK}\033[22m"
case ${TASK} in
command_0)
echo './compile_protos.sh'
./compile_protos.sh || EXIT_CODE=$?
;;
command_1)
echo 'make protos'
make protos || EXIT_CODE=$?
;;
dartanalyzer_0)
echo 'dartanalyzer --fatal-warnings .'
dartanalyzer --fatal-warnings . || EXIT_CODE=$?
;;
dartanalyzer_1)
echo 'dartanalyzer --fatal-infos --fatal-warnings .'
dartanalyzer --fatal-infos --fatal-warnings . || EXIT_CODE=$?
;;
dartfmt)
echo 'dartfmt -n --set-exit-if-changed .'
dartfmt -n --set-exit-if-changed . || EXIT_CODE=$?
;;
test)
echo 'pub run test'
pub run test || EXIT_CODE=$?
;;
*)
echo -e "\033[31mNot expecting TASK '${TASK}'. Error!\033[0m"
EXIT_CODE=1
;;
esac
done
popd
done
exit ${EXIT_CODE}