Skip to content

Commit

Permalink
test(ios): silence warnings about build script phases always running
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mikehardy committed Nov 28, 2023
1 parent 8c982d2 commit 3d5842a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
19 changes: 19 additions & 0 deletions tests/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,22 @@ target 'testing' do
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end

# Fix Xcode 14 warnings like:
# 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')
# Ref.: https://github.com/CocoaPods/CocoaPods/issues/11444
post_integrate do |installer|
main_project = installer.aggregate_targets[0].user_project
pods_project = installer.pods_project
targets = main_project.targets + pods_project.targets
targets.each do |target|
run_script_build_phases = target.build_phases.filter { |phase| phase.is_a?(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) }
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")) }
cocoapods_run_script_build_phases.each do |run_script|
next unless (run_script.input_paths || []).empty? && (run_script.output_paths || []).empty?
run_script.always_out_of_date = "1"
end
end
main_project.save
pods_project.save
end
6 changes: 3 additions & 3 deletions tests/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ PODS:
- BoringSSL-GRPC (= 0.0.24)
- gRPC-Core/Interface (= 1.49.1)
- gRPC-Core/Interface (1.49.1)
- GTMSessionFetcher/Core (3.1.1)
- GTMSessionFetcher/Core (3.2.0)
- hermes-engine (0.72.7):
- hermes-engine/Pre-built (= 0.72.7)
- hermes-engine/Pre-built (0.72.7)
Expand Down Expand Up @@ -1720,7 +1720,7 @@ SPEC CHECKSUMS:
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
"gRPC-C++": 2df8cba576898bdacd29f0266d5236fa0e26ba6a
gRPC-Core: a21a60aefc08c68c247b439a9ef97174b0c54f96
GTMSessionFetcher: e8647203b65cee28c5f73d0f473d096653945e72
GTMSessionFetcher: 41b9ef0b4c08a6db4b7eb51a21ae5183ec99a2c8
hermes-engine: 9180d43df05c1ed658a87cc733dc3044cf90c00a
Jet: 115c08882ff1bd917e1aa32af128641169d04ffd
leveldb-library: f03246171cce0484482ec291f88b6d563699ee06
Expand Down Expand Up @@ -1782,6 +1782,6 @@ SPEC CHECKSUMS:
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5

PODFILE CHECKSUM: d02eebd9139761d802f97283433d3bff73c7dbae
PODFILE CHECKSUM: 5caae5837b030c78814189f970734b1e39decf1d

COCOAPODS: 1.14.3
4 changes: 2 additions & 2 deletions tests/ios/testing.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@
7D57265F10EEF7CD92D7973F /* Copy Detox Framework */,
DAB1A184ED1FB4A446CF5BBC /* [CP-User] [RNFB] Core Configuration */,
8512258DB46D3EF726067919 /* [CP-User] [RNFB] Crashlytics Configuration */,
747DA0B230C3CCED1B55F7B8 /* [CP] Embed Pods Frameworks */,
2603193C849419258196E68A /* [CP] Copy Pods Resources */,
64F0A53627116CEBA061920E /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -297,7 +297,7 @@
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";
showEnvVarsInLog = 0;
};
747DA0B230C3CCED1B55F7B8 /* [CP] Embed Pods Frameworks */ = {
64F0A53627116CEBA061920E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand Down

0 comments on commit 3d5842a

Please sign in to comment.