A dart package to download the licenses for al the packages used.
dev-dependencies:
license_generator: <latest-version>
license_generator:
fail_fast: true/false #(optional) Errors are not ignored and the generator will fail with an error
license_generator:
fail_fast: boolean #(optional) if true the `check` command will fail at the first version missmatch. If false you will receive a list at the end of the command. -> Default: false
check_before_generate: boolean #(optional) If true the `generate` command will check if your pubspec.yaml & pubspec.lock are in sync before generating the code -> Default: false
output_path: String #(optional) Override the default output path to generate the license file somewhere else -> Default: lib/util/license.dart
download_pub_dev_details: bool #(optional) If ture the `generate` command will download the pubdev details (homepage/repository) -> Default: false
pub_dev_base_url: String #(optional) This will override the default pubdev base url for downloading the pubdev details (homepage/repository) -> Default: https://pub.dev
licenses: #(optional) This will accept key value pairs (String/String) -> (package name/raw license url)
#license_generator: https://raw.githubusercontent.com/icapps/flutter-icapps-license/master/LICENSE (example)
extra_licenses: #(optional) this will allow you to add extra licenses that are not added in your pubspec.yaml
something_something: #the name of your package will be used if `name` is not specified
name: String #(optional) This will override your package name
version: String #(optional) The version of this specific package/license
homepage: String #(optional) The url of the homepage of this package
repository: String #(optional) The url where the repository is located
license: String #(required) This can be an http/https url or a path to a specific file. The content of that url/path will be used to generate code.
dev_dependency: boolean #(optional) This is used internally
part_of_flutter_sdk: boolean #(optional) This will use the flutter license instead of the license specified in this map
flutter packages pub run license_generator
pub run license_generator check
pub run license_generator generate
Info is the default and is not required to pass.
pub run license_generator generate
is the same as
pub run license_generator generate info
Debug will log more info te find out why the license_generator is failing. Stacktraces & errors will be shown. Info logs will also be shown.
pub run license_generator generate debug
Verbose will log everything. Downloading files & their status. Debug & info will also be shown.
pub run license_generator generate verbose
add this to you .bash_profile
flutterlicensecheck(){
flutter packages get && flutter packages pub run license_generator check
}
flutterlicense(){
flutter packages get && flutter packages pub run license_generator generate
}
now you can use the license_generate with a single command.
flutterlicense
And to check if everything is up to date use:
flutterlicensecheck