Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre post install handler #61

Merged
merged 2 commits into from
Apr 7, 2018
Merged

Add pre post install handler #61

merged 2 commits into from
Apr 7, 2018

Conversation

tcamin
Copy link

@tcamin tcamin commented Mar 27, 2018

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
Copy link

👍 thanks

@orta
Copy link
Member

orta commented Mar 30, 2018

This makes sense to me, can you add some docs in the README, and this is good to go 👍

@tcamin
Copy link
Author

tcamin commented Mar 30, 2018

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
Copy link
Member

orta commented Mar 30, 2018

I agree 👍

@orta orta mentioned this pull request Mar 30, 2018
@jasonm23
Copy link

Sounds good to me

@tcamin
Copy link
Author

tcamin commented Mar 31, 2018

PR updated

Copy link

@jasonm23 jasonm23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@orta orta merged commit 65bdd86 into CocoaPods:master Apr 7, 2018
@orta
Copy link
Member

orta commented Apr 7, 2018

Ace- sorry, forgot about this PR 🥇

But it happened 👍

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants