mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
extracted copy and pasted function across module ci scripts (#760)
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
DIR="${BASH_SOURCE%/*}"
|
||||||
|
source "$DIR/flutter_ci_script_shared.sh"
|
||||||
|
|
||||||
declare -ar PROJECT_NAMES=(
|
declare -ar PROJECT_NAMES=(
|
||||||
"add_to_app/fullscreen/flutter_module"
|
"add_to_app/fullscreen/flutter_module"
|
||||||
"add_to_app/prebuilt_module/flutter_module"
|
"add_to_app/prebuilt_module/flutter_module"
|
||||||
@@ -30,31 +33,6 @@ declare -ar PROJECT_NAMES=(
|
|||||||
"experimental/web_dashboard"
|
"experimental/web_dashboard"
|
||||||
)
|
)
|
||||||
|
|
||||||
for PROJECT_NAME in "${PROJECT_NAMES[@]}"
|
ci_projects "beta" "${PROJECT_NAMES[@]}"
|
||||||
do
|
|
||||||
echo "== Testing '${PROJECT_NAME}' on Flutter's beta channel =="
|
|
||||||
pushd "${PROJECT_NAME}"
|
|
||||||
|
|
||||||
# Grab packages.
|
|
||||||
flutter pub get
|
|
||||||
|
|
||||||
# Run the analyzer to find any static analysis issues.
|
|
||||||
flutter analyze
|
|
||||||
|
|
||||||
# Reformat the web plugin registrant, if necessary.
|
|
||||||
if [ -f "lib/generated_plugin_registrant.dart" ]
|
|
||||||
then
|
|
||||||
echo "Renaming $(pwd)/lib/generated_plugin_registrant.dart"
|
|
||||||
flutter format "lib/generated_plugin_registrant.dart"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run the formatter on all the dart files to make sure everything's linted.
|
|
||||||
flutter format -n --set-exit-if-changed .
|
|
||||||
|
|
||||||
# Run the actual tests.
|
|
||||||
flutter test
|
|
||||||
|
|
||||||
popd
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "-- Success --"
|
echo "-- Success --"
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
DIR="${BASH_SOURCE%/*}"
|
||||||
|
source "$DIR/flutter_ci_script_shared.sh"
|
||||||
|
|
||||||
declare -ar PROJECT_NAMES=(
|
declare -ar PROJECT_NAMES=(
|
||||||
"add_to_app/fullscreen/flutter_module"
|
"add_to_app/fullscreen/flutter_module"
|
||||||
"add_to_app/prebuilt_module/flutter_module"
|
"add_to_app/prebuilt_module/flutter_module"
|
||||||
@@ -29,34 +32,6 @@ declare -ar PROJECT_NAMES=(
|
|||||||
"experimental/web_dashboard"
|
"experimental/web_dashboard"
|
||||||
)
|
)
|
||||||
|
|
||||||
for PROJECT_NAME in "${PROJECT_NAMES[@]}"
|
ci_projects "dev" "${PROJECT_NAMES[@]}"
|
||||||
do
|
|
||||||
echo "== Testing '${PROJECT_NAME}' on Flutter's dev channel =="
|
|
||||||
pushd "${PROJECT_NAME}"
|
|
||||||
|
|
||||||
# Grab packages.
|
|
||||||
flutter pub get
|
|
||||||
|
|
||||||
# Run the analyzer to find any static analysis issues.
|
|
||||||
flutter analyze
|
|
||||||
|
|
||||||
# Reformat the web plugin registrant, if necessary.
|
|
||||||
if [ -f "lib/generated_plugin_registrant.dart" ]
|
|
||||||
then
|
|
||||||
echo "Renaming $(pwd)/lib/generated_plugin_registrant.dart"
|
|
||||||
flutter format "lib/generated_plugin_registrant.dart"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run the formatter on all the dart files to make sure everything's linted.
|
|
||||||
flutter format -n --set-exit-if-changed .
|
|
||||||
|
|
||||||
# Run the actual tests.
|
|
||||||
if [ -d "test"]
|
|
||||||
then
|
|
||||||
flutter test
|
|
||||||
fi
|
|
||||||
|
|
||||||
popd
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "-- Success --"
|
echo "-- Success --"
|
||||||
|
|||||||
34
tool/flutter_ci_script_shared.sh
Normal file
34
tool/flutter_ci_script_shared.sh
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
function ci_projects () {
|
||||||
|
local channel="$1"
|
||||||
|
shift
|
||||||
|
local arr=("$@")
|
||||||
|
for PROJECT_NAME in "${arr[@]}"
|
||||||
|
do
|
||||||
|
echo "== Testing '${PROJECT_NAME}' on Flutter's $channel channel =="
|
||||||
|
pushd "${PROJECT_NAME}"
|
||||||
|
|
||||||
|
# Grab packages.
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
|
# Run the analyzer to find any static analysis issues.
|
||||||
|
flutter analyze
|
||||||
|
|
||||||
|
# Reformat the web plugin registrant, if necessary.
|
||||||
|
if [ -f "lib/generated_plugin_registrant.dart" ]
|
||||||
|
then
|
||||||
|
echo "Renaming $(pwd)/lib/generated_plugin_registrant.dart"
|
||||||
|
flutter format "lib/generated_plugin_registrant.dart"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run the formatter on all the dart files to make sure everything's linted.
|
||||||
|
flutter format -n --set-exit-if-changed .
|
||||||
|
|
||||||
|
# Run the actual tests.
|
||||||
|
if [ -d "test"]
|
||||||
|
then
|
||||||
|
flutter test
|
||||||
|
fi
|
||||||
|
|
||||||
|
popd
|
||||||
|
done
|
||||||
|
}
|
||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
DIR="${BASH_SOURCE%/*}"
|
||||||
|
source "$DIR/flutter_ci_script_shared.sh"
|
||||||
|
|
||||||
declare -ar PROJECT_NAMES=(
|
declare -ar PROJECT_NAMES=(
|
||||||
"add_to_app/fullscreen/flutter_module"
|
"add_to_app/fullscreen/flutter_module"
|
||||||
"add_to_app/prebuilt_module/flutter_module"
|
"add_to_app/prebuilt_module/flutter_module"
|
||||||
@@ -30,31 +33,6 @@ declare -ar PROJECT_NAMES=(
|
|||||||
"experimental/web_dashboard"
|
"experimental/web_dashboard"
|
||||||
)
|
)
|
||||||
|
|
||||||
for PROJECT_NAME in "${PROJECT_NAMES[@]}"
|
ci_projects "stable" "${PROJECT_NAMES[@]}"
|
||||||
do
|
|
||||||
echo "== Testing '${PROJECT_NAME}' on Flutter's stable channel =="
|
|
||||||
pushd "${PROJECT_NAME}"
|
|
||||||
|
|
||||||
# Grab packages.
|
|
||||||
flutter pub get
|
|
||||||
|
|
||||||
# Run the analyzer to find any static analysis issues.
|
|
||||||
flutter analyze
|
|
||||||
|
|
||||||
# Reformat the web plugin registrant, if necessary.
|
|
||||||
if [ -f "lib/generated_plugin_registrant.dart" ]
|
|
||||||
then
|
|
||||||
echo "Renaming $(pwd)/lib/generated_plugin_registrant.dart"
|
|
||||||
flutter format "lib/generated_plugin_registrant.dart"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run the formatter on all the dart files to make sure everything's linted.
|
|
||||||
flutter format -n --set-exit-if-changed .
|
|
||||||
|
|
||||||
# Run the actual tests.
|
|
||||||
flutter test
|
|
||||||
|
|
||||||
popd
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "-- Success --"
|
echo "-- Success --"
|
||||||
|
|||||||
Reference in New Issue
Block a user