Skip to content

Commit afa6364

Browse files
committed
test(ios): silence warnings about build script phases always running
these are noisy in the build log, and we only care about our own script phase warnings - the ones about detox, react-native and copying headers are noise not signal
1 parent 08d7b17 commit afa6364

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

tests/ios/Podfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,22 @@ target 'testing' do
115115
__apply_Xcode_12_5_M1_post_install_workaround(installer)
116116
end
117117
end
118+
119+
# Fix Xcode 14 warnings like:
120+
# warning: Run script build phase '[CP] Copy XCFrameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'ATargetNameHere' from project 'YourProjectName')
121+
# Ref.: https://github.com/CocoaPods/CocoaPods/issues/11444
122+
post_integrate do |installer|
123+
main_project = installer.aggregate_targets[0].user_project
124+
pods_project = installer.pods_project
125+
targets = main_project.targets + pods_project.targets
126+
targets.each do |target|
127+
run_script_build_phases = target.build_phases.filter { |phase| phase.is_a?(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) }
128+
cocoapods_run_script_build_phases = run_script_build_phases.filter { |phase| (phase.name&.start_with?("Create Symlinks to Header Folders") || phase.name&.start_with?("Bundle React Native") || phase.name&.start_with?("Copy Detox Framework")) }
129+
cocoapods_run_script_build_phases.each do |run_script|
130+
next unless (run_script.input_paths || []).empty? && (run_script.output_paths || []).empty?
131+
run_script.always_out_of_date = "1"
132+
end
133+
end
134+
main_project.save
135+
pods_project.save
136+
end

tests/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ PODS:
947947
- BoringSSL-GRPC (= 0.0.24)
948948
- gRPC-Core/Interface (= 1.49.1)
949949
- gRPC-Core/Interface (1.49.1)
950-
- GTMSessionFetcher/Core (3.1.1)
950+
- GTMSessionFetcher/Core (3.2.0)
951951
- hermes-engine (0.72.7):
952952
- hermes-engine/Pre-built (= 0.72.7)
953953
- hermes-engine/Pre-built (0.72.7)
@@ -1720,7 +1720,7 @@ SPEC CHECKSUMS:
17201720
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
17211721
"gRPC-C++": 2df8cba576898bdacd29f0266d5236fa0e26ba6a
17221722
gRPC-Core: a21a60aefc08c68c247b439a9ef97174b0c54f96
1723-
GTMSessionFetcher: e8647203b65cee28c5f73d0f473d096653945e72
1723+
GTMSessionFetcher: 41b9ef0b4c08a6db4b7eb51a21ae5183ec99a2c8
17241724
hermes-engine: 9180d43df05c1ed658a87cc733dc3044cf90c00a
17251725
Jet: 115c08882ff1bd917e1aa32af128641169d04ffd
17261726
leveldb-library: f03246171cce0484482ec291f88b6d563699ee06
@@ -1782,6 +1782,6 @@ SPEC CHECKSUMS:
17821782
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
17831783
Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5
17841784

1785-
PODFILE CHECKSUM: d02eebd9139761d802f97283433d3bff73c7dbae
1785+
PODFILE CHECKSUM: 5caae5837b030c78814189f970734b1e39decf1d
17861786

17871787
COCOAPODS: 1.14.3

tests/ios/testing.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@
163163
7D57265F10EEF7CD92D7973F /* Copy Detox Framework */,
164164
DAB1A184ED1FB4A446CF5BBC /* [CP-User] [RNFB] Core Configuration */,
165165
8512258DB46D3EF726067919 /* [CP-User] [RNFB] Crashlytics Configuration */,
166-
747DA0B230C3CCED1B55F7B8 /* [CP] Embed Pods Frameworks */,
167166
2603193C849419258196E68A /* [CP] Copy Pods Resources */,
167+
64F0A53627116CEBA061920E /* [CP] Embed Pods Frameworks */,
168168
);
169169
buildRules = (
170170
);
@@ -297,7 +297,7 @@
297297
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
298298
showEnvVarsInLog = 0;
299299
};
300-
747DA0B230C3CCED1B55F7B8 /* [CP] Embed Pods Frameworks */ = {
300+
64F0A53627116CEBA061920E /* [CP] Embed Pods Frameworks */ = {
301301
isa = PBXShellScriptBuildPhase;
302302
buildActionMask = 2147483647;
303303
files = (

0 commit comments

Comments
 (0)