forked from firebase/flutterfire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_all_plugins_app.sh
executable file
·44 lines (35 loc) · 1.34 KB
/
build_all_plugins_app.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
#!/bin/bash
# This script builds the app in flutter/plugins/example/all_plugins to make
# sure all first party plugins can be compiled together.
# So that users can run this script from anywhere and it will work as expected.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
REPO_DIR="$(dirname "$SCRIPT_DIR")"
source "$SCRIPT_DIR/common.sh"
check_changed_packages > /dev/null
cd $REPO_DIR/examples/all_plugins
flutter clean > /dev/null
(cd "$REPO_DIR" && pub global run flutter_plugin_tools gen-pubspec --exclude firebase_core,firebase_ml_vision)
function error() {
echo "$@" 1>&2
}
failures=0
for version in "debug" "release"; do
(flutter build $@ --$version > /dev/null)
if [ $? -eq 0 ]; then
echo "Successfully built $version all_plugins app."
echo "All first party plugins compile together."
else
error "Failed to build $version all_plugins app."
if [[ "${#CHANGED_PACKAGE_LIST[@]}" == 0 ]]; then
error "There was a failure to compile all first party plugins together, but there were no changes detected in packages."
else
error "Changes to the following packages may prevent all first party plugins from compiling together:"
for package in "${CHANGED_PACKAGE_LIST[@]}"; do
error "$package"
done
echo ""
fi
failures=$(($failures + 1))
fi
done
exit $failures