CocoaPods / Rome

Makes it easy to build a list of frameworks.
MIT License
694 stars 64 forks source link

Add pre post install handler #61

Closed tcamin closed 6 years ago

tcamin commented 6 years ago

As highlighted in issue #60 one often needs to customise the way the single pods are compiled.

This PR adds a pre post install handler that allows to customize the Pods.xcodeproj file before compilation actually starts.

A sample Podfile looks like the following:

use_frameworks!

plugin 'cocoapods-rome', :pre_post_install => Proc.new { |installer|
    # do stuff with installer, for example change SWIFT_VERSION
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.0'
        end
    end

    installer.pods_project.save
}

target 'DummyTarget' do
    pod 'MyPod'
end
jasonm23 commented 6 years ago

:+1: thanks

orta commented 6 years ago

This makes sense to me, can you add some docs in the README, and this is good to go πŸ‘

tcamin commented 6 years ago

Sure thing, before that what about renaming pre_post_install to pre_compile (or something like that)?

β€œPre compile hook” may be easier to understand, what do you think?

orta commented 6 years ago

I agree πŸ‘

jasonm23 commented 6 years ago

Sounds good to me

tcamin commented 6 years ago

PR updated

orta commented 6 years ago

Ace- sorry, forgot about this PR πŸ₯‡

But it happened πŸ‘

thanks!