LicensePlist is a command-line tool that automatically generates a Plist of all your dependencies, including files added manually

Last update: May 16, 2022

LicensePlist Logo LicensePlist

Say Thanks!

platforms GitHub license Language: Swift 4.1 Language: Swift 4.2 Language: Swift 5.0 Swift Package Manager compatible

LicensePlist is a command-line tool that automatically generates a Plist of all your dependencies, including files added manually(specified by YAML config file) or using Carthage or CocoaPods. All these licenses then show up in the Settings app.

Flow

Demo

App Setting Root License List License Detail

Installation

CocoaPods (Recommended)

pod 'LicensePlist'
# Installation path: `${PODS_ROOT}/LicensePlist/license-plist`

Homebrew (Also Recommended)

$ brew install mono0926/license-plist/license-plist

Or

$ brew tap mono0926/license-plist
$ brew install license-plist

Mint (Also Recommended)

$ mint run mono0926/LicensePlist

Download the executable binary from Releases

Download from Releases, then copy to /usr/local/bin/license-plist etc.

Or you can also download the latest binary and install it with a one-liner.

$ curl -fsSL https://raw.githubusercontent.com/mono0926/LicensePlist/master/install.sh | sh

From Source

Clone the master branch of the repository, then run make install.

$ git clone https://github.com/mono0926/LicensePlist.git
$ make install

Usage

  1. When you are in the directory that contains your Cartfile or Pods, simply execute license-plist.
  2. com.mono0926.LicensePlist.Output directory will be generated.
  3. Move the files in the output directory into your app's Settings.bundle.
Settings.bundle
├── Root.plist
├── com.mono0926.LicensePlist
│   ├── APIKit.plist
│   ├── Alamofire.plist
│   └── EditDistance.plist
├── com.mono0926.LicensePlist.plist
├── en.lproj
│   └── Root.strings
└── ja.lproj
    └── Root.strings

Options

You can see options by license-plist --help.

--cartfile-path

  • Default: Cartfile

--mintfile-path

  • Default: Mintfile

--pods-path

  • Default: Pods

--package-path

  • Default: Package.swift
  • LicensePlist tries to find YourProjectName.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved and YourProjectName.xcworkspace/xcshareddata/swiftpm/Package.resolved, then uses new one. If you make anothor workspace in custom directory, you can use --package-path PathToYourCustomWorkspace/CustomWorkspaceName.xcworkspace/xcshareddata/swiftpm/Package.swift inside your Run script.

--output-path

  • Default: com.mono0926.LicensePlist.Output
  • Recommended: --output-path YOUR_PRODUCT_DIR/Settings.bundle

--github-token

  • Default: None.
  • LicensePlist uses GitHub API, so sometimes API limit error occures. You can avoid it by using github-token.
  • You can generate token here
    • repo scope is needed.

--config-path

  • Default: license_plist.yml
  • You can specify GitHub libraries(introduced by hand) and excluded libraries

--prefix

  • Default: com.mono0926.LicensePlist
  • You can specify output file names instead of default one.

--html-path

  • Default: None.
  • If this path is specified, a html acknowledgements file will be generated.

--markdown-path

  • Default: None.
  • If this path is specified, a markdown acknowledgements file will be generated.

--force

  • Default: false
  • LicensePlist saves latest result summary, so if there are no changes, the program interrupts.
    • In this case, execution time is less than 100ms for the most case, so you can run LicensePlist at Run Script Phase every time 🎉
  • You can run all the way anyway, by using --force flag.

--add-version-numbers

  • Default: false
  • When the library name is SomeLibrary, by adding --add-version-numbers flag, the name will be changed to SomeLibrary (X.Y.Z).
    • X.Y.Z is parsed from CocoaPods and Cartfile information, and GitHub libraries specified at Config YAML also support this flag.

License list with versions

--suppress-opening-directory

  • Default: false
  • Only when the files are created or updated, the terminal or the finder opens. By adding --suppress-opening-directory flag, this behavior is suppressed.

--single-page

  • Default: false
  • All licenses are listed on a single page, not separated pages.

