Skip to content

Commit a3d1ec7

Browse files
committed
another approach
1 parent 15fb9e4 commit a3d1ec7

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/zip.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ jobs:
354354
cd quickstart-ios/crashlytics
355355
"${GITHUB_WORKSPACE}"/quickstart-ios/scripts/add_framework_script.rb --sdk "Crashlytics" --target "CrashlyticsExample_(watchOS)_Extension" --framework_path Firebase/
356356
- name: Patch Crashlytics Run Script Path
357-
run: sed -i '' 's|SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run|"${SRCROOT}/Firebase/FirebaseCrashlytics/run"|g' quickstart-ios/crashlytics/CrashlyticsExample.xcodeproj/project.pbxproj
357+
run: scripts/patch_crashlytics_run_path.rb
358358
# TODO(#8057): Restore Swift Quickstart
359359
# - name: Setup swift quickstart
360360
# env:
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env ruby
2+
3+
# Copyright 2025 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
require 'xcodeproj'
18+
19+
# This script patches the Crashlytics Quickstart's Xcode project to fix the
20+
# path to the `run` script for XCFramework-based builds.
21+
#
22+
# The default project assumes an SPM dependency and has a hardcoded path:
23+
# ${BUILD_DIR%Build/*}SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run
24+
#
25+
# This script changes it to the path used by the XCFramework distribution:
26+
# "${SRCROOT}/Firebase/FirebaseCrashlytics/run"
27+
28+
project_path = 'quickstart-ios/crashlytics/CrashlyticsExample.xcodeproj'
29+
project = Xcodeproj::Project.open(project_path)
30+
31+
project.targets.each do |target|
32+
target.build_phases.each do |phase|
33+
if phase.is_a?(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) && phase.name == 'Run Script'
34+
if phase.shell_script.include?('SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run')
35+
puts "Patching Run Script phase in target: #{target.name}"
36+
phase.shell_script = '"${SRCROOT}/Firebase/FirebaseCrashlytics/run"'
37+
end
38+
end
39+
end
40+
end
41+
42+
project.save

0 commit comments

Comments
 (0)