In a large, nested project where I prefer to control the workspace, I run pod install --no-integrate
on my root project. However, some pods don't include their required static libs correctly within their target's framework build phases.
For example, Pod-TestFlightSDK
's required libTestFlight.a
is excluded and removed every time I update my pods. Which required me to manually update the Pod target each time to include the static lib, which required me to automate it:
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
if target.name == 'Pods-TestFlightSDK'
libFile = installer_representation.project.new_file('TestFlightSDK/libTestFlight.a')
end
if target.name == 'Pods-Brightcove-Player-SDK'
libFile = installer_representation.project.new_file('Brightcove-Player-SDK/Library/libBCOVPlayerSDK.a')
end
unless libFile.nil?
puts " - Adding %s to %s Frameworks Build Phases" % [libFile, target.name]
target.frameworks_build_phase.add_file_reference(libFile)
end
end
end
Hi @tomredman, how do I add a .framework to Framework Build Phase?
I tried using your method, but Framework is showing up without the usual Yellow briefcase icon. FYI, the Framework is also a part of the Podfile and is a static framework. I have a dynamic framework which needs this status framework to be linked. I can do that manually but want to automate by writing it inside Podfile as a
post_install
hook.