@@ -13,31 +13,52 @@ function lint_package() {
13
13
local package_dir=" ${REPO_DIR} /packages/$package_name /"
14
14
local failure_count=0
15
15
16
+ # These podspecs are temporary multi-platform adoption dummy files.
16
17
local skipped_podspecs=(
17
- ' url_launcher_web.podspec'
18
+ " url_launcher_web.podspec"
18
19
)
19
- find " ${package_dir} " -type f -name ' *\.podspec' | while read podspec; do
20
- # These podspecs are temporary multi-platform adoption dummy files.
21
- if [[ " ${skipped_podspecs[*]} " =~ " $( basename ${podspec} ) " ]]; then
20
+
21
+ # TODO: These packages have analyzer warnings. Remove plugins from this list as issues are fixed.
22
+ local skip_analysis_packages=(
23
+ " camera.podspec" # https://github.com/flutter/flutter/issues/42673
24
+ " image_picker.podspec" # https://github.com/flutter/flutter/issues/42678
25
+ " in_app_purchase.podspec" # https://github.com/flutter/flutter/issues/42679
26
+ )
27
+ find " ${package_dir} " -type f -name " *\.podspec" | while read podspec; do
28
+ local podspecBasename=$( basename " ${podspec} " )
29
+ if [[ " ${skipped_podspecs[*]} " =~ " ${podspecBasename} " ]]; then
22
30
continue
23
31
fi
24
32
25
- echo " Linting $( basename ${podspec} ) "
33
+ # TODO: Remove --allow-warnings flag https://github.com/flutter/flutter/issues/41444
34
+ local lint_args=(
35
+ lib
36
+ lint
37
+ " ${podspec} "
38
+ --allow-warnings
39
+ --fail-fast
40
+ --silent
41
+ )
42
+ if [[ ! " ${skip_analysis_packages[*]} " =~ " ${podspecBasename} " ]]; then
43
+ lint_args+=(--analyze)
44
+ echo " Linting and analyzing ${podspecBasename} "
45
+ else
46
+ echo " Linting ${podspecBasename} "
47
+ fi
26
48
27
49
# Build as frameworks.
28
50
# This will also run any tests set up as a test_spec. See https://blog.cocoapods.org/CocoaPods-1.3.0.
29
- # TODO: Add --analyze flag https://github.com/flutter/flutter/issues/41443
30
- # TODO: Remove --allow-warnings flag https://github.com/flutter/flutter/issues/41444
31
- pod lib lint " ${podspec} " --allow-warnings --fail-fast --silent
51
+ pod " ${lint_args[@]} "
32
52
if [[ " $? " -ne 0 ]]; then
33
- error " Package ${package_name} has framework issues. Run \" pod lib lint $podspec \" to inspect."
53
+ error " Package ${package_name} has framework issues. Run \" pod lib lint ${ podspec} --analyze \" to inspect."
34
54
failure_count+=1
35
55
fi
36
56
37
57
# Build as libraries.
38
- pod lib lint " ${podspec} " --allow-warnings --use-libraries --fail-fast --silent
58
+ lint_args+=(--use-libraries)
59
+ pod " ${lint_args[@]} "
39
60
if [[ " $? " -ne 0 ]]; then
40
- error " Package ${package_name} has library issues. Run \" pod lib lint $podspec --use-libraries\" to inspect."
61
+ error " Package ${package_name} has library issues. Run \" pod lib lint ${ podspec} --use-libraries --analyze \" to inspect."
41
62
failure_count+=1
42
63
fi
43
64
done
0 commit comments