vendor-all.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. # Usage: `$ ./vendor-all.sh v1.14.0` # Or whatever the gRPC core version is
  21. set -euxo pipefail
  22. TMP_DIR=./tmp
  23. GRPC_VERSION="$1"
  24. mkdir -p $TMP_DIR
  25. rm -rf $TMP_DIR/grpc
  26. cd $TMP_DIR
  27. # Clone gRPC Core, update its submodules, and check out the specified version.
  28. git clone git@github.com:grpc/grpc.git
  29. cd grpc
  30. git submodule update --init --recursive
  31. git checkout $GRPC_VERSION
  32. cd ../..
  33. # Update the vendored version of BoringSSL (removing previous versions).
  34. ./vendor-boringssl.sh
  35. # Copy the vendoring template into the gRPC Core's directory of templates.
  36. # Then, run the gRPC Core's generator on that template.
  37. cp ./swift-vendoring.sh.template $TMP_DIR/grpc/templates
  38. cd $TMP_DIR/grpc
  39. ./tools/buildgen/generate_projects.sh
  40. cd ../..
  41. # Finish copying the vendored version of the gRPC Core.
  42. ./vendor-grpc.sh
  43. echo "UPDATED vendored dependencies to $GRPC_VERSION"