mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
The current Travis script will only print offending files, but won’t fail the build. Added `--set-exit-if-changed` to fix that. Also, simplified the call from using `grep` and `xargs` to simple `flutter format .`, which recurses directories. Lastly, fixed offending files that needed `dartfmt`. (But not in the directories that aren’t covered by `travis_script.sh`.
30 lines
615 B
Bash
Executable File
30 lines
615 B
Bash
Executable File
set -e
|
|
|
|
declare -a PROJECT_NAMES=(
|
|
"jsonexample" \
|
|
"shrine" \
|
|
"provider_counter" \
|
|
"veggieseasons" \
|
|
"place_tracker" \
|
|
"platform_view_swift" \
|
|
)
|
|
|
|
for PROJECT_NAME in "${PROJECT_NAMES[@]}"
|
|
do
|
|
echo "== Testing '${PROJECT_NAME}' on Flutter's $FLUTTER_VERSION channel =="
|
|
pushd "${PROJECT_NAME}"
|
|
|
|
# Run the analyzer to find any static analysis issues.
|
|
../flutter/bin/flutter analyze
|
|
|
|
# Run the formatter on all the dart files to make sure everything's linted.
|
|
../flutter/bin/flutter format -n --set-exit-if-changed .
|
|
|
|
# Run the actual tests.
|
|
../flutter/bin/flutter test
|
|
|
|
popd
|
|
done
|
|
|
|
echo "-- Success --"
|