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

Overview

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

Comments
  • Build fails on Xcode 10.2(Swift 5.0)

    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
    
    
    opened by davidcorbin 18
  • All generated plist files contain 404 not found

    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)

    opened by funkenstrahlen 13
  • Can't show license pages under some condition(long license body?) at iPhone X simulator.

    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".

    help wanted 
    opened by yhnt 12
  • In iOS 13.0, the Setting app crashes when trying to open license page

    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>
    
    opened by OlKir 10
  • Can not auto generator plist file if only using Cocoapods

    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 🎉
    
    opened by ga-tungnguyen 10
  • Remap Name

    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)

    enhancement 
    opened by Sherlouk 10
  • Wrong Package names with Package.resolved JSON version 2

    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.

    opened by AF-cgi 8
  • Listing CocoaPods dependencies not working in CocoaPods 1.6.0.beta.1

    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.

    invalid wontfix 
    opened by ghost 8
  • Consider architecture

    Consider architecture

    opened by mono0926 8
  • Wrong Docs regarding Package.swift

    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

    opened by stherold 7
  • Mapbox license not visible

    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?

    opened by illabo 7
  • Command PhaseScriptExecution failed with a nonzero exit code

    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
    
    opened by kw214 0
  • Doesn't work behind proxy

    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?

    opened by mudkiplex 1
  • Unclear if SPM is supported

    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.

    opened by pepejeria 12
  • Support for multiple targets?

    Support for multiple targets?

    Is there an option for generating licenses by target? Currently, all dependencies end up in all targets:

    • Target A, depends on DependencyA
    • Target B, depends on DependencyB

    The generated license plist will contain both DependencyA and DependencyB for both targets.

    opened by xavierLowmiller 2
Releases(3.23.4)
Owner
Masayuki Ono (mono)
Software Engineer (Flutter/Dart, Firebase/GCP, iOS/Swift, TypeScript)
Masayuki Ono (mono)
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

Alexis (Aubry) Akers 5.3k Jan 2, 2023
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

Taiki Suzuki 643 Dec 20, 2022
An iOS picker view to serve all your "picking" needs

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

Blue Apron 883 Nov 28, 2022
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

Morita Naoki 851 Dec 17, 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

Brianna Zamora 3 Oct 19, 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

null 1 Aug 10, 2022
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. 一个用起来还

Xing Chen 597 Nov 22, 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.

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

Jogendra 1.4k Jan 4, 2023
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

Sindre Sorhus 520 Jan 3, 2023
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

Sindre Sorhus 958 Jan 2, 2023
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

Christoffer Winterkvist 246 Dec 28, 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. The main goal is not to style your native apps in CSS, but use a set

Vadym Markov 124 Nov 20, 2022
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

Gautier Gédoux 340 Dec 4, 2022
⚙ 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

Sindre Sorhus 1.2k Jan 6, 2023
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

Stream 244 Dec 11, 2022
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

patrick piemonte 600 Nov 24, 2022
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.

Danis Tazetdinov 4 Sep 1, 2022
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

Antoine van der Lee 682 Dec 29, 2022
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

Or Ron 234 Nov 22, 2022