Skip to content

Commit 1e6305f

Browse files
authored
Travis: when linting Firestore, only lint iOS (#2569)
* Enable strict mode in pod_lib_lint.sh Use bash arrays to make quoting work correctly. * Only check pod lib lint for iOS on each PR This cuts build time for Firestore in half and should help cut bring down total build times. Note that cronned pod lib lint still checks all platforms.
1 parent 2ae939b commit 1e6305f

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
script:
8484
# Eliminate the one warning from BoringSSL when CocoaPods 1.6.0 is available.
8585
# The travis_wait is necessary because the command takes more than 10 minutes.
86-
- travis_wait 45 ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFirestore.podspec --allow-warnings --no-subspecs
86+
- travis_wait 25 ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFirestore.podspec --platforms=ios --allow-warnings --no-subspecs
8787

8888
# pod lib lint to check build and warnings for static library build - only on cron jobs
8989
- stage: test

scripts/pod_lib_lint.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#
1919
# Runs pod lib lint for the given podspec
2020

21+
set -euo pipefail
22+
2123
if [[ $# -lt 1 ]]; then
2224
cat 1>&2 <<EOF
2325
USAGE: $0 podspec [options]
@@ -27,8 +29,8 @@ podspec is the podspec to lint
2729
options can be any options for pod spec lint
2830
2931
Optionally, ALT_SOURCES can be set in the script to add extra repos to the
30-
search path. This is useful when API's to core dependencies like FirebaseCore
31-
or GoogleUtilities and the public podspecs are not yet updated.
32+
search path. This is useful when APIs to core dependencies like FirebaseCore or
33+
GoogleUtilities and the public podspecs are not yet updated.
3234
EOF
3335
exit 1
3436
fi
@@ -39,20 +41,17 @@ fi
3941
# https://guides.cocoapods.org/making/private-cocoapods.
4042
ALT_SOURCES="--sources=https://github.com/Firebase/SpecsStaging.git,https://github.com/CocoaPods/Specs.git"
4143

42-
podspec="$1"
43-
if [[ $# -gt 1 ]]; then
44-
options="${@:2}"
45-
else
46-
options=
47-
fi
44+
command=(bundle exec pod lib lint "$@")
4845

49-
command="bundle exec pod lib lint $podspec $options $ALT_SOURCES"
50-
echo $command
46+
if [[ -n "${ALT_SOURCES:-}" ]]; then
47+
command+=("${ALT_SOURCES}")
48+
fi
5149

52-
$command ; result=$?
50+
echo "${command[*]}"
51+
"${command[@]}"; result=$?
5352

5453
if [[ $result != 0 ]]; then
5554
# retry because of occasional network flakiness
56-
$command ; result=$?
55+
"${command[@]}"; result=$?
5756
fi
5857
exit $result

0 commit comments

Comments
 (0)