flutter_oss_licenses 0.4.1

Introduction #

flutter_oss_licenses is a tool for generating OSS license list using pubspec.lock.

Installing #

Adding the package name to dev_dependencies; not to dependencies because the package does nothing on runtime.

dev_dependencies:
  flutter_oss_licenses: ^0.1.0

Generate oss_licenses.dart #

Before executing the command, you must update your pubspec.lock using pub get (or pub upgrade if you want).

$ flutter pub get

And then, the following command generates oss_licenses.dart on the project's lib/ directory:

$ flutter pub run flutter_oss_licenses:generate.dart

The file structure #

The generated file contains a simple Map<String, String> that maps each project name to its corresponding license text, that is normally provided by LICENSE file on the project:

Map<String, String> oss_licenses = {
  'some_project': '''Copyright 201X Some Project Owners. All rights reserved.''',
  'another_project': '''Another project's license terms...''',
  ...
};

And, you can use the map on your project code in your way. The package does not do anything on the list.

Command line options #

Either running generate.dart using pub run or directly, it accepts two or less options. The first option is output dart file name. The default is lib/oss_licenses.dart. And the another is project root, which is by default detected automatically.

$ generate.dart [OUTPUT_FILENAME [PROJECT_ROOT]]

The bin/generated.dart uses two environment variables; one is FLUTTER_ROOT and PUB_CACHE. They are normally set by flutter pub run but if you directly execute the script, you must set them manually.

Reporting issues #

Report any bugs on the project's issues.

URLs #

0.4.1 #

FIXED: Generation process stops if PUB_CACHE is not explicitly defined.

0.3.0 #

Loosen version restriction on dependency packages because it conflicts with certain well-used packages.

0.2.0 #

Addresses facial things warned by pub.dev's health suggestions.

0.1.0 #

First rlease.

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate flutter_oss_licenses

2. Use it

The package has the following executables:


$ generate
Popularity:
Describes how popular the package is relative to other packages. [more]
38
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
98
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Aug 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Health suggestions

Fix bin/generate.dart. (-0.50 points)

Analysis of bin/generate.dart reported 1 hint:

line 22 col 28: Use isNotEmpty instead of length

Maintenance suggestions

The package description is too short. (-2 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
meta ^1.1.0 1.1.7
path ^1.4.0 1.6.4
yaml ^2.1.0 2.1.16
Transitive dependencies
charcode 1.1.2
collection 1.14.12
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0