analyze.sh 2.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
echo "Analyzing frontend_server..."
RESULTS=`dartanalyzer                                                          \
  --packages=flutter/frontend_server/.packages                                 \
  --options flutter/analysis_options.yaml                                      \
  flutter/frontend_server                                                      \
  2>&1                                                                         \
  | grep -Ev "No issues found!"                                                \
  | grep -Ev "Analyzing.+frontend_server"`
echo "$RESULTS"
if [ -n "$RESULTS" ]; then
  echo "Failed."
  exit 1;
fi

15
echo "Analyzing dart:ui library..."
16 17
RESULTS=`dartanalyzer                                                          \
  --supermixin                                                                 \
18 19
  --enable-assert-initializers                                                 \
  --initializing-formal-access                                                 \
20 21 22
  --enable-strict-call-checks                                                  \
  --enable_type_checks                                                         \
  --strong                                                                     \
23
  --no-implicit-dynamic                                                        \
24 25 26 27
  --package-warnings                                                           \
  --fatal-warnings                                                             \
  --fatal-hints                                                                \
  --lints                                                                      \
28
  --fatal-lints                                                                \
29
  out/host_debug_unopt/gen/sky/bindings/dart_ui/ui.dart                        \
30
  2>&1                                                                         \
31 32 33 34 35
  | grep -v "Native functions can only be declared in the SDK and code that is loaded through native extensions" \
  | grep -Ev "The function '.+' (is not|isn't) used"                           \
  | grep -Ev "Undefined name 'main'"                                           \
  | grep -Ev "Undefined name 'VMLibraryHooks"                                  \
  | grep -v "The library ''dart:_internal'' is internal"                       \
36
  | grep -Ev "Unused import.+ui\.dart"                                         \
37
  | grep -v "TODO"                                                             \
38
  | grep -Ev "[0-9]+ errors.*found\."                                          \
39
  | grep -Ev "Analyzing.+out/host_debug_unopt/gen/sky/bindings/dart_ui/ui\.dart"`
40

41
echo "$RESULTS"
I
Ian Hickson 已提交
42 43 44
if [ -n "$RESULTS" ]; then
  echo "Failed."
  exit 1;
45
fi