<commit_before><img src="LicensePlist.png" width="200" height="200" alt="LicensePlist Logo"> LicensePlist
======================================

[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/mono0926)

![platforms](https://img.shields.io/badge/platforms-iOS-333333.svg)
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/mono0926/NativePopup/master/LICENSE)
[![Language: Swift 4.1](https://img.shields.io/badge/swift-4.1-4BC51D.svg?style=flat)](https://developer.apple.com/swift)
[![Language: Swift 4.2](https://img.shields.io/badge/swift-4.2-4BC51D.svg?style=flat)](https://developer.apple.com/swift)
[![Language: Swift 5.0](https://img.shields.io/badge/swift-5.0-4BC51D.svg?style=flat)](https://developer.apple.com/swift)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)

`LicensePlist` is a command-line tool that automatically generates a Plist of all your dependencies, including files added manually(specified by [YAML config file](https://github.com/mono0926/LicensePlist/blob/master/Tests/LicensePlistTests/Resources/license_plist.yml)) or using `Carthage` or `CocoaPods`. All these licenses then show up in the Settings app.

![Flow](Screenshots/flow.png)

![Demo](https://github.com/mono0926/Resource/raw/master/LicensePlist/LicensePlist.gif)

| App Setting Root          | License List              | License Detail              |
| ------------------------- | ------------------------- | --------------------------- |
| ![](Screenshots/root.png) | ![](Screenshots/list.png) | ![](Screenshots/detail.png) |

## Installation


### CocoaPods (Recommended)

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

### Homebrew (Also Recommended)

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

Or

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

### Mint (Also Recommended)
```sh
$ mint run mono0926/LicensePlist
```

### Download the executable binary from [Releases](https://github.com/mono0926/LicensePlist/releases)

Download from [Releases](https://github.com/mono0926/LicensePlist/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.

```sh
$ 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`.

```sh
$ 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's sample is here](Settings.bundle.zip)
    - The point is to [specify `com.mono0926.LicensePlist` as license list file on your `Root.plist`](https://github.com/mono0926/LicensePlist/blob/master/Settings.bundle/Root.plist#L19).

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

#### `--output-path`<commit_msg>Update README.<commit_after><img src="LicensePlist.png" width="200" height="200" alt="LicensePlist Logo"> LicensePlist
======================================

[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/mono0926)

![platforms](https://img.shields.io/badge/platforms-iOS-333333.svg)
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/mono0926/NativePopup/master/LICENSE)
[![Language: Swift 4.1](https://img.shields.io/badge/swift-4.1-4BC51D.svg?style=flat)](https://developer.apple.com/swift)
[![Language: Swift 4.2](https://img.shields.io/badge/swift-4.2-4BC51D.svg?style=flat)](https://developer.apple.com/swift)
[![Language: Swift 5.0](https://img.shields.io/badge/swift-5.0-4BC51D.svg?style=flat)](https://developer.apple.com/swift)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)

`LicensePlist` is a command-line tool that automatically generates a Plist of all your dependencies, including files added manually(specified by [YAML config file](https://github.com/mono0926/LicensePlist/blob/master/Tests/LicensePlistTests/Resources/license_plist.yml)) or using `Carthage` or `CocoaPods`. All these licenses then show up in the Settings app.

![Flow](Screenshots/flow.png)

![Demo](https://github.com/mono0926/Resource/raw/master/LicensePlist/LicensePlist.gif)

| App Setting Root          | License List              | License Detail              |
| ------------------------- | ------------------------- | --------------------------- |
| ![](Screenshots/root.png) | ![](Screenshots/list.png) | ![](Screenshots/detail.png) |

## Installation


### CocoaPods (Recommended)

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

### Homebrew (Also Recommended)

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

Or

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

### Mint (Also Recommended)
```sh
$ mint run mono0926/LicensePlist
```

### Download the executable binary from [Releases](https://github.com/mono0926/LicensePlist/releases)

Download from [Releases](https://github.com/mono0926/LicensePlist/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.

```sh
$ 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`.

```sh
$ 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's sample is here](Settings.bundle.zip)
    - The point is to [specify `com.mono0926.LicensePlist` as license list file on your `Root.plist`](https://github.com/mono0926/LicensePlist/blob/master/Settings.bundle/Root.plist#L19).

```
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`
{'fraction_non_alphanumeric': 0.1884272997032641, 'fraction_numerical': 0.02695351137487636, 'mean_word_length': 4.235598705501618, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 40, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '273855', 'n_tokens_mistral': 2978, 'n_tokens_neox': 2671, 'n_words': 554}