analyze.sh 1.9 KB
Newer Older
1
echo "Analyzing dart:ui library..."
2 3 4 5 6 7 8 9 10 11 12
RESULTS=`dartanalyzer                                                          \
  --ignore-unrecognized-flags                                                  \
  --supermixin                                                                 \
  --enable-strict-call-checks                                                  \
  --enable_type_checks                                                         \
  --strong                                                                     \
  --package-warnings                                                           \
  --fatal-warnings                                                             \
  --strong-hints                                                               \
  --fatal-hints                                                                \
  --lints                                                                      \
13
  out/host_debug_unopt/gen/sky/bindings/dart_ui/ui.dart                        \
14 15
  2>&1                                                                         \
  | grep -v "\[error\] Native functions can only be declared in the SDK and code that is loaded through native extensions" \
16
  | grep -Ev "\[(hint|error)\] The function '.+' (is not|isn't) used"                  \
17 18
  | grep -Ev "\[(warning|error)\] Undefined name 'main'"                       \
  | grep -Ev "\[(warning|error)\] Undefined name 'VMLibraryHooks"              \
19
  | grep -v "\[error\] The library ''dart:_internal'' is internal"             \
20
  | grep -Ev "Unused import.+ui\.dart"                                        \
21 22
  | grep -v "\[info\] TODO"                                                    \
  | grep -Ev "[0-9]+ errors.*found."                                           \
23
  | grep -v "Analyzing \[out/host_debug_unopt/gen/sky/bindings/dart_ui/ui.dart\]\.\.\."`
24

25
echo "$RESULTS"
26 27 28
if [ -n "$RESULTS" ];
  then exit 1;
fi