mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-28 23:46:52 +08:00
* Moving tutorials to the Flame main repository * Update README.md Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net> * Upgraded scripts to support multi projects * Removed comment out code * Adding WIP disclaimer Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
46 lines
1.0 KiB
Bash
Executable File
46 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
function run_analyze() {
|
|
if ! grep -q "dart_code_metrics" ./pubspec.yaml; then
|
|
echo "Missing dart_code_metrics in pubspec.yaml"
|
|
exit 1
|
|
fi
|
|
|
|
result=$(flutter pub get 2>&1) # Sadly a pub get can block up our actions as it will retry forever if a package is not found, but this should atleast report everything else.
|
|
if [ $? -ne 0 ]; then
|
|
echo "flutter pub get failed:"
|
|
echo "$result"
|
|
exit 1
|
|
fi
|
|
|
|
result=$(flutter pub run dart_code_metrics:metrics .)
|
|
if [ "$result" != "" ]; then
|
|
echo "flutter dart code metrics issues:"
|
|
echo "$result"
|
|
exit 1
|
|
fi
|
|
|
|
result=$(flutter analyze .)
|
|
if ! echo "$result" | grep -q "No issues found!"; then
|
|
echo "$result"
|
|
echo "flutter analyze issue:"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
echo "Starting Flame Analyzer"
|
|
echo "-----------------------"
|
|
for file in $(find . -type f -name "pubspec.yaml"); do
|
|
dir=$(dirname $file)
|
|
cd $dir
|
|
echo "Analyzing $dir"
|
|
run_analyze
|
|
analyze_result=$?
|
|
if [ $analyze_result -ne 0 ]; then
|
|
exit $analyze_result
|
|
fi
|
|
cd $(cd -)
|
|
done
|
|
|
|
exit 0
|