mirror of
https://github.com/apple/swift-nio
synced 2026-11-29 05:24:21 +00:00
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.
This commit is contained in:
1 parent
bfde40cac8
commit
589bc7cf08
1 file changed
+16
-1
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user