Created
July 28, 2022 09:54
-
-
Save 4np/db0e0154f011848054eb7103c487fd21 to your computer and use it in GitHub Desktop.
Revisions
-
4np created this gist
Jul 28, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ source 'https://cdn.cocoapods.org/' platform :ios, '15.0' inhibit_all_warnings! use_frameworks! target 'MyApp' do pod 'SomePod', '~> 1.0' end target 'MyEmbeddedFramework' do pod 'SomeOtherPod', '~> 1.0' end post_integrate do |installer| updateSandboxSyncMessagesIfNeeded() end # Update the Xcode warning to execute `./myscript.sh` if the sandbox is not in sync with Podfile.lock. def updateSandboxSyncMessagesIfNeeded updateSandboxSyncMessageIfNeeded('MyProject.xcodeproj') updateSandboxSyncMessageIfNeeded('Frameworks/MyEmbeddedFramework/MyEmbeddedFramework.xcodeproj') end def updateSandboxSyncMessageIfNeeded(projectFile) project = Xcodeproj::Project.open(projectFile) changed = false project.targets.each do |target| target.build_phases.each do |build_phase| if defined?(build_phase.shell_script) && build_phase.shell_script.include?("pod install") script = build_phase.shell_script.gsub("The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.", "The sandbox is not in sync, please run './myscript.sh' to fix.") build_phase.shell_script = script changed = true end end end if changed project.save() end end