-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate.sh
More file actions
37 lines (31 loc) · 1.55 KB
/
validate.sh
File metadata and controls
37 lines (31 loc) · 1.55 KB
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
#!/bin/bash
set -e # exit on first error
###############################################################################
# VERIFICATION FUNCTION FOR FLUTTER APP/PACKAGES
###############################################################################
verifyFlutter () {
cd $1
echo "Checking `pwd`"
flutter --version
flutter clean
flutter pub get
flutter packages pub run build_runner build --delete-conflicting-outputs
dart format --set-exit-if-changed .
flutter pub run dart_code_metrics:metrics analyze . --fatal-style --fatal-performance --fatal-warnings
flutter pub run dart_code_metrics:metrics check-unused-files . --fatal-unused --exclude="{/**.g.dart,/**.template.dart,.dart_tool/**}"
flutter pub run dart_code_metrics:metrics check-unused-l10n . --fatal-unused
flutter pub run dart_code_metrics:metrics check-unused-code . --fatal-unused
flutter analyze --no-pub .
###############################################################################
# CODE COVERAGE
###############################################################################
dart pub global activate very_good_cli
very_good test --no-optimization --coverage --test-randomize-ordering-seed random
# lcov --remove coverage/lcov.info 'lib/*/*.g.dart' 'lib/*/job_page_inner_demo_ui.dart' -o coverage/lcov.info
# genhtml -o coverage coverage/lcov.info
cd -
}
###############################################################################
# INVOKE VERIFICATION FUNCTIONS
###############################################################################
verifyFlutter "."