From 52610a22ea78c59a509eb644dcabda5c60e0a495 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Tue, 2 Sep 2025 18:30:33 -0400 Subject: [PATCH 01/12] feat(ci): Add support for testing SPM-based quickstarts --- scripts/setup_quickstart_spm.sh | 105 ++++++++++++++++ scripts/spm-localizer/Package.swift | 20 ++++ .../spm_localize_xcode_project.swift | 112 ++++++++++++++++++ 3 files changed, 237 insertions(+) create mode 100755 scripts/setup_quickstart_spm.sh create mode 100644 scripts/spm-localizer/Package.swift create mode 100644 scripts/spm-localizer/spm_localize_xcode_project.swift diff --git a/scripts/setup_quickstart_spm.sh b/scripts/setup_quickstart_spm.sh new file mode 100755 index 00000000000..b6f6c37efdc --- /dev/null +++ b/scripts/setup_quickstart_spm.sh @@ -0,0 +1,105 @@ +# Copyright 2023 Google +# +# 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. + +# Script to run in a CI `before_install` phase to setup a SPM-based +# quickstart repo so that it can be used for integration testing. + +set -xeuo pipefail + +scripts_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +root_dir="$(dirname "$scripts_dir")" + +# Source function to check if CI secrets are available. +source $scripts_dir/check_secrets.sh + +# Arguments: +# SAMPLE: The name of the quickstart sample directory. +# RELEASE_TESTING: Optional. Can be "nightly_release_testing" or "prerelease_testing". +# VERSION: Required when RELEASE_TESTING is "nightly_release_testing". +# +# Environment Variable: +# QUICKSTART_REPO: Optional. Path to a local clone of the quickstart-ios repo. +# If not set, the script will clone it from GitHub. +# Example: +# QUICKSTART_REPO=/path/to/my/quickstart-ios ./scripts/setup_quickstart_spm.sh AppName +SAMPLE=$1 +RELEASE_TESTING=${2-} +VERSION=${3-} + +QUICKSTART_PROJECT_DIR="quickstart-ios/${SAMPLE}" + +# TODO: Investigate moving this to a shared prereq script. +if ! gem list -i xcpretty > /dev/null; then + gem install xcpretty +fi + +# Some quickstarts may not need a real GoogleService-Info.plist for their tests. +# When QUICKSTART_REPO is set, we are running locally and should skip the secrets check. +if [[ -n "${QUICKSTART_REPO:-}" ]] || check_secrets || [[ ${SAMPLE} == "installations" ]]; then + + # Use local quickstart repo if QUICKSTART_REPO is set, otherwise clone it. + if [[ -n "${QUICKSTART_REPO:-}" && -d "${QUICKSTART_REPO}" ]]; then + echo "Using local quickstart repository at ${QUICKSTART_REPO}" + QUICKSTART_DIR="${QUICKSTART_REPO}" + else + echo "Cloning quickstart repository into 'quickstart-ios' directory..." + git clone https://github.com/firebase/quickstart-ios.git + QUICKSTART_DIR="quickstart-ios" + fi + + QUICKSTART_PROJECT_DIR="${QUICKSTART_DIR}/${SAMPLE}" + + # Find the .xcodeproj file within the sample directory. + # Note: This assumes there is only one .xcodeproj file. + PROJECT_FILE=$(find "$QUICKSTART_PROJECT_DIR" -maxdepth 1 -name "*.xcodeproj" | head -n 1) + if [[ -z "$PROJECT_FILE" ]]; then + echo "Error: Could not find .xcodeproj file in ${QUICKSTART_PROJECT_DIR}" + exit 1 + fi + + # The localization script needs an absolute path to the project file. + # If QUICKSTART_REPO was provided, PROJECT_FILE is already an absolute or user-provided path. + # Otherwise, it's relative to the firebase-ios-sdk root. + if [[ -n "${QUICKSTART_REPO:-}" && -d "${QUICKSTART_REPO}" ]]; then + ABSOLUTE_PROJECT_FILE="$PROJECT_FILE" + else + ABSOLUTE_PROJECT_FILE="$root_dir/$PROJECT_FILE" + fi + + # (cd "$QUICKSTART_DIR"; git checkout {BRANCH_NAME}) + + if [ "$RELEASE_TESTING" == "nightly_release_testing" ]; then + if [[ -z "$VERSION" ]]; then + echo "Error: VERSION (arg 3) is required for nightly_release_testing." + exit 1 + fi + # For release testing, point to the specific version tag. + echo "Setting SPM dependency to version ${VERSION}" + swift run --package-path "$scripts_dir/spm-localizer" SPMLocalize "$ABSOLUTE_PROJECT_FILE" --version "$VERSION" + + elif [ "$RELEASE_TESTING" == "prerelease_testing" ]; then + # For prerelease testing, point to the tip of the main branch. + echo "Setting SPM dependency to the tip of the main branch." + swift run --package-path "$scripts_dir/spm-localizer" SPMLocalize "$ABSOLUTE_PROJECT_FILE" --prerelease + + else + # For PR testing, point to the current commit. + CURRENT_REVISION=$(git rev-parse HEAD) + echo "Setting SPM dependency to current revision: ${CURRENT_REVISION}" + swift run --package-path "$scripts_dir/spm-localizer" SPMLocalize "$ABSOLUTE_PROJECT_FILE" --revision "$CURRENT_REVISION" + fi + +else + echo "Skipping quickstart setup: CI secrets are not available." +fi diff --git a/scripts/spm-localizer/Package.swift b/scripts/spm-localizer/Package.swift new file mode 100644 index 00000000000..6f3267fcb95 --- /dev/null +++ b/scripts/spm-localizer/Package.swift @@ -0,0 +1,20 @@ +// swift-tools-version:5.4 +import PackageDescription + +let package = Package( + name: "FirebaseSDKScripts", + platforms: [.macOS(.v10_11)], + dependencies: [ + .package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"), + ], + targets: [ + .executableTarget( + name: "SPMLocalize", + dependencies: [ + .product(name: "ArgumentParser", package: "swift-argument-parser"), + ], + path: ".", + sources: ["spm_localize_xcode_project.swift"] + ) + ] +) diff --git a/scripts/spm-localizer/spm_localize_xcode_project.swift b/scripts/spm-localizer/spm_localize_xcode_project.swift new file mode 100644 index 00000000000..7cda2a999ad --- /dev/null +++ b/scripts/spm-localizer/spm_localize_xcode_project.swift @@ -0,0 +1,112 @@ +// Copyright 2025 Google +// +// 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. + +import Foundation +import ArgumentParser + +struct SpmLocalizer: ParsableCommand { + static let configuration = CommandConfiguration( + abstract: "Updates an Xcode project's firebase-ios-sdk SPM dependency to point to a specific version, branch, or commit." + ) + + @Argument(help: "Path to the .xcodeproj file.") + var projectPath: String + + @Option(name: .long, help: "The version to use for release testing (e.g., '10.24.0').") + var version: String? + + @Flag(name: .long, help: "Flag to point to the latest commit on the main branch for prerelease testing.") + var prerelease = false + + @Option(name: .long, help: "The commit hash to use for PR/branch testing.") + var revision: String? + + func run() throws { + let pbxprojPath = "\(projectPath)/project.pbxproj" + var pbxprojContents: String + do { + pbxprojContents = try String(contentsOfFile: pbxprojPath, encoding: .utf8) + } catch { + fatalError("Failed to read project.pbxproj file: \(error)") + } + + let requirement: String + let indent4 = "\t\t\t\t" + let indent3 = "\t\t\t" + if let version = version { + // Release testing: Point to CocoaPods-{VERSION} tag (as a branch) + requirement = "{\n\(indent4)kind = branch;\n\(indent4)branch = \"CocoaPods-\(version)\";\n\(indent3)}" + } else if prerelease { + // Prerelease testing: Point to the tip of the main branch + let commitHash = try getRemoteHeadRevision(branch: "main") + requirement = "{\n\(indent4)kind = revision;\n\(indent4)revision = \"\(commitHash)\";\n\(indent3)}" + } else if let revision = revision { + // PR testing: Point to the specific commit hash of the current branch + requirement = "{\n\(indent4)kind = revision;\n\(indent4)revision = \"\(revision)\";\n\(indent3)}" + } else { + fatalError("No dependency requirement specified. Please provide --version, --prerelease, or --revision.") + } + + let updatedContents = try replaceDependency(in: pbxprojContents, with: requirement) + + do { + try updatedContents.write(toFile: pbxprojPath, atomically: true, encoding: .utf8) + print("Successfully updated SPM dependency in \(pbxprojPath)") + } catch { + fatalError("Failed to write updated contents to project.pbxproj: \(error)") + } + } + + private func replaceDependency(in content: String, with requirement: String) throws -> String { + let pattern = #"(repositoryURL = "https://github.com/firebase/firebase-ios-sdk";\s*requirement = )\{[^\}]+\};"# + let regex = try NSRegularExpression(pattern: pattern, options: []) + + let range = NSRange(content.startIndex.. String { + let process = Process() + process.executableURL = URL(fileURLWithPath: "/usr/bin/git") + process.arguments = ["ls-remote", "https://github.com/firebase/firebase-ios-sdk.git", branch] + + let pipe = Pipe() + process.standardOutput = pipe + + try process.run() + process.waitUntilExit() + + let data = pipe.fileHandleForReading.readDataToEndOfFile() + guard let output = String(data: data, encoding: .utf8), !output.isEmpty else { + fatalError("Failed to get remote revision for branch '\(branch)'. No output from git.") + } + + // Output is in the format: \trefs/heads/ + let components = output.components(separatedBy: CharacterSet.whitespacesAndNewlines) + if components.isEmpty { + fatalError("Invalid output from git ls-remote: \(output)") + } + return components[0] + } +} + +SpmLocalizer.main() \ No newline at end of file From 1e7263fa6865ef7014a5984317f363501ca9ccae Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Tue, 2 Sep 2025 18:58:29 -0400 Subject: [PATCH 02/12] tagging fix --- scripts/setup_quickstart_spm.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/setup_quickstart_spm.sh b/scripts/setup_quickstart_spm.sh index b6f6c37efdc..19203cb72cc 100755 --- a/scripts/setup_quickstart_spm.sh +++ b/scripts/setup_quickstart_spm.sh @@ -26,7 +26,6 @@ source $scripts_dir/check_secrets.sh # Arguments: # SAMPLE: The name of the quickstart sample directory. # RELEASE_TESTING: Optional. Can be "nightly_release_testing" or "prerelease_testing". -# VERSION: Required when RELEASE_TESTING is "nightly_release_testing". # # Environment Variable: # QUICKSTART_REPO: Optional. Path to a local clone of the quickstart-ios repo. @@ -35,7 +34,6 @@ source $scripts_dir/check_secrets.sh # QUICKSTART_REPO=/path/to/my/quickstart-ios ./scripts/setup_quickstart_spm.sh AppName SAMPLE=$1 RELEASE_TESTING=${2-} -VERSION=${3-} QUICKSTART_PROJECT_DIR="quickstart-ios/${SAMPLE}" @@ -80,12 +78,14 @@ if [[ -n "${QUICKSTART_REPO:-}" ]] || check_secrets || [[ ${SAMPLE} == "installa # (cd "$QUICKSTART_DIR"; git checkout {BRANCH_NAME}) if [ "$RELEASE_TESTING" == "nightly_release_testing" ]; then - if [[ -z "$VERSION" ]]; then - echo "Error: VERSION (arg 3) is required for nightly_release_testing." + # For release testing, find the latest CocoaPods tag and extract the version. + LATEST_TAG=$(git tag -l "CocoaPods-*" --sort=-v:refname | awk '/^CocoaPods-[0-9]+\.[0-9]+\.[0-9]+$/ { print; exit }') + if [[ -z "$LATEST_TAG" ]]; then + echo "Error: Could not find a 'CocoaPods-X.Y.Z' tag." exit 1 fi - # For release testing, point to the specific version tag. - echo "Setting SPM dependency to version ${VERSION}" + VERSION=$(echo "$LATEST_TAG" | sed 's/CocoaPods-//') + echo "Setting SPM dependency to latest version: ${VERSION}" swift run --package-path "$scripts_dir/spm-localizer" SPMLocalize "$ABSOLUTE_PROJECT_FILE" --version "$VERSION" elif [ "$RELEASE_TESTING" == "prerelease_testing" ]; then From 254930f4720341dcb3523f590781a5c0fb2c2255 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Tue, 2 Sep 2025 19:00:42 -0400 Subject: [PATCH 03/12] minor fixes --- scripts/setup_quickstart_spm.sh | 2 +- scripts/spm-localizer/Package.swift | 14 ++++++++++++++ .../spm-localizer/spm_localize_xcode_project.swift | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/setup_quickstart_spm.sh b/scripts/setup_quickstart_spm.sh index 19203cb72cc..cb09423e3fe 100755 --- a/scripts/setup_quickstart_spm.sh +++ b/scripts/setup_quickstart_spm.sh @@ -1,4 +1,4 @@ -# Copyright 2023 Google +# Copyright 2025 Google # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/spm-localizer/Package.swift b/scripts/spm-localizer/Package.swift index 6f3267fcb95..7d0e290c139 100644 --- a/scripts/spm-localizer/Package.swift +++ b/scripts/spm-localizer/Package.swift @@ -1,3 +1,17 @@ +// Copyright 2025 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. + // swift-tools-version:5.4 import PackageDescription diff --git a/scripts/spm-localizer/spm_localize_xcode_project.swift b/scripts/spm-localizer/spm_localize_xcode_project.swift index 7cda2a999ad..54da453a401 100644 --- a/scripts/spm-localizer/spm_localize_xcode_project.swift +++ b/scripts/spm-localizer/spm_localize_xcode_project.swift @@ -1,4 +1,4 @@ -// Copyright 2025 Google +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -109,4 +109,4 @@ struct SpmLocalizer: ParsableCommand { } } -SpmLocalizer.main() \ No newline at end of file +SpmLocalizer.main() From 2594a9a0052835d312911050653ecfa908d42e93 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 4 Sep 2025 14:15:32 -0400 Subject: [PATCH 04/12] extend existing script --- scripts/.vscode/launch.json | 22 ++++ scripts/quickstart_spm_xcodeproj.sh | 120 ++++++++++++------ scripts/setup_quickstart_spm.sh | 6 +- scripts/spm-localizer/Package.swift | 34 ----- .../spm_localize_xcode_project.swift | 112 ---------------- 5 files changed, 109 insertions(+), 185 deletions(-) create mode 100644 scripts/.vscode/launch.json delete mode 100644 scripts/spm-localizer/Package.swift delete mode 100644 scripts/spm-localizer/spm_localize_xcode_project.swift diff --git a/scripts/.vscode/launch.json b/scripts/.vscode/launch.json new file mode 100644 index 00000000000..bb5f63bb723 --- /dev/null +++ b/scripts/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + "configurations": [ + { + "type": "swift", + "request": "launch", + "args": [], + "cwd": "${workspaceFolder:scripts}", + "name": "Debug SPMLocalize", + "program": "${workspaceFolder:scripts}/.build/debug/SPMLocalize", + "preLaunchTask": "swift: Build Debug SPMLocalize" + }, + { + "type": "swift", + "request": "launch", + "args": [], + "cwd": "${workspaceFolder:scripts}", + "name": "Release SPMLocalize", + "program": "${workspaceFolder:scripts}/.build/release/SPMLocalize", + "preLaunchTask": "swift: Build Release SPMLocalize" + } + ] +} \ No newline at end of file diff --git a/scripts/quickstart_spm_xcodeproj.sh b/scripts/quickstart_spm_xcodeproj.sh index c9387c4cd5d..16a52c62a19 100755 --- a/scripts/quickstart_spm_xcodeproj.sh +++ b/scripts/quickstart_spm_xcodeproj.sh @@ -14,46 +14,94 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Modify a .xcodeproj to use a specific branch, version, or commit for the +# firebase-ios-sdk SPM dependency. -# Modify a .xcodeproj to use a specific branch. - -set -xeuo pipefail - -SAMPLE=$1 -SAMPLE_DIR=$(echo "$SAMPLE" | perl -ne 'print lc') -XCODEPROJ=${SAMPLE_DIR}/${SAMPLE}Example.xcodeproj/project.pbxproj - -# Regex matches SemVer `firebase-ios-sdk` dependency in project.pbxproj: -# { -# isa = XCRemoteSwiftPackageReference; -# repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git"; -# requirement = { -# kind = upToNextMajorVersion; -# minimumVersion = xx.yy.zz; -# }; -# }; -REQUIREMENT_REGEX='({'\ -'\s*isa = XCRemoteSwiftPackageReference;'\ -'\s*repositoryURL = "https://github\.com/firebase/firebase-ios-sdk\.git";'\ -'\s*requirement = {\s*)kind = upToNextMajorVersion;'\ -'\s*minimumVersion = \d+\.\d+\.\d+;'\ -'(\s*};'\ -'\s*};)' - -# Replaces the minimumVersion requirement with a branch requirement. -REPLACEMENT_REGEX="\1branch = $BRANCH_NAME;\n\t\t\t\tkind = branch;\2" - -# Performs the replacement using Perl. -# -# -0777 Enables reading all input in one go (slurp), rather than line-by-line. -# -p Causes Perl to loop through the input line by line. -# -i Edits the file in place. -# -e Provides the expression to execute. -perl -0777 -i -pe "s#$REQUIREMENT_REGEX#$REPLACEMENT_REGEX#g" "$XCODEPROJ" || { - echo "Failed to update quickstart's Xcode project to the branch: $BRANCH_NAME" +set -euo pipefail + +# --- Helper functions --- +usage() { + echo "Usage: $0 [--version | --revision | --prerelease]" + echo "Example: $0 path/to/MyProject.xcodeproj --version 10.24.0" + exit 1 +} + +# --- Argument parsing --- +if [[ $# -lt 2 ]]; then + usage +fi + +XCODEPROJ_PATH="$1" +shift +MODE="$1" +shift + +# Validate Xcode project path +if [[ ! -d "$XCODEPROJ_PATH" || ! "$XCODEPROJ_PATH" == *.xcodeproj ]]; then + echo "Error: Invalid Xcode project path provided: $XCODEPROJ_PATH" + exit 1 +fi +PBXPROJ_PATH="${XCODEPROJ_PATH}/project.pbxproj" +if [[ ! -f "$PBXPROJ_PATH" ]]; then + echo "Error: project.pbxproj not found at ${PBXPROJ_PATH}" + exit 1 +fi + +case "$MODE" in + --version) + if [[ $# -lt 1 ]]; then usage; fi + VERSION="$1" + # Release testing: Point to CocoaPods-{VERSION} tag (as a branch) + export REPLACEMENT_VALUE + REPLACEMENT_VALUE=$(printf '{\n\t\t\t\tkind = branch;\n\t\t\t\tbranch = "%s";\n\t\t\t}' "$VERSION") + ;; + --prerelease) + # Prerelease testing: Point to the tip of the main branch + COMMIT_HASH=$(git ls-remote https://github.com/firebase/firebase-ios-sdk.git main | cut -f1) + if [[ -z "$COMMIT_HASH" ]]; then + echo "Error: Failed to get remote revision for main branch." + exit 1 + fi + export REPLACEMENT_VALUE + REPLACEMENT_VALUE=$(printf '{\n\t\t\t\tkind = revision;\n\t\t\t\trevision = "%s";\n\t\t\t}' "$COMMIT_HASH") + ;; + --revision) + if [[ $# -lt 1 ]]; then usage; fi + REVISION="$1" + # PR testing: Point to the specific commit hash of the current branch + export REPLACEMENT_VALUE + REPLACEMENT_VALUE=$(printf '{\n\t\t\t\tkind = revision;\n\t\t\t\trevision = "%s";\n\t\t\t}' "$REVISION") + ;; + *) + usage + ;; +esac + +# Read the original content to check for changes later. +ORIGINAL_CONTENT=$(<"$PBXPROJ_PATH") + +# Use perl to perform the replacement. +# -0777: Slurp the whole file into one string. +# -i: Edit in-place. +# -p: Loop over the input. +# -e: Execute the script. +# The `e` flag in `s/.../.../ge` evaluates the replacement as a Perl expression. +# This allows us to use an environment variable for the replacement string, +# avoiding quoting issues with shell variables. +perl -0777 -i -pe 's#(repositoryURL = "https://github.com/firebase/firebase-ios-sdk\.git";\s*requirement = )\{[^\}]+\};#$1 . $ENV{"REPLACEMENT_VALUE"} . ";"#ge' "$PBXPROJ_PATH" || { + echo "Failed to update the Xcode project's SPM dependency." exit 1 } +# Verify that the file was changed. +UPDATED_CONTENT=$(<"$PBXPROJ_PATH") +if [[ "$ORIGINAL_CONTENT" == "$UPDATED_CONTENT" ]]; then + echo "Failed to find and replace the firebase-ios-sdk dependency. Check the regex pattern and project file structure." + exit 1 +} + +echo "Successfully updated SPM dependency in $PBXPROJ_PATH" + # Point SPM CI to the tip of `main` of # https://github.com/google/GoogleAppMeasurement so that the release process # can defer publishing the `GoogleAppMeasurement` tag until after testing. diff --git a/scripts/setup_quickstart_spm.sh b/scripts/setup_quickstart_spm.sh index cb09423e3fe..2561ecccee7 100755 --- a/scripts/setup_quickstart_spm.sh +++ b/scripts/setup_quickstart_spm.sh @@ -86,18 +86,18 @@ if [[ -n "${QUICKSTART_REPO:-}" ]] || check_secrets || [[ ${SAMPLE} == "installa fi VERSION=$(echo "$LATEST_TAG" | sed 's/CocoaPods-//') echo "Setting SPM dependency to latest version: ${VERSION}" - swift run --package-path "$scripts_dir/spm-localizer" SPMLocalize "$ABSOLUTE_PROJECT_FILE" --version "$VERSION" + "$scripts_dir/quickstart_spm_xcodeproj.sh" "$ABSOLUTE_PROJECT_FILE" --version "$VERSION" elif [ "$RELEASE_TESTING" == "prerelease_testing" ]; then # For prerelease testing, point to the tip of the main branch. echo "Setting SPM dependency to the tip of the main branch." - swift run --package-path "$scripts_dir/spm-localizer" SPMLocalize "$ABSOLUTE_PROJECT_FILE" --prerelease + "$scripts_dir/quickstart_spm_xcodeproj.sh" "$ABSOLUTE_PROJECT_FILE" --prerelease else # For PR testing, point to the current commit. CURRENT_REVISION=$(git rev-parse HEAD) echo "Setting SPM dependency to current revision: ${CURRENT_REVISION}" - swift run --package-path "$scripts_dir/spm-localizer" SPMLocalize "$ABSOLUTE_PROJECT_FILE" --revision "$CURRENT_REVISION" + "$scripts_dir/quickstart_spm_xcodeproj.sh" "$ABSOLUTE_PROJECT_FILE" --revision "$CURRENT_REVISION" fi else diff --git a/scripts/spm-localizer/Package.swift b/scripts/spm-localizer/Package.swift deleted file mode 100644 index 7d0e290c139..00000000000 --- a/scripts/spm-localizer/Package.swift +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2025 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. - -// swift-tools-version:5.4 -import PackageDescription - -let package = Package( - name: "FirebaseSDKScripts", - platforms: [.macOS(.v10_11)], - dependencies: [ - .package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"), - ], - targets: [ - .executableTarget( - name: "SPMLocalize", - dependencies: [ - .product(name: "ArgumentParser", package: "swift-argument-parser"), - ], - path: ".", - sources: ["spm_localize_xcode_project.swift"] - ) - ] -) diff --git a/scripts/spm-localizer/spm_localize_xcode_project.swift b/scripts/spm-localizer/spm_localize_xcode_project.swift deleted file mode 100644 index 54da453a401..00000000000 --- a/scripts/spm-localizer/spm_localize_xcode_project.swift +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2025 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. - -import Foundation -import ArgumentParser - -struct SpmLocalizer: ParsableCommand { - static let configuration = CommandConfiguration( - abstract: "Updates an Xcode project's firebase-ios-sdk SPM dependency to point to a specific version, branch, or commit." - ) - - @Argument(help: "Path to the .xcodeproj file.") - var projectPath: String - - @Option(name: .long, help: "The version to use for release testing (e.g., '10.24.0').") - var version: String? - - @Flag(name: .long, help: "Flag to point to the latest commit on the main branch for prerelease testing.") - var prerelease = false - - @Option(name: .long, help: "The commit hash to use for PR/branch testing.") - var revision: String? - - func run() throws { - let pbxprojPath = "\(projectPath)/project.pbxproj" - var pbxprojContents: String - do { - pbxprojContents = try String(contentsOfFile: pbxprojPath, encoding: .utf8) - } catch { - fatalError("Failed to read project.pbxproj file: \(error)") - } - - let requirement: String - let indent4 = "\t\t\t\t" - let indent3 = "\t\t\t" - if let version = version { - // Release testing: Point to CocoaPods-{VERSION} tag (as a branch) - requirement = "{\n\(indent4)kind = branch;\n\(indent4)branch = \"CocoaPods-\(version)\";\n\(indent3)}" - } else if prerelease { - // Prerelease testing: Point to the tip of the main branch - let commitHash = try getRemoteHeadRevision(branch: "main") - requirement = "{\n\(indent4)kind = revision;\n\(indent4)revision = \"\(commitHash)\";\n\(indent3)}" - } else if let revision = revision { - // PR testing: Point to the specific commit hash of the current branch - requirement = "{\n\(indent4)kind = revision;\n\(indent4)revision = \"\(revision)\";\n\(indent3)}" - } else { - fatalError("No dependency requirement specified. Please provide --version, --prerelease, or --revision.") - } - - let updatedContents = try replaceDependency(in: pbxprojContents, with: requirement) - - do { - try updatedContents.write(toFile: pbxprojPath, atomically: true, encoding: .utf8) - print("Successfully updated SPM dependency in \(pbxprojPath)") - } catch { - fatalError("Failed to write updated contents to project.pbxproj: \(error)") - } - } - - private func replaceDependency(in content: String, with requirement: String) throws -> String { - let pattern = #"(repositoryURL = "https://github.com/firebase/firebase-ios-sdk";\s*requirement = )\{[^\}]+\};"# - let regex = try NSRegularExpression(pattern: pattern, options: []) - - let range = NSRange(content.startIndex.. String { - let process = Process() - process.executableURL = URL(fileURLWithPath: "/usr/bin/git") - process.arguments = ["ls-remote", "https://github.com/firebase/firebase-ios-sdk.git", branch] - - let pipe = Pipe() - process.standardOutput = pipe - - try process.run() - process.waitUntilExit() - - let data = pipe.fileHandleForReading.readDataToEndOfFile() - guard let output = String(data: data, encoding: .utf8), !output.isEmpty else { - fatalError("Failed to get remote revision for branch '\(branch)'. No output from git.") - } - - // Output is in the format: \trefs/heads/ - let components = output.components(separatedBy: CharacterSet.whitespacesAndNewlines) - if components.isEmpty { - fatalError("Invalid output from git ls-remote: \(output)") - } - return components[0] - } -} - -SpmLocalizer.main() From 94103df5c9f9a9aaf02835f97d93120062e13a25 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 4 Sep 2025 18:17:11 -0400 Subject: [PATCH 05/12] checkpoint --- scripts/quickstart_spm_xcodeproj.sh | 97 ++++++++++++++++------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/scripts/quickstart_spm_xcodeproj.sh b/scripts/quickstart_spm_xcodeproj.sh index 16a52c62a19..6dff3ea7628 100755 --- a/scripts/quickstart_spm_xcodeproj.sh +++ b/scripts/quickstart_spm_xcodeproj.sh @@ -17,18 +17,14 @@ # Modify a .xcodeproj to use a specific branch, version, or commit for the # firebase-ios-sdk SPM dependency. -set -euo pipefail - -# --- Helper functions --- -usage() { - echo "Usage: $0 [--version | --revision | --prerelease]" - echo "Example: $0 path/to/MyProject.xcodeproj --version 10.24.0" - exit 1 -} +set -xeuo pipefail # --- Argument parsing --- if [[ $# -lt 2 ]]; then - usage + echo "Modify a .xcodeproj to use a specific branch, version, or commit for the" + echo "firebase-ios-sdk SPM dependency.\n" + echo "Usage: $0 [--version | --revision | --prerelease | --branch ]" + exit 1 fi XCODEPROJ_PATH="$1" @@ -36,69 +32,80 @@ shift MODE="$1" shift -# Validate Xcode project path -if [[ ! -d "$XCODEPROJ_PATH" || ! "$XCODEPROJ_PATH" == *.xcodeproj ]]; then - echo "Error: Invalid Xcode project path provided: $XCODEPROJ_PATH" - exit 1 -fi PBXPROJ_PATH="${XCODEPROJ_PATH}/project.pbxproj" -if [[ ! -f "$PBXPROJ_PATH" ]]; then - echo "Error: project.pbxproj not found at ${PBXPROJ_PATH}" - exit 1 -fi +# Regex matches SemVer `firebase-ios-sdk` dependency in project.pbxproj: +# { +# isa = XCRemoteSwiftPackageReference; +# repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git"; +# requirement = { +# kind = upToNextMajorVersion; +# minimumVersion = xx.yy.zz; +# }; +# }; +REQUIREMENT_REGEX='({'\ +'\s*isa = XCRemoteSwiftPackageReference;'\ +'\s*repositoryURL = "https://github\.com/firebase/firebase-ios-sdk(?:\.git)?";'\ +'\s*requirement = {\s*)kind = upToNextMajorVersion;'\ +'\s*minimumVersion = \d+\.\d+\.\d+;'\ +'(\s*};'\ +'\s*};)' + +# Define the replacement regex based on the selected mode. case "$MODE" in --version) - if [[ $# -lt 1 ]]; then usage; fi + if [[ $# -lt 1 ]]; then echo "Error: Missing version for --version"; exit 1; fi VERSION="$1" - # Release testing: Point to CocoaPods-{VERSION} tag (as a branch) - export REPLACEMENT_VALUE - REPLACEMENT_VALUE=$(printf '{\n\t\t\t\tkind = branch;\n\t\t\t\tbranch = "%s";\n\t\t\t}' "$VERSION") + REPLACEMENT_REGEX="\1kind = branch;\n\t\t\t\tbranch = \"$VERSION\";\2" ;; --prerelease) - # Prerelease testing: Point to the tip of the main branch COMMIT_HASH=$(git ls-remote https://github.com/firebase/firebase-ios-sdk.git main | cut -f1) if [[ -z "$COMMIT_HASH" ]]; then echo "Error: Failed to get remote revision for main branch." exit 1 fi - export REPLACEMENT_VALUE - REPLACEMENT_VALUE=$(printf '{\n\t\t\t\tkind = revision;\n\t\t\t\trevision = "%s";\n\t\t\t}' "$COMMIT_HASH") + REPLACEMENT_REGEX="\1kind = revision;\n\t\t\t\trevision = \"$COMMIT_HASH\";\2" ;; --revision) - if [[ $# -lt 1 ]]; then usage; fi + if [[ $# -lt 1 ]]; then echo "Error: Missing revision for --revision"; exit 1; fi REVISION="$1" - # PR testing: Point to the specific commit hash of the current branch - export REPLACEMENT_VALUE - REPLACEMENT_VALUE=$(printf '{\n\t\t\t\tkind = revision;\n\t\t\t\trevision = "%s";\n\t\t\t}' "$REVISION") + REPLACEMENT_REGEX="\1kind = revision;\n\t\t\t\trevision = \"$REVISION\";\2" + ;; + --branch) + if [[ $# -lt 1 ]]; then echo "Error: Missing branch name for --branch"; exit 1; fi + BRANCH_NAME="$1" + REPLACEMENT_REGEX="\1kind = branch;\n\t\t\t\tbranch = \"$BRANCH_NAME\";\2" ;; *) - usage + echo "Invalid mode: $MODE" + exit 1 ;; esac -# Read the original content to check for changes later. -ORIGINAL_CONTENT=$(<"$PBXPROJ_PATH") +# Make a temporary backup of the original file. +# This will be used to check if any changes were made. +TEMP_FILE=$(mktemp) +cp "$PBXPROJ_PATH" "$TEMP_FILE" -# Use perl to perform the replacement. -# -0777: Slurp the whole file into one string. -# -i: Edit in-place. -# -p: Loop over the input. -# -e: Execute the script. -# The `e` flag in `s/.../.../ge` evaluates the replacement as a Perl expression. -# This allows us to use an environment variable for the replacement string, -# avoiding quoting issues with shell variables. -perl -0777 -i -pe 's#(repositoryURL = "https://github.com/firebase/firebase-ios-sdk\.git";\s*requirement = )\{[^\}]+\};#$1 . $ENV{"REPLACEMENT_VALUE"} . ";"#ge' "$PBXPROJ_PATH" || { +# Performs the replacement using Perl. +# +# -0777 Enables reading all input in one go (slurp), rather than line-by-line. +# -p Causes Perl to loop through the input line by line. +# -i Edits the file in place. +# -e Provides the expression to execute. +perl -0777 -i -pe "s#$REQUIREMENT_REGEX#$REPLACEMENT_REGEX#g" "$PBXPROJ_PATH" || { echo "Failed to update the Xcode project's SPM dependency." exit 1 } -# Verify that the file was changed. -UPDATED_CONTENT=$(<"$PBXPROJ_PATH") -if [[ "$ORIGINAL_CONTENT" == "$UPDATED_CONTENT" ]]; then +# Silently compare the modified file with the temporary backup. +# If they are the same, cmp will return 0 (success), and the 'if' block will run. +if cmp -s "$PBXPROJ_PATH" "$TEMP_FILE"; then echo "Failed to find and replace the firebase-ios-sdk dependency. Check the regex pattern and project file structure." + # Restore the original file from the backup + mv "$TEMP_FILE" "$PBXPROJ_PATH" exit 1 -} +fi echo "Successfully updated SPM dependency in $PBXPROJ_PATH" From e4ea6b46d24d09d0b3b59ae474bfb476f2d55834 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Fri, 5 Sep 2025 12:07:59 -0400 Subject: [PATCH 06/12] More fixes --- scripts/quickstart_build_spm.sh | 4 +++- scripts/quickstart_spm_xcodeproj.sh | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/quickstart_build_spm.sh b/scripts/quickstart_build_spm.sh index 6d237bfeaec..e96371558a3 100755 --- a/scripts/quickstart_build_spm.sh +++ b/scripts/quickstart_build_spm.sh @@ -21,6 +21,8 @@ set -xeuo pipefail SAMPLE=$1 +SAMPLE_DIR=$(echo "$SAMPLE" | perl -ne 'print lc') +SAMPLE_XCODEPROJ=${SAMPLE_DIR}/${SAMPLE}Example.xcodeproj scripts_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -32,7 +34,7 @@ git clone https://github.com/firebase/quickstart-ios.git cd quickstart-ios -source "$scripts_dir/quickstart_spm_xcodeproj.sh" "$SAMPLE" +source "$scripts_dir/quickstart_spm_xcodeproj.sh" "$SAMPLE_XCODEPROJ" --branch "$BRANCH_NAME" # Placeholder GoogleService-Info.plist good enough for build only testing. cp ./mock-GoogleService-Info.plist ./firebaseai/GoogleService-Info.plist diff --git a/scripts/quickstart_spm_xcodeproj.sh b/scripts/quickstart_spm_xcodeproj.sh index 6dff3ea7628..92e37956150 100755 --- a/scripts/quickstart_spm_xcodeproj.sh +++ b/scripts/quickstart_spm_xcodeproj.sh @@ -22,7 +22,8 @@ set -xeuo pipefail # --- Argument parsing --- if [[ $# -lt 2 ]]; then echo "Modify a .xcodeproj to use a specific branch, version, or commit for the" - echo "firebase-ios-sdk SPM dependency.\n" + echo "firebase-ios-sdk SPM dependency." + echo "" echo "Usage: $0 [--version | --revision | --prerelease | --branch ]" exit 1 fi From e78d4c0ffce95717696da10dd6bdf38d270ae0e2 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Fri, 5 Sep 2025 12:08:33 -0400 Subject: [PATCH 07/12] forget --- scripts/.vscode/launch.json | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 scripts/.vscode/launch.json diff --git a/scripts/.vscode/launch.json b/scripts/.vscode/launch.json deleted file mode 100644 index bb5f63bb723..00000000000 --- a/scripts/.vscode/launch.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "configurations": [ - { - "type": "swift", - "request": "launch", - "args": [], - "cwd": "${workspaceFolder:scripts}", - "name": "Debug SPMLocalize", - "program": "${workspaceFolder:scripts}/.build/debug/SPMLocalize", - "preLaunchTask": "swift: Build Debug SPMLocalize" - }, - { - "type": "swift", - "request": "launch", - "args": [], - "cwd": "${workspaceFolder:scripts}", - "name": "Release SPMLocalize", - "program": "${workspaceFolder:scripts}/.build/release/SPMLocalize", - "preLaunchTask": "swift: Build Release SPMLocalize" - } - ] -} \ No newline at end of file From e5bcbc6f457acc45f9c52b7177212af3d6dd0254 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Fri, 5 Sep 2025 12:10:04 -0400 Subject: [PATCH 08/12] add --- scripts/setup_quickstart_spm.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/setup_quickstart_spm.sh b/scripts/setup_quickstart_spm.sh index 2561ecccee7..1e4c61d5bb9 100755 --- a/scripts/setup_quickstart_spm.sh +++ b/scripts/setup_quickstart_spm.sh @@ -1,4 +1,6 @@ -# Copyright 2025 Google +#!/usr/bin/env bash + +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From ceb15063ccdbbcda120f7ce30687bf20b205df43 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Fri, 5 Sep 2025 12:10:18 -0400 Subject: [PATCH 09/12] delete --- scripts/setup_quickstart_spm.sh | 107 -------------------------------- 1 file changed, 107 deletions(-) delete mode 100755 scripts/setup_quickstart_spm.sh diff --git a/scripts/setup_quickstart_spm.sh b/scripts/setup_quickstart_spm.sh deleted file mode 100755 index 1e4c61d5bb9..00000000000 --- a/scripts/setup_quickstart_spm.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2025 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. - -# Script to run in a CI `before_install` phase to setup a SPM-based -# quickstart repo so that it can be used for integration testing. - -set -xeuo pipefail - -scripts_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -root_dir="$(dirname "$scripts_dir")" - -# Source function to check if CI secrets are available. -source $scripts_dir/check_secrets.sh - -# Arguments: -# SAMPLE: The name of the quickstart sample directory. -# RELEASE_TESTING: Optional. Can be "nightly_release_testing" or "prerelease_testing". -# -# Environment Variable: -# QUICKSTART_REPO: Optional. Path to a local clone of the quickstart-ios repo. -# If not set, the script will clone it from GitHub. -# Example: -# QUICKSTART_REPO=/path/to/my/quickstart-ios ./scripts/setup_quickstart_spm.sh AppName -SAMPLE=$1 -RELEASE_TESTING=${2-} - -QUICKSTART_PROJECT_DIR="quickstart-ios/${SAMPLE}" - -# TODO: Investigate moving this to a shared prereq script. -if ! gem list -i xcpretty > /dev/null; then - gem install xcpretty -fi - -# Some quickstarts may not need a real GoogleService-Info.plist for their tests. -# When QUICKSTART_REPO is set, we are running locally and should skip the secrets check. -if [[ -n "${QUICKSTART_REPO:-}" ]] || check_secrets || [[ ${SAMPLE} == "installations" ]]; then - - # Use local quickstart repo if QUICKSTART_REPO is set, otherwise clone it. - if [[ -n "${QUICKSTART_REPO:-}" && -d "${QUICKSTART_REPO}" ]]; then - echo "Using local quickstart repository at ${QUICKSTART_REPO}" - QUICKSTART_DIR="${QUICKSTART_REPO}" - else - echo "Cloning quickstart repository into 'quickstart-ios' directory..." - git clone https://github.com/firebase/quickstart-ios.git - QUICKSTART_DIR="quickstart-ios" - fi - - QUICKSTART_PROJECT_DIR="${QUICKSTART_DIR}/${SAMPLE}" - - # Find the .xcodeproj file within the sample directory. - # Note: This assumes there is only one .xcodeproj file. - PROJECT_FILE=$(find "$QUICKSTART_PROJECT_DIR" -maxdepth 1 -name "*.xcodeproj" | head -n 1) - if [[ -z "$PROJECT_FILE" ]]; then - echo "Error: Could not find .xcodeproj file in ${QUICKSTART_PROJECT_DIR}" - exit 1 - fi - - # The localization script needs an absolute path to the project file. - # If QUICKSTART_REPO was provided, PROJECT_FILE is already an absolute or user-provided path. - # Otherwise, it's relative to the firebase-ios-sdk root. - if [[ -n "${QUICKSTART_REPO:-}" && -d "${QUICKSTART_REPO}" ]]; then - ABSOLUTE_PROJECT_FILE="$PROJECT_FILE" - else - ABSOLUTE_PROJECT_FILE="$root_dir/$PROJECT_FILE" - fi - - # (cd "$QUICKSTART_DIR"; git checkout {BRANCH_NAME}) - - if [ "$RELEASE_TESTING" == "nightly_release_testing" ]; then - # For release testing, find the latest CocoaPods tag and extract the version. - LATEST_TAG=$(git tag -l "CocoaPods-*" --sort=-v:refname | awk '/^CocoaPods-[0-9]+\.[0-9]+\.[0-9]+$/ { print; exit }') - if [[ -z "$LATEST_TAG" ]]; then - echo "Error: Could not find a 'CocoaPods-X.Y.Z' tag." - exit 1 - fi - VERSION=$(echo "$LATEST_TAG" | sed 's/CocoaPods-//') - echo "Setting SPM dependency to latest version: ${VERSION}" - "$scripts_dir/quickstart_spm_xcodeproj.sh" "$ABSOLUTE_PROJECT_FILE" --version "$VERSION" - - elif [ "$RELEASE_TESTING" == "prerelease_testing" ]; then - # For prerelease testing, point to the tip of the main branch. - echo "Setting SPM dependency to the tip of the main branch." - "$scripts_dir/quickstart_spm_xcodeproj.sh" "$ABSOLUTE_PROJECT_FILE" --prerelease - - else - # For PR testing, point to the current commit. - CURRENT_REVISION=$(git rev-parse HEAD) - echo "Setting SPM dependency to current revision: ${CURRENT_REVISION}" - "$scripts_dir/quickstart_spm_xcodeproj.sh" "$ABSOLUTE_PROJECT_FILE" --revision "$CURRENT_REVISION" - fi - -else - echo "Skipping quickstart setup: CI secrets are not available." -fi From 4bd6be7ddb311b374220c7f44b3f9a799b8d2c1a Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Fri, 5 Sep 2025 12:26:38 -0400 Subject: [PATCH 10/12] better logging --- scripts/quickstart_spm_xcodeproj.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/quickstart_spm_xcodeproj.sh b/scripts/quickstart_spm_xcodeproj.sh index 92e37956150..7a13e07a3cb 100755 --- a/scripts/quickstart_spm_xcodeproj.sh +++ b/scripts/quickstart_spm_xcodeproj.sh @@ -17,7 +17,12 @@ # Modify a .xcodeproj to use a specific branch, version, or commit for the # firebase-ios-sdk SPM dependency. -set -xeuo pipefail +set -euo pipefail + +# Enable trace mode if DEBUG is set to 'true' +if [[ "${DEBUG:-false}" == "true" ]]; then + set -x +fi # --- Argument parsing --- if [[ $# -lt 2 ]]; then From 763153c2a87747eafbc559eeac7ece321e69fb2b Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Fri, 5 Sep 2025 12:30:35 -0400 Subject: [PATCH 11/12] rename --- ...ckstart_spm_xcodeproj.sh => update_firebase_spm_dependency.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{quickstart_spm_xcodeproj.sh => update_firebase_spm_dependency.sh} (100%) diff --git a/scripts/quickstart_spm_xcodeproj.sh b/scripts/update_firebase_spm_dependency.sh similarity index 100% rename from scripts/quickstart_spm_xcodeproj.sh rename to scripts/update_firebase_spm_dependency.sh From 8ad6c75449681c1395e2d0cba01efd08d0de1807 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Fri, 5 Sep 2025 12:32:36 -0400 Subject: [PATCH 12/12] rename complete --- .github/workflows/firebaseai.yml | 2 +- scripts/quickstart_build_spm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/firebaseai.yml b/.github/workflows/firebaseai.yml index 16e3fdb08c5..ba5eb2be2d7 100644 --- a/.github/workflows/firebaseai.yml +++ b/.github/workflows/firebaseai.yml @@ -8,7 +8,7 @@ on: - '.github/workflows/common.yml' - '.github/workflows/common_cocoapods.yml' - 'scripts/quickstart_build_spm.sh' - - 'scripts/quickstart_spm_xcodeproj.sh' + - 'scripts/update_firebase_spm_dependency.sh' - 'Gemfile*' # Do not run for documentation-only PRs. - '!**.md' diff --git a/scripts/quickstart_build_spm.sh b/scripts/quickstart_build_spm.sh index e96371558a3..2337c8dae43 100755 --- a/scripts/quickstart_build_spm.sh +++ b/scripts/quickstart_build_spm.sh @@ -34,7 +34,7 @@ git clone https://github.com/firebase/quickstart-ios.git cd quickstart-ios -source "$scripts_dir/quickstart_spm_xcodeproj.sh" "$SAMPLE_XCODEPROJ" --branch "$BRANCH_NAME" +source "$scripts_dir/update_firebase_spm_dependency.sh" "$SAMPLE_XCODEPROJ" --branch "$BRANCH_NAME" # Placeholder GoogleService-Info.plist good enough for build only testing. cp ./mock-GoogleService-Info.plist ./firebaseai/GoogleService-Info.plist