Search code examples
ioscocoapodspodspec

Is there a way to fetch all license header from Cocoapods


I use Cocoapods to integrate my workspace. I have about 45 pods that I use in my project. I would like to attribute all the license headers and was wondering is there a way I can fetch and concatenate all the headers or should I do it manually?


Solution

  • A file with this information is actually generated by default by CocoaPods. This file is generated under Pods/Target Support Files/Pods/Pods-Acknowledgements.plist. You can then add a post_install hook in your Podfile to copy this to somewhere where you can use it. Here's the official example:

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

    Read all about this on the wiki page