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

Automating Pods-Acknowledgements.plist copy #20

Closed
billyto opened this issue Apr 10, 2014 · 11 comments
Closed

Automating Pods-Acknowledgements.plist copy #20

billyto opened this issue Apr 10, 2014 · 11 comments

Comments

@billyto
Copy link

billyto commented Apr 10, 2014

If you want to automatically copy Pods-Acknowledgements, there are two options:

Add a hook to the Podfile:

post_install do | installer |
    require 'fileutils'
    FileUtils.cp_r('Pods/Pods-Acknowledgements.plist', 'Pods-Acknowledgements.plist', :remove_destination => true)
end

or

Add a new run script build phase at the end of your target build phases with the following line:

cp ${SRCROOT}/Pods/Pods-acknowledgements.plist ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Pods-acknowledgements.plist
@billyto billyto changed the title Automating Pods-Acknowledgements.plist Automating Pods-Acknowledgements.plist copy Apr 10, 2014
@albertschulz
Copy link

Really nice :)

@vtourraine
Copy link
Owner

Thanks a lot for these instructions, they’re definitely useful. I’ve added a mention to this “issue” in the project readme, so I’ll close it.

Ideally, these instructions should be located inside the podspec file itself, and I’m still looking for a way to achieve this. AFAIK, that’s not possible with the current CocoaPods, but it is on the roadmap. I guess I’ll give this pod a “1.0” version tag as soon as it gets implemented.

@stevemoser
Copy link

Any way to put the target name in the filename automagically so it picks up plists with 'fancy' names?

@vtourraine
Copy link
Owner

@stevemoser Hum, I guess we could parse the content of the app bundle, and look for files with names ending with “-acknowledgements.plist”. I’ll put that in the next version, if that sounds good.

@lukaskollmer
Copy link

That's really cool!

@lukaskollmer
Copy link

With CocoaPods version 0.34, the path to the Pods-Acknowledgements.plist file changed. It is now Pods/Target Support Files/Pods/Pods-acknowledgements.plist

@Ricardo1980
Copy link

Thanks @lukaskollmer for the info!

@andrew-frank
Copy link

In run script phase, don't forget the quotation marks! In case of CocoaPods ver. 0.34 it should be like:

cp "${SRCROOT}/Pods/Target Support Files/Pods/Pods-acknowledgements.plist" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Pods-acknowledgements.plist"

@natanrolnik
Copy link

Adding a hook to the Podfile changed, and it should be:

post_install do | installer |
    require 'fileutils'
    FileUtils.cp_r('Pods/Target Support Files/Pods/Pods-Acknowledgements.plist', 'Pods-Acknowledgements.plist', :remove_destination => true)
end

I think it's worth not only mentioning this issue, but also inserting these instructions in the Read Me. @vtourraine if you agree, I can do a PR.

@Perjan
Copy link

Perjan commented Aug 19, 2016

Guys, these don't work anymore since cocoapods v1.0.0, because of the "abstract_target" definition.

@lolgear
Copy link

lolgear commented Dec 19, 2016

anybody, how does it help to copy acknowledgements to project directory? Which of scripts in build target would put this file in archive/app on archive/build action?

Answer: your hands :/

BTW

def after_install_section(target_name)
    # pod acknowledgements section
    require 'fileutils'
    file = %Q'Pods-#{target_name}-acknowledgements.plist'
    from = %Q'Pods/Target Support Files/Pods-#{target_name}/'
    to = %Q'Custom/Resources/Pods/'
    FileUtils.cp_r(from + file, to + file, :remove_destination => true)
end

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

No branches or pull requests

10 participants