build_non_firebase_sdks.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # Copyright 2020 Google LLC
  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. set -ex
  16. cd "${REPO}"/ReleaseTooling
  17. # This file will have non Firebase SDKs that will be built by ZipBuilder.
  18. ZIP_POD_JSON="non_firebase_sdk.json"
  19. rm -f "${ZIP_POD_JSON}"
  20. IFS=' ,' read -a NON_FIREBASE_SDKS <<< "${NON_FIREBASE_SDKS}"
  21. num_sdk="${#NON_FIREBASE_SDKS[@]}"
  22. echo "[" >> "${ZIP_POD_JSON}"
  23. for sdk in "${NON_FIREBASE_SDKS[@]}"
  24. do
  25. echo "{\"name\":\"${sdk}\"}" >> "${ZIP_POD_JSON}"
  26. if [ "$num_sdk" -ne 1 ]; then
  27. echo ",">> "${ZIP_POD_JSON}"
  28. fi
  29. num_sdk=$((num_sdk-1))
  30. done
  31. echo "]" >> "${ZIP_POD_JSON}"
  32. mkdir -p "${REPO}"/sdk_zip
  33. swift run zip-builder --keep-build-artifacts --update-pod-repo --platforms ios \
  34. --zip-pods "${ZIP_POD_JSON}" --output-dir "${REPO}"/sdk_zip --disable-build-dependencies
  35. unzip -o "${REPO}"/sdk_zip/Frameworks.zip -d "${HOME}"/ios_frameworks/Firebase/
  36. # Move Frameworks to Firebase dir, so be align with Firebase SDKs.
  37. mv -n "${HOME}"/ios_frameworks/Firebase/Binaries "${HOME}"/ios_frameworks/Firebase/NonFirebaseSDKs/