--fail-if-missing-license

  • Default: false
  • If there is even one package for which a license cannot be found, LicensePlist returns exit code 1.

Integrate into build

Add a Run Script Phase to Build Phases:

if [ $CONFIGURATION = "Debug" ]; then
/usr/local/bin/license-plist --output-path $PRODUCT_NAME/Settings.bundle --github-token YOUR_GITHUB_TOKEN
fi

Run Script Phase

Alternatively, if you've installed LicensePlist via CocoaPods the script should look like this:

if [ $CONFIGURATION = "Debug" ]; then
${PODS_ROOT}/LicensePlist/license-plist --output-path $PRODUCT_NAME/Settings.bundle --github-token YOUR_GITHUB_TOKEN
fi

Q&A

How to generate Xcode project?

Execute swift package generate-xcodeproj or make xcode.


Related Articles


Stargazers over time

Stargazers over time


寄付(Donation)

Donations are welcome if you like LicensePlist 🤗

Send Money by ウォレットアプリ Kyash

Kyash

GitHub

https://github.com/mono0926/LicensePlist
Comments
  • 1. Build fails on Xcode 10.2(Swift 5.0)

    When I run brew upgrade license-plist I get the following error.

    $ brew upgrade license-plist
    ==> Upgrading 1 outdated package:
    mono0926/license-plist/license-plist 2.0.0 -> 2.3.0
    ==> Upgrading mono0926/license-plist/license-plist
    ==> Downloading https://github.com/mono0926/LicensePlist/archive/2.3.0.tar.gz
    Already downloaded: /Users/davidcorbin/Library/Caches/Homebrew/downloads/fdbb23e4cbb10e97c178e8caf0d2aff6be4d3134ecf89b892773398384ccce25--LicensePlist-2.3.0.tar.gz
    ==> make install PREFIX=/usr/local/Cellar/license-plist/2.3.0
    Last 15 lines from /Users/davidcorbin/Library/Logs/Homebrew/license-plist/01.make:
      "_swift_weakInit", referenced from:
          _$s6APIKit7SessionC14cancelRequests4with11passingTestyxm_SbxctAA7RequestRzlF in Session.swift.o
      "_swift_weakLoadStrong", referenced from:
          _$s6APIKit7SessionC14cancelRequests4with11passingTestyxm_SbxctAA7RequestRzlFySayAA0B4Task_pGcfU_SbAaH_pXEfU_ in Session.swift.o
      "_swift_willThrow", referenced from:
          _$s10Foundation4DataV6APIKitE11inputStream8capacityACSo07NSInputE0C_SitKcfCTf4gnd_n in Data+InputStream.swift.o
          _$s6APIKit28FormURLEncodedBodyParametersVAA0dE0A2aDP11buildEntityAA07RequestdG0OyKFTW in FormURLEncodedBodyParameters.swift.o
          _$s6APIKit18JSONBodyParametersV11buildEntityAA011RequestBodyE0OyKF in JSONBodyParameters.swift.o
          _$s6APIKit18JSONBodyParametersVAA04BodyC0A2aDP11buildEntityAA07RequestdF0OyKFTW in JSONBodyParameters.swift.o
          _$s6APIKit31MultipartFormDataBodyParametersVAA0eF0A2aDP11buildEntityAA07RequesteH0OyKFTW in MultipartFormDataBodyParameters.swift.o
          _$s6APIKit31MultipartFormDataBodyParametersV4PartV5value4name8mimeType8fileName8encodingAEyp_S2SSgAKSS10FoundationE8EncodingVtKcfC in MultipartFormDataBodyParameters.swift.o
          _$s6APIKit31MultipartFormDataBodyParametersV4PartV7fileURL4name8mimeType0H4NameAE10Foundation0I0V_S2SSgAMtKcfC in MultipartFormDataBodyParameters.swift.o
          ...
    ld: symbol(s) not found for architecture x86_64
    make: *** [build] Error 1
    
    If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
    https://github.com/mono0926/homebrew-license-plist/issues
    
    
    Reviewed by davidcorbin at 2019-04-03 04:18
  • 2. All generated plist files contain 404 not found

    I use the current version 1.4.5.

    I generate using license-plist. It does find all the use pods as it created all the .plist files e.g. Alamofire.plist.

    However all these pod plist files which should include the licenses just include 404 not found.

    I tried to fix it by using a github token, but this was not the issue and did not help. Any ideas?

    (Yes I have a working internet connection and I can see the license file of alamofire in my browser without any problem)

    Reviewed by funkenstrahlen at 2017-06-02 08:25
  • 3. Can't show license pages under some condition(long license body?) at iPhone X simulator.

    I can't show license pages including apostrophe character at iPhone X simulator. it offen occurs like 'Apache License' pages, it includes the sentences "Don't".

    Reviewed by yhnt at 2017-10-30 03:36
  • 4. In iOS 13.0, the Setting app crashes when trying to open license page

    The same configuration shows list of licenses as expected for iOS 12, but the list is empty in iOS 13 Beta 5.

    After a couple of experiments I found that items on the second level of Settings.bundle appear only if they are "wrapped" into PSGroupSpecifier.

    So beginning of the com.mono0926.LicensePlist should look like:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>PreferenceSpecifiers</key>
    	<array>
    		<dict>
    			<key>Type</key>
    			<string>PSGroupSpecifier</string>
    			<key>Title</key>
    			<string></string>
    			<key>Footer</key>
    			<string></string>
    		</dict>
    		<dict>
    			<key>File</key>
    			<string>com.mono0926.LicensePlist/Alamofire</string>
    			<key>Title</key>
    			<string>Alamofire</string>
    			<key>Type</key>
    			<string>PSChildPaneSpecifier</string>
    		</dict>
    
    Reviewed by OlKir at 2019-08-06 09:09
  • 5. Can not auto generator plist file if only using Cocoapods

    When I try using CocoaPods is Setting.bundle does not the auto-generator. Moreover, in the setting screen, the list of licenses is not displayed. I used this test on swift 3 and it perfectly worked. Can you explain to me? Thanks

    I get a message like below. (This message show when I tried generator plist file from a terminal)

    [2018-12-26T14:16:38.060+09:00] [INFO] Start
    [2018-12-26T14:16:38.076+09:00] [INFO] Pod acknowledgements found: Pods-InsightTests-acknowledgements.plist
    [2018-12-26T14:16:38.076+09:00] [INFO] Pod acknowledgements found: Pods-Insight-acknowledgements.plist
    [2018-12-26T14:16:38.140+09:00] [INFO] Pods License parse start
    [2018-12-26T14:16:38.149+09:00] [WARNING] Not found: Cartfile.resolved -- file:///Users/t_nguyen/Workspace/insight_app_ios/.
    [2018-12-26T14:16:38.150+09:00] [WARNING] Not found: Cartfile -- file:///Users/t_nguyen/Workspace/insight_app_ios/.
    [2018-12-26T14:16:38.150+09:00] [INFO] Carthage License collect start
    [2018-12-26T14:16:38.150+09:00] [INFO] Manual License start
    [2018-12-26T14:16:38.151+09:00] [WARNING] Not found: file:///Users/t_nguyen/Workspace/insight_app_ios/Insight/Insight/Settings.bundle/com.mono0926.LicensePlist.latest_result.txt.
    [2018-12-26T14:16:38.152+09:00] [INFO] Directory created: file:///Users/t_nguyen/Workspace/insight_app_ios/Insight/Insight/Settings.bundle/
    [2018-12-26T14:16:38.180+09:00] [INFO] End
    [2018-12-26T14:16:38.180+09:00] [INFO] ----------Result-----------
    [2018-12-26T14:16:38.181+09:00] [INFO] # Missing license:
    [2018-12-26T14:16:38.181+09:00] [INFO] None 🎉
    
    Reviewed by ga-tungnguyen at 2018-12-26 06:49
  • 6. Remap Name

    Certain pod/repo names are not exactly the most readable, would it be possible to add something to the config which would allow remapping of names?

    rename:
      - randomLib
        name: New Name
    

    Or even maybe just for GitHub repos:

    github:
      - sharethrough/iOS-SDK
        name: "Sharethrough"
      - mono0926/LicensePlist
    

    (Where the latter wouldn't be changed as it doesn't have a name node)

    Reviewed by Sherlouk at 2017-05-08 12:51
  • 7. Listing CocoaPods dependencies not working in CocoaPods 1.6.0.beta.1

    Carthage dependencies have no problem being output, but with Cocoapods, I'm failing on all of my projects.

    I have updated on Homebrew LicensePlist to the latest version along with on my project's Cocoapods.

    I get this error when running license-plist when it's running through my Pods directory:

    [2018-10-17T18:37:15.914-05:00] [INFO] Pod acknowledgements found: Pods-F-xxx-acknowledgements.plist [2018-10-17T18:37:15.914-05:00] [INFO] Pod acknowledgements found: Pods-F-xxx-acknowledgements.plist [2018-10-17T18:37:15.915-05:00] [INFO] Pod acknowledgements found: Pods-xxxExtension-acknowledgements.plist [2018-10-17T18:37:15.918-05:00] [INFO] Pods License parse start [2018-10-17T18:37:15.932-05:00] [ERROR] DecodeError.typeMismatch(expected: Dictionary, actual: , keyPath: KeyPath(["PreferenceSpecifiers"])) [2018-10-17T18:37:15.932-05:00] [ERROR] DecodeError.typeMismatch(expected: Dictionary, actual: , keyPath: KeyPath(["PreferenceSpecifiers"])) [2018-10-17T18:37:15.932-05:00] [ERROR] DecodeError.typeMismatch(expected: Dictionary, actual: , keyPath: KeyPath(["PreferenceSpecifiers"]))

    I'm guessing that something must've changed in Cocoapod's code where LicensePlist isn't ready for such change.

    Reviewed by datureezy at 2018-10-17 23:44
  • 8. Consider architecture

    Reviewed by mono0926 at 2017-04-28 06:56
  • 9. Wrong Docs regarding Package.swift

    When using SPM from Xcode there is no Package.swift as suggested in:

    If you are using Swift Package Manager inside Xcode, you can use --package-path $PROJECT_FILE_PATH/project.xcworkspace/xcshareddata/swiftpm/Package.swift inside your Run script.
    

    What exactly is meant by this? It should be removed imho. When using SPM from Xcode the resolved package info is stored in $PROJECT_FILE_PATH/project.xcworkspace/xcshareddata/swiftpm/Package.resolved and the package info itself in project.pbxproj

    Reviewed by stherold at 2020-09-28 14:13
  • 10. Mapbox license not visible

    Hello there!

    On older iOS versions (tried on iOS 10.3 and 12.1) Mapbox-iOS-SDK license not visible in settings. However scroll view scrolls vertically a lot as if the text is visible actually. When copy paste it to txt file and load it manually from file set in license_plist.yml it is invisible too. In iOS 13 it is displayed ok if not crashing settings app.

    Perhaps there are some illegal characters in the text? Maybe texts should be preparsed escaping such a characters?

    Reviewed by illabo at 2020-08-06 10:25
  • 11. Setup GH Actions

    Based on activity, installing SwiftLint on Linux might not be better than just running it on macOS (it is preinstalled) as it will be cleared from the cache after 2 weeks. (But macOS minutes cost 10x more and macOS runners are more often delayed)

    xcpretty is discontinued, so using xcbeautify instead, which is written in swift, so making bigger improvements to it doesn't require sweating blood.

    Both SwiftLint and xcbeautify will load from cache if saved in a previous run and caching restrictions allow reloading it. https://docs.github.com/en/[email protected]/actions/guides/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache

    Reviewed by Cyberbeni at 2020-12-15 00:24
  • 12. Wrong Package names with Package.resolved JSON version 2

    With the new Package.resolved JSON version 2 (#174), which Apple introduce with Xcode 13.3 and Swift 5.6, I miss the correct package names. The possibility to improve the names is the rename-feature of your tool. Do you have any idea if there is a better way, to get the correct package names? An example:

    // Version 1
    {
      "package": "AppCenter",
      "repositoryURL": "https://github.com/microsoft/appcenter-sdk-apple.git",
      "state": {
        "branch": null,
        "revision": "b84bc8a39ff04bc8d5ae7b4d230c171c562891aa",
        "version": "4.4.1"
      }
    }
    
    // Version 2
    {
      "identity" : "appcenter-sdk-apple",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/microsoft/appcenter-sdk-apple.git",
      "state" : {
        "revision" : "b84bc8a39ff04bc8d5ae7b4d230c171c562891aa",
        "version" : "4.4.1"
      }
    }
    

    Each package name is lowercase. Most package names ends with -sdk, -iOS-sdk or -apple.

    Reviewed by AF-cgi at 2022-03-24 09:15
  • 13. Command PhaseScriptExecution failed with a nonzero exit code

    /bin/sh -c /Users/ying/Library/Developer/Xcode/DerivedData/Swift_Boilerplate-ajvvszjgkekqykaepbzzuubejepy/Build/Intermediates.noindex/Swift\\\ Boilerplate.build/Debug-iphonesimulator/Swift\\\ Boilerplate.build/Script-2E406B8E27B3AAD300C9C0AE.sh
    
    Error: Unexpected argument 'Boilerplate/Settings.bundle'
    Usage: license-plist <options>
      See 'license-plist --help' for more information.
    Command PhaseScriptExecution failed with a nonzero exit code
    
    Reviewed by see at 2022-02-09 08:09
  • 14. Doesn't work behind proxy

    I can't get the tool to run behind a proxy. I've installed it via brew and all other terminal commands such as curl and ping work in my environment. Does it not support environment variables such as HTTP_PROXY?

    Reviewed by mudkiplex at 2021-09-30 14:23
  • 15. Licenses do not appear in .plist if repo URL ends in a slash

    I have an app that uses https://github.com/marmelroy/PhoneNumberKit via SPM.

    LicensePlist's output does not include the license for this libraries, while all others I'm using do show up, and I can't immediately see a difference from that library's setup from any others.

    In the generated latest_results.txt File, I have this snippet that looks suspicious to me:

    name: Zip, nameSpecified: 
    body: The MIT License (MIT…
    version: 2.1.1
    
    name: , nameSpecified: PhoneNumberKit, owner: PhoneNumberKit, version: 3.3.3
    
    name: abseil-cpp-SwiftPM, nameSpecified: abseil, owner: firebase, version: 0.20200225.4
    

    (the entry for PhoneNumberKit is the only one that does not have a name)

    Reviewed by gereons at 2021-09-14 10:40
  • 16. Unclear if SPM is supported

    I am now using Swift Package Manager (SPM) instead of Cocoapods to add dependencies and would like to know if this library supports generating licences plist based on the SPM dependencies that I use.

    I think that this library supports SPM based on going through the issues, but this is not mentioned at all in the README.md.

    It would be great if the README.md could be updated with clear instructions in how to use this library with SPM. Only Cocoapods and Carthage are currently mentioned at the moment.

    Reviewed by pepejeria at 2021-04-09 07:30
BulletinBoard is an iOS library that generates and manages contextual cards displayed at the bottom of the screen
BulletinBoard is an iOS library that generates and manages contextual cards displayed at the bottom of the screen

BulletinBoard is an iOS library that generates and manages contextual cards displayed at the bottom of the screen. It is especially well

May 14, 2022
URLEmbeddedView automatically caches the object that is confirmed the Open Graph Protocol.
URLEmbeddedView automatically caches the object that is confirmed the Open Graph Protocol.

URLEmbeddedView Features Simple interface for fetching Open Graph Data Be able to display Open Graph Data Automatically caching Open Graph Data Automa

May 15, 2022
An iOS picker view to serve all your "picking" needs
An iOS picker view to serve all your

Mandoline The PickerView is a UICollectionView that provides a smooth "picking" interface. In order to get the most out of it, a consuming view contro

May 3, 2022
Lightweight touch visualization library in Swift. A single line of code and visualize your touches!
Lightweight touch visualization library in Swift. A single line of code and visualize your touches!

TouchVisualizer is a lightweight pure Swift implementation for visualising touches on the screen. Features Works with just a single line of code! Supp

May 13, 2022
A few drop-in SwiftUI components for easily importing and thumb-nailing files

FilesUI A few drop-in SwiftUI components for easily importing and thumb-nailing files Usage 1. Import Files To import files you can use the FileImport

Apr 15, 2022
Fetch the star wars api from all the planets and list and show details using Swift UI and Combine

Star Wars Planets Fetch the star wars planet data by using stat war api, list and show details using SwiftUI and Combine frameworks ?? Swift UI Framew

Nov 15, 2021
A nice iOS View Capture Swift Library which can capture all content.
A nice iOS View Capture Swift Library which can capture all content.

SwViewCapture A nice iOS View Capture Library which can capture all content. SwViewCapture could convert all content of UIWebView to a UIImage. 一个用起来还

Apr 8, 2022
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

May 12, 2022
Circular progress indicator for your macOS app
Circular progress indicator for your macOS app

CircularProgress Circular progress indicator for your macOS app This package is used in production by apps like Gifski and HEIC Converter. Requirement

May 22, 2022
Show progress in your app's Dock icon
Show progress in your app's Dock icon

DockProgress Show progress in your app's Dock icon This package is used in production by the Gifski app. You might also like some of my other apps. Re

May 13, 2022
A child view controller framework that makes setting up your parent controllers as easy as pie.
A child view controller framework that makes setting up your parent controllers as easy as pie.

Description Family is a child view controller framework that makes setting up your parent controllers as easy as pie. With a simple yet powerful publi

Apr 23, 2022
Fashion is your helper to share and reuse UI styles in a Swifty way.
Fashion is your helper to share and reuse UI styles in a Swifty way.

Fashion is your helper to share and reuse UI styles in a Swifty way. The main goal is not to style your native apps in CSS, but use a set

May 13, 2022
A fancy hexagonal layout for displaying data like your Apple Watch
A fancy hexagonal layout for displaying data like your Apple Watch

Hexacon is a new way to display content in your app like the Apple Watch SpringBoard Highly inspired by the work of lmmenge. Special thanks to zenly f

May 11, 2022
⚙ Add a preferences window to your macOS app in minutes
⚙ Add a preferences window to your macOS app in minutes

Preferences Add a preferences window to your macOS app in minutes Just pass in some view controllers and this package will take care of the rest. Requ

May 24, 2022
Custom emojis are a fun way to bring more life and customizability to your apps.
Custom emojis are a fun way to bring more life and customizability to your apps.

Custom emojis are a fun way to bring more life and customizability to your apps. They're available in some of the most popular apps, such as Slack, Di

Apr 2, 2022
Twinkle is a Swift and easy way to make any UIView in your iOS or tvOS app twinkle.
Twinkle is a Swift and easy way to make any UIView in your iOS or tvOS app twinkle.

Twinkle ✨ Twinkle is a Swift and easy way to make any UIView in your iOS or tvOS app twinkle. This library creates several CAEmitterLayers and animate

May 18, 2022
Zeplin component preview for your SwiftUI views
Zeplin component preview for your SwiftUI views

A Zeplin component preview for your SwiftUI views. You can use Zeplin components instead of real views within your app until you implement them.

Oct 20, 2021
Easily use UIKit views in your SwiftUI applications. Create Xcode Previews for UIView elements
Easily use UIKit views in your SwiftUI applications. Create Xcode Previews for UIView elements

SwiftUIKitView Easily use UIKit views in SwiftUI. Convert UIView to SwiftUI View Create Xcode Previews from UIView elements SwiftUI functional updatin

May 12, 2022
Confetti View lets you create a magnificent confetti view in your app
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

Feb 2, 2022