setup_quickstart_framework.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright 2020 Google LLC
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. set -ex
  15. REPO=`pwd`
  16. if [ ! -d "quickstart-ios" ]; then
  17. git clone https://github.com/firebase/quickstart-ios.git
  18. fi
  19. cd quickstart-ios/"${SAMPLE}"
  20. chmod +x ../scripts/info_script.rb
  21. ruby ../scripts/info_script.rb "${SAMPLE}"
  22. mkdir -p Firebase/
  23. # Create non Firebase Frameworks and move to Firebase/ dir.
  24. if [[ ! -z "$NON_FIREBASE_SDKS" ]]; then
  25. REPO="${REPO}" NON_FIREBASE_SDKS="${NON_FIREBASE_SDKS}" "${REPO}"/scripts/build_non_firebase_sdks.sh
  26. fi
  27. if [ ! -f "Firebase/Firebase.h" ]; then
  28. mv "${HOME}"/ios_frameworks/Firebase/Firebase.h Firebase/
  29. fi
  30. if [ ! -f "Firebase/module.modulemap" ]; then
  31. mv "${HOME}"/ios_frameworks/Firebase/module.modulemap Firebase/
  32. fi
  33. for file in "$@"
  34. do
  35. if [ ! -f "Firebase/${file}" ]; then
  36. mv -n ${file} Firebase/
  37. fi
  38. done
  39. if [[ "${SAMPLE}" == "Authentication" ]]; then
  40. ../scripts/add_framework_script.rb --sdk "${SAMPLE}" --target "${TARGET}" --framework_path usr/lib/libc++.dylib
  41. ../scripts/add_framework_script.rb --sdk "${SAMPLE}" --target "${TARGET}" --framework_path accelerate.framework --source_tree DEVELOPER_FRAMEWORKS_DIR
  42. fi
  43. if [[ "${SAMPLE}" == "Firestore" ]]; then
  44. ../scripts/add_framework_script.rb --sdk "${SAMPLE}" --target "${TARGET}" --framework_path Firebase/FirebaseUI.xcframework/Resources/FirebaseAuthUI.bundle
  45. ../scripts/add_framework_script.rb --sdk "${SAMPLE}" --target "${TARGET}" --framework_path Firebase/FirebaseUI.xcframework/Resources/FirebaseEmailAuthUI.bundle
  46. fi
  47. ../scripts/add_framework_script.rb --sdk "${SAMPLE}" --target "${TARGET}" --framework_path Firebase/