Skip to content
Permalink
Browse files

improve pod updater script (#1391)

Motivation:

Somewhere in github or Cocoapods, there seems to be a problem that if
you push a pod A and quickly after a pod B that depends on A with
exactly the version you just pushed, the validation sometimes fails
claiming that the right version of A is not available. The workaround is
to wait a bit and to call `pod repo update`.
The modifications in this PR alleviate this problem somewhat, it now
calls `pod repo update` by itself and should it still go wrong, there's
a new `-f` (from) option that can be used to skip over all pods until
the one that failed last. Example

    scripts/build_podspecs.sh -u -f SwiftNIO 2.13.1

Modifications:

- update the pod repo often
- provide a skipping option to skip over earlier repos in case something
  still goes wrong

Result:

Easier way to update the pods.
  • Loading branch information
weissi committed Feb 13, 2020
1 parent bfde40c commit 589bc7cf0819367e8acd3f23e008880cdca0146c
Showing with 16 additions and 1 deletion.
  1. +16 −1 scripts/build_podspecs.sh
@@ -20,15 +20,21 @@ function usage() {
echo
echo "OPTIONS:"
echo " -u: Additionally, upload the podspecs as they are generated"
echo " -f: Skip over all targets before the specified target"
}

OPTIND=1
upload=false
while getopts ":u" opt; do
skip_until=""

while getopts ":uf:" opt; do
case $opt in
u)
upload=true
;;
f)
skip_until="$OPTARG"
;;
\?)
usage
exit 1
@@ -59,6 +65,14 @@ for target in "${targets[@]}"; do
if [[ "$target" == "_NIO1APIShims" ]]; then
continue
fi

if [[ -n "$skip_until" && "$target" != "$skip_until" ]]; then
echo "Skipping $target"
continue
elif [[ "$skip_until" == "$target" ]]; then
skip_until=""
fi

echo "Building podspec for $target"

dependencies=()
@@ -97,6 +111,7 @@ Pod::Spec.new do |s|
end
EOF

pod repo update # last chance of getting the latest versions of previous pushed pods
if $upload; then
echo "Uploading ${tmpfile}/${target}.podspec"
pod trunk push "${tmpfile}/${target}.podspec"

0 comments on commit 589bc7c

Please sign in to comment.
You can’t perform that action at this time.