Documentation / 03
Installation hooks
Ruby helpers and hooks execute with your separately installed Ruby. SwiftPods exposes supported public installation objects and saves supported Xcode project changes made by hooks.
Hook phases
| Hook | When it runs |
|---|---|
pre_install | Before generating dependency projects. |
pre_integrate | Before Xcode integration. |
post_install | After project generation, before saving supported changes. |
post_integrate | After integration has completed. |
Set a build setting
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
configuration.build_settings['MY_BUILD_FLAG'] = 'YES'
end
end
endInspect public headers
post_install do |installer|
installer.pod_targets.each do |target|
target.file_accessors.each do |accessor|
puts "#{target.name}: #{accessor.public_headers.length} public headers"
end
end
endKeep Ruby helpers
require_relative './scripts/dependencies'
target 'MyApp' do
shared_dependencies
endUse public APIs supported by the selected runtime profile. Unsupported operations produce an explicit diagnostic. Private monkey patches and arbitrary plugin internals are outside the general compatibility promise; plugin versions need their own verified profile.