build_tests.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. # Copyright 2018 gRPC authors.
  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. # Don't run this script standalone. Instead, run from the repository root:
  16. # ./tools/run_tests/run_tests.py -l objc
  17. set -ex
  18. # CocoaPods requires the terminal to be using UTF-8 encoding.
  19. export LANG=en_US.UTF-8
  20. cd "$(dirname "$0")"
  21. # Check that required tools are available.
  22. hash pod 2>/dev/null || { echo >&2 "Cocoapods needs to be installed."; exit 1; }
  23. hash xcodebuild 2>/dev/null || {
  24. echo >&2 "XCode command-line tools need to be installed."
  25. exit 1
  26. }
  27. # clean up pod cache and existing pods
  28. rm -Rf Pods Podfile.lock CFStreamTests.xcworkspace
  29. time pod cache clean --all
  30. time pod install --verbose
  31. # ios-test-cfstream-tests flakes sometimes because of missing files in gRPC-Core,
  32. # add some log to help find out the root cause.
  33. # TODO(yulinliang): Delete it after solving the issue.
  34. if [ -d "./Pods/Headers/Public/gRPC-Core/grpc/impl/codegen" ]
  35. then
  36. echo "grpc/impl/codegen/ has been imported."
  37. number_of_files=$(find Pods/Headers/Public/gRPC-Core/grpc/impl/codegen -name "*.h" | wc -l)
  38. echo "The number of files in Pods/Headers/Public/gRPC-Core/grpc/impl/codegen/ is $number_of_files"
  39. else
  40. echo "Error: grpc/impl/codegen/ hasn't been imported."
  41. fi