mono0926 / LicensePlist

A license list generator of all your dependencies for iOS applications
https://www.slideshare.net/mono0926/licenseplist-a-license-list-generator-of-all-your-dependencies-for-ios-applications
MIT License
2.43k stars 146 forks source link

Duplicate the parameters inside license_plist.yml #207

Closed vladvlasov256 closed 1 year ago

vladvlasov256 commented 1 year ago

Motivation

I believe one day this helpful tool can be used as a Build Tool Plugin in Xcode. Nowadays Xcode doesn't support command line arguments for build tool plugins. But such tools easily can use configuration files.

Solution

We can store an options dictionary in the YAML config with all the main attributes. Also, let's override them if user specifies command-line arguments.

# General options
options:
  outputPath: "./com.mono0926.LicensePlist.Output"
  cartfilePath: Cartfile
  mintfilePath: Mintfile
  podsPath: Pods
  packagePaths:
    - Package.swift
  xcodeprojPath: "*.xcodeproj"
  xcworkspacePath: "*.xcworkspace"
  prefix: com.mono0926.LicensePlist
  gitHubToken: YOUR_GITHUB_TOKEN
  htmlPath: acknowledgements.html
  markdownPath: acknowledgements.md
  force: false
  addVersionNumbers: false
  suppressOpeningDirectory: false
  singlePage: false
  failIfMissingLicense: false
  addSources: false

Some options could be skipped:

The config parsing should be logged with a proper log level thus we can't get it from the config file.

Fixes:

vladvlasov256 commented 1 year ago

A little note about testInit_sample(). It fails by design because it's fetching the original config and should be ok after merging.

I can hardcode a link to my repo but before merging it should be changed to the original one. So I left it as is after testing locally.

mono0926 commented 1 year ago

@vladvlasov256

Sorry for the delay in response, but merged and released: https://github.com/mono0926/LicensePlist/releases/tag/3.24.1

Thank you for your pull request 🙏