Skip to content
Download Licenses for Carthage
Branch: master
Clone or download
pietbrauer Merge pull request #10 from florianalbrecht/master
Filter non-github lines when parsing Cartfile
Latest commit 7a88141 Mar 4, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Jul 29, 2015 [readme] set swift 2 badge Feb 20, 2016
fetch_licenses.swift Filter non-github lines when parsing Cartfile Mar 2, 2018

Download Licenses for Carthage

Carthage Compatibility Swift License ![Platform]( X-lightgrey.svg) @pietbrauer

To display open source licenses for your dependencies it can be very cumbersome to download each dependency by hand.

CocoaPods does it automatically, but if you are using Carthage there is no such option.

You can simply add this script to your project (by downloading) or use it as a submodule or subtree.


I won't recommend running it as a build phase, but rather checking the generated .plist into your project.

You can execute this script by running:

$ ./PATH_TO_YOUR_SCRIPT/fetch_licenses.swift Cartfile.resolved  OUTPUT_DIR

It takes 2 simple arguments:

Argument Explanation
Cartfile.resolved Path to your Cartfile.resolved
OUTPUT_DIR Path to the directory you want the Licenses.plist saved to

Example output

If everything goes well you will see something like:

$ ./fetch_licenses.swift ../Git2Go/Cartfile.resolved ../Git2Go/
Fetching licenses for Mantle/Mantle ...
Fetching licenses for nerdishbynature/OpenSSL ...
Fetching licenses for ReactiveCocoa/ReactiveCocoa ...
Fetching licenses for soffes/SSKeychain ...
Fetching licenses for nerdishbynature/ios-snapshot-test-case ...
Fetching licenses for libgit2/objective-git ...
Fetching licenses for nerdishbynature/ocmock ...
Fetching licenses for octokit/octokit.objc ...
Super awesome! Your licenses are at ../Git2Go/Licenses.plist 🍻
You can’t perform that action at this time.