2020-06-09 17:51:06 -07:00
|
|
|
# Copyright 2020 Google LLC
|
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
2020-06-12 14:01:38 -07:00
|
|
|
set -ex
|
2020-06-11 13:56:06 -07:00
|
|
|
|
2020-06-17 17:18:40 -07:00
|
|
|
REPO=`pwd`
|
2020-06-23 16:20:42 -07:00
|
|
|
if [ ! -d "quickstart-ios" ]; then
|
2022-05-05 12:49:34 -07:00
|
|
|
git clone https://github.com/firebase/quickstart-ios.git
|
2020-06-23 16:20:42 -07:00
|
|
|
fi
|
2021-07-05 17:00:07 -07:00
|
|
|
QS_SCRIPTS="${REPO}"/quickstart-ios/scripts
|
2020-06-09 17:51:06 -07:00
|
|
|
cd quickstart-ios/"${SAMPLE}"
|
2021-07-05 17:00:07 -07:00
|
|
|
|
|
|
|
|
if [[ ! -z "$LEGACY" ]]; then
|
|
|
|
|
cd "Legacy${SAMPLE}Quickstart"
|
|
|
|
|
fi
|
2020-06-11 13:56:06 -07:00
|
|
|
|
2022-03-21 13:28:37 -07:00
|
|
|
# Make sure the Xcode project has at least one Swift file.
|
|
|
|
|
# See https://forums.swift.org/t/using-binary-swift-sdks-from-non-swift-apps/55989
|
|
|
|
|
touch foo.swift
|
|
|
|
|
"${REPO}"/scripts/update_xcode_target.rb "${SAMPLE}Example.xcodeproj" "${SAMPLE}Example" foo.swift
|
|
|
|
|
|
2020-06-11 13:56:06 -07:00
|
|
|
mkdir -p Firebase/
|
2020-06-17 17:18:40 -07:00
|
|
|
# Create non Firebase Frameworks and move to Firebase/ dir.
|
|
|
|
|
if [[ ! -z "$NON_FIREBASE_SDKS" ]]; then
|
|
|
|
|
REPO="${REPO}" NON_FIREBASE_SDKS="${NON_FIREBASE_SDKS}" "${REPO}"/scripts/build_non_firebase_sdks.sh
|
|
|
|
|
fi
|
2020-06-23 16:20:42 -07:00
|
|
|
if [ ! -f "Firebase/Firebase.h" ]; then
|
2021-05-07 16:26:15 -07:00
|
|
|
cp "${HOME}"/ios_frameworks/Firebase/Firebase.h Firebase/
|
2020-06-23 16:20:42 -07:00
|
|
|
fi
|
|
|
|
|
if [ ! -f "Firebase/module.modulemap" ]; then
|
2021-05-07 16:26:15 -07:00
|
|
|
cp "${HOME}"/ios_frameworks/Firebase/module.modulemap Firebase/
|
2020-06-23 16:20:42 -07:00
|
|
|
fi
|
2020-06-11 13:56:06 -07:00
|
|
|
for file in "$@"
|
|
|
|
|
do
|
2021-05-11 14:39:39 -07:00
|
|
|
if [ ! -f "Firebase/$(basename ${file})" ]; then
|
2021-05-10 12:56:34 -07:00
|
|
|
cp -R ${file} Firebase/
|
2020-06-23 16:20:42 -07:00
|
|
|
fi
|
2020-06-11 13:56:06 -07:00
|
|
|
done
|
2020-06-17 17:18:40 -07:00
|
|
|
|
2020-07-02 17:10:34 -07:00
|
|
|
if [[ "${SAMPLE}" == "Authentication" ]]; then
|
2021-07-05 17:00:07 -07:00
|
|
|
"${QS_SCRIPTS}"/add_framework_script.rb --sdk "${SAMPLE}" --target "${TARGET}" --framework_path usr/lib/libc++.dylib
|
|
|
|
|
"${QS_SCRIPTS}"/add_framework_script.rb --sdk "${SAMPLE}" --target "${TARGET}" --framework_path accelerate.framework --source_tree DEVELOPER_FRAMEWORKS_DIR
|
2020-07-02 17:10:34 -07:00
|
|
|
fi
|
|
|
|
|
|
2020-07-07 14:39:29 -07:00
|
|
|
if [[ "${SAMPLE}" == "Firestore" ]]; then
|
2021-07-05 17:00:07 -07:00
|
|
|
"${QS_SCRIPTS}"/add_framework_script.rb --sdk "${SAMPLE}" --target "${TARGET}" --framework_path Firebase/FirebaseAuthUI.xcframework/Resources/FirebaseAuthUI.bundle
|
|
|
|
|
"${QS_SCRIPTS}"/add_framework_script.rb --sdk "${SAMPLE}" --target "${TARGET}" --framework_path Firebase/FirebaseEmailAuthUI.xcframework/Resources/FirebaseEmailAuthUI.bundle
|
2020-07-07 14:39:29 -07:00
|
|
|
fi
|
|
|
|
|
|
2021-07-05 17:00:07 -07:00
|
|
|
"${QS_SCRIPTS}"/add_framework_script.rb --sdk "${SAMPLE}" --target "${TARGET}" --framework_path Firebase/
|