2
0

vendor-all.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/sh
  2. # Copyright 2019, gRPC Authors All rights reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # This script may be used to update the vendored versions of SwiftGRPC's
  16. # dependencies for use with Swift Package Manager.
  17. # As part of this process, BoringSSL and gRPC Core are both vendored by
  18. # invoking their respective vendoring scripts in this directory.
  19. #
  20. if [ "$#" -ne 1 ]; then
  21. echo "Usage: './vendor-all.sh v1.14.0' (or whatever the gRPC core version is)" >&2
  22. exit 1
  23. fi
  24. set -euxo pipefail
  25. TMP_DIR=./tmp
  26. GRPC_VERSION="$1"
  27. mkdir -p $TMP_DIR
  28. rm -rf $TMP_DIR/grpc
  29. cd $TMP_DIR
  30. # Clone gRPC Core, update its submodules, and check out the specified version.
  31. git clone git@github.com:grpc/grpc.git
  32. cd grpc
  33. git submodule update --init --recursive
  34. git checkout $GRPC_VERSION
  35. cd ../..
  36. # Update the vendored version of BoringSSL (removing previous versions).
  37. ./vendor-boringssl.sh
  38. # Copy the vendoring template into the gRPC Core's directory of templates.
  39. # Then, run the gRPC Core's generator on that template.
  40. cp ./swift-vendoring.sh.template $TMP_DIR/grpc/templates
  41. cd $TMP_DIR/grpc
  42. ./tools/buildgen/generate_projects.sh
  43. cd ../..
  44. # Finish copying the vendored version of the gRPC Core.
  45. ./vendor-grpc.sh
  46. echo "UPDATED vendored dependencies to $GRPC_VERSION"