licensed 0.11.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +13 -4
- data/.rubocop.yml +3 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +13 -0
- data/CODE_OF_CONDUCT.md +14 -12
- data/CONTRIBUTING.md +51 -0
- data/Gemfile +2 -1
- data/{LICENSE.txt → LICENSE} +1 -1
- data/README.md +55 -76
- data/Rakefile +3 -2
- data/docs/configuration.md +131 -0
- data/docs/sources/bower.md +5 -0
- data/docs/sources/bundler.md +7 -0
- data/docs/sources/cabal.md +39 -0
- data/docs/sources/go.md +12 -0
- data/docs/sources/manifests.md +26 -0
- data/docs/sources/npm.md +3 -0
- data/docs/sources/stack.md +3 -0
- data/exe/licensed +1 -0
- data/lib/licensed.rb +9 -5
- data/lib/licensed/cli.rb +22 -14
- data/lib/licensed/command/cache.rb +46 -29
- data/lib/licensed/command/list.rb +17 -9
- data/lib/licensed/command/status.rb +78 -0
- data/lib/licensed/configuration.rb +127 -25
- data/lib/licensed/dependency.rb +8 -2
- data/lib/licensed/git.rb +39 -0
- data/lib/licensed/license.rb +1 -0
- data/lib/licensed/shell.rb +28 -0
- data/lib/licensed/source/bower.rb +4 -0
- data/lib/licensed/source/bundler.rb +4 -0
- data/lib/licensed/source/cabal.rb +72 -24
- data/lib/licensed/source/go.rb +23 -36
- data/lib/licensed/source/manifest.rb +26 -23
- data/lib/licensed/source/npm.rb +19 -8
- data/lib/licensed/ui/shell.rb +2 -1
- data/lib/licensed/version.rb +2 -1
- data/licensed.gemspec +9 -5
- data/{bin/setup → script/bootstrap} +13 -8
- data/script/cibuild +7 -0
- data/{bin → script}/console +1 -0
- metadata +53 -158
- data/.bowerrc +0 -3
- data/exe/licensor +0 -5
- data/lib/licensed/command/verify.rb +0 -73
- data/lib/licensed/source/stack.rb +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef8089cc373cef406eedfd056eeac368a466eaf0
|
4
|
+
data.tar.gz: 719ee8e1f6a6c5012f8c48c4bd517ddfbc57c95f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1455873b445ccfdc882750627b7680ff4e062b99d815b1eb21d673b6461dcc08bc6f6e8dc1b2018476f48f61fa1d9d18c314047c14f4d5c0afc66f2edae1b33
|
7
|
+
data.tar.gz: 18c392f7cacd7199543acdbea24d203bc8196ec14122c70bbcb0bf2f8c184f02a1a18526d93bda03742219f4d28bb0f8998090bafcf5122f5410ebed5dd611db
|
data/.gitignore
CHANGED
@@ -7,11 +7,20 @@
|
|
7
7
|
/pkg/
|
8
8
|
/spec/reports/
|
9
9
|
/tmp/
|
10
|
-
|
11
|
-
test
|
10
|
+
|
11
|
+
# test fixtures
|
12
|
+
test/fixtures/bundler/.bundle/
|
13
|
+
test/fixtures/bundler/vendor/
|
14
|
+
test/fixtures/bundler/Gemfile.lock
|
15
|
+
test/fixtures/bower/bower_components
|
16
|
+
test/fixtures/npm/node_modules
|
17
|
+
test/fixtures/npm/package-lock.json
|
12
18
|
test/fixtures/go/src/*
|
19
|
+
test/fixtures/go/pkg
|
13
20
|
!test/fixtures/go/src/test
|
14
|
-
test
|
15
|
-
|
21
|
+
test/fixtures/haskell/dist*
|
22
|
+
|
16
23
|
vendor/licenses
|
24
|
+
.licenses
|
17
25
|
*.gem
|
26
|
+
vendor/gems
|
data/.rubocop.yml
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.0
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
## 1.0.0 - 2018-??-??
|
10
|
+
|
11
|
+
Initial release :tada:
|
12
|
+
|
13
|
+
[Unreleased]: https://github.com/github/licensed/compare/v1.0.0...HEAD
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
Contributor Covenant Code of Conduct
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
|
-
Our Pledge
|
3
|
+
## Our Pledge
|
4
4
|
|
5
5
|
In the interest of fostering an open and welcoming environment, we as
|
6
6
|
contributors and maintainers pledge to making participation in our project and
|
7
7
|
our community a harassment-free experience for everyone, regardless of age, body
|
8
8
|
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race,
|
10
|
-
orientation.
|
9
|
+
education, socio-economic status, nationality, personal appearance, race,
|
10
|
+
religion, or sexual identity and orientation.
|
11
11
|
|
12
|
-
Our Standards
|
12
|
+
## Our Standards
|
13
13
|
|
14
14
|
Examples of behavior that contributes to creating a positive environment
|
15
15
|
include:
|
@@ -23,7 +23,7 @@ include:
|
|
23
23
|
Examples of unacceptable behavior by participants include:
|
24
24
|
|
25
25
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
26
|
+
advances
|
27
27
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
28
|
* Public or private harassment
|
29
29
|
* Publishing others' private information, such as a physical or electronic
|
@@ -31,7 +31,7 @@ advances
|
|
31
31
|
* Other conduct which could reasonably be considered inappropriate in a
|
32
32
|
professional setting
|
33
33
|
|
34
|
-
Our Responsibilities
|
34
|
+
## Our Responsibilities
|
35
35
|
|
36
36
|
Project maintainers are responsible for clarifying the standards of acceptable
|
37
37
|
behavior and are expected to take appropriate and fair corrective action in
|
@@ -43,7 +43,7 @@ that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
43
|
permanently any contributor for other behaviors that they deem inappropriate,
|
44
44
|
threatening, offensive, or harmful.
|
45
45
|
|
46
|
-
Scope
|
46
|
+
## Scope
|
47
47
|
|
48
48
|
This Code of Conduct applies both within project spaces and in public spaces
|
49
49
|
when an individual is representing the project or its community. Examples of
|
@@ -52,7 +52,7 @@ address, posting via an official social media account, or acting as an appointed
|
|
52
52
|
representative at an online or offline event. Representation of a project may be
|
53
53
|
further defined and clarified by project maintainers.
|
54
54
|
|
55
|
-
Enforcement
|
55
|
+
## Enforcement
|
56
56
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
58
|
reported by contacting the project team at opensource+licensed@github.com. All
|
@@ -65,7 +65,9 @@ Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
65
|
faith may face temporary or permanent repercussions as determined by other
|
66
66
|
members of the project's leadership.
|
67
67
|
|
68
|
-
Attribution
|
68
|
+
## Attribution
|
69
69
|
|
70
|
-
This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
|
71
|
-
available at
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
+
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
## Contributing
|
2
|
+
|
3
|
+
[fork]: https://github.com/github/licensed/fork
|
4
|
+
[pr]: https://github.com/github/licensed/compare
|
5
|
+
[style]: https://github.com/styleguide/ruby
|
6
|
+
[code-of-conduct]: CODE_OF_CONDUCT.md
|
7
|
+
|
8
|
+
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
|
9
|
+
|
10
|
+
Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms.
|
11
|
+
|
12
|
+
## Submitting a pull request
|
13
|
+
|
14
|
+
0. [Fork][fork] and clone the repository
|
15
|
+
0. Configure and install the dependencies: `script/bootstrap`
|
16
|
+
0. Make sure the tests pass on your machine: `rake`
|
17
|
+
0. Create a new branch: `git checkout -b my-branch-name`
|
18
|
+
0. Make your change, add tests, and make sure the tests still pass
|
19
|
+
0. Push to your fork and [submit a pull request][pr]
|
20
|
+
0. Pat your self on the back and wait for your pull request to be reviewed and merged.
|
21
|
+
|
22
|
+
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
|
23
|
+
|
24
|
+
- Follow the [style guide][style].
|
25
|
+
- Write tests.
|
26
|
+
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
|
27
|
+
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
28
|
+
|
29
|
+
## Releasing
|
30
|
+
If you are the current maintainer of this gem:
|
31
|
+
|
32
|
+
1. Create a branch for the release: git checkout -b cut-release-vxx.xx.xx
|
33
|
+
2. Make sure your local dependencies are up to date: script/bootstrap
|
34
|
+
3. Ensure that tests are green: bundle exec rake test
|
35
|
+
4. Bump gem version in lib/licensed/version.rb.
|
36
|
+
5. Update [`CHANGELOG.md`](CHANGELOG.md)
|
37
|
+
6. Make a PR to github/licensed.
|
38
|
+
7. Build a local gem: bundle exec rake build
|
39
|
+
8. Test the gem:
|
40
|
+
1. Bump the Gemfile and Gemfile.lock versions for an app which relies on this gem
|
41
|
+
2. Install the new gem locally
|
42
|
+
3. Test behavior locally, branch deploy, whatever needs to happen
|
43
|
+
9. Merge github/licensed PR
|
44
|
+
10. Tag and push: git tag vx.xx.xx; git push --tags
|
45
|
+
11. Push to rubygems.org -- gem push licensed-x.xx.xx.gem
|
46
|
+
|
47
|
+
## Resources
|
48
|
+
|
49
|
+
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
|
50
|
+
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
|
51
|
+
- [GitHub Help](https://help.github.com)
|
data/Gemfile
CHANGED
data/{LICENSE.txt → LICENSE}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2015 GitHub, Inc. and contributors
|
3
|
+
Copyright (c) 2015-2018 GitHub, Inc. and contributors
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Licensed
|
2
2
|
|
3
|
-
Licensed is a Ruby gem to cache
|
3
|
+
Licensed is a Ruby gem to cache the licenses of dependencies and check their status.
|
4
|
+
|
5
|
+
Licensed is **not** a complete open source license compliance solution. Please understand the important [disclaimer](#disclaimer) below to make appropriate use of Licensed.
|
6
|
+
|
7
|
+
## Current Status
|
8
|
+
|
9
|
+
Licensed is in active development and currently used at GitHub. See the [open issues](https://github.com/github/licensed/issues) for a list of potential work.
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -12,27 +18,37 @@ gem 'licensed', :group => 'development'
|
|
12
18
|
|
13
19
|
And then execute:
|
14
20
|
|
15
|
-
|
21
|
+
```bash
|
22
|
+
$ bundle
|
23
|
+
```
|
24
|
+
|
25
|
+
#### Dependencies
|
26
|
+
|
27
|
+
Licensed uses the the `libgit2` bindings for Ruby provided by `rugged`. `rugged` has its own dependencies - `cmake` and `pkg-config` - which you may need to install before you can install Licensed.
|
28
|
+
|
29
|
+
For example, on macOS with Homebrew: `brew install cmake pkg-config` and on Ubuntu: `apt-get install cmake pkg-config`.
|
16
30
|
|
17
31
|
## Usage
|
18
32
|
|
19
|
-
- `licensed
|
33
|
+
- `licensed list`: Output enumerated dependencies only.
|
20
34
|
|
21
|
-
- `licensed
|
35
|
+
- `licensed cache`: Cache licenses and metadata.
|
36
|
+
|
37
|
+
- `licensed status`: Check status of dependencies' cached licenses. For example:
|
22
38
|
|
23
39
|
```
|
24
|
-
$ bundle exec licensed
|
25
|
-
|
40
|
+
$ bundle exec licensed status
|
41
|
+
Checking licenses for 3 dependencies
|
26
42
|
|
27
43
|
Warnings:
|
28
44
|
|
29
|
-
|
45
|
+
.licenses/rubygem/bundler.txt:
|
30
46
|
- license needs reviewed: mit.
|
31
47
|
|
32
|
-
|
33
|
-
-
|
48
|
+
.licenses/rubygem/licensee.txt:
|
49
|
+
- cached license data missing
|
34
50
|
|
35
|
-
|
51
|
+
.licenses/bower/jquery.txt:
|
36
52
|
- license needs reviewed: mit.
|
37
53
|
- cached license data out of date
|
38
54
|
|
@@ -41,94 +57,51 @@ vendor/licenses/bower/jquery.txt:
|
|
41
57
|
|
42
58
|
### Configuration
|
43
59
|
|
44
|
-
|
60
|
+
All commands accept a `-c|--config` option to specify a path to a configuration file or directory.
|
45
61
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
# These dependencies are explicitly ignored.
|
56
|
-
ignored:
|
57
|
-
rubygem:
|
58
|
-
- some-internal-gem
|
59
|
-
|
60
|
-
bower:
|
61
|
-
- some-internal-package
|
62
|
-
|
63
|
-
# These dependencies have been reviewed.
|
64
|
-
reviewed:
|
65
|
-
rubygem:
|
66
|
-
- bcrypt-ruby
|
67
|
-
|
68
|
-
bower:
|
69
|
-
- classlist # public domain
|
70
|
-
- octicons
|
71
|
-
```
|
62
|
+
If a directory is specified, `licensed` will look in that directory for a file named (in order of preference):
|
63
|
+
1. `.licensed.yml`
|
64
|
+
2. `.licensed.yaml`
|
65
|
+
3. `.licensed.json`
|
66
|
+
|
67
|
+
If the option is not specified, the value will be set to the current directory.
|
68
|
+
|
69
|
+
See the [configuration file documentation](./docs/configuration.md) for more details on the configuration format.
|
72
70
|
|
73
71
|
### Sources
|
74
72
|
|
75
73
|
Dependencies will be automatically detected for
|
76
|
-
1.
|
77
|
-
2.
|
78
|
-
3.
|
79
|
-
4.
|
80
|
-
5.
|
81
|
-
6.
|
82
|
-
7. Manifest lists
|
74
|
+
1. [Bower](./docs/sources/bower.md)
|
75
|
+
2. [Bundler (rubygem)](./docs/sources/bundler.md)
|
76
|
+
3. [Cabal](./docs/sources/cabal.md)
|
77
|
+
4. [Go](./docs/sources/go.md)
|
78
|
+
5. [Manifest lists](./docs/sources/manifests.md)
|
79
|
+
6. [NPM](./docs/sources/npm.md)
|
83
80
|
|
84
|
-
You can disable any of them in
|
81
|
+
You can disable any of them in the configuration file:
|
85
82
|
|
86
83
|
```yml
|
87
84
|
sources:
|
88
85
|
rubygem: false
|
89
86
|
npm: false
|
90
87
|
bower: false
|
91
|
-
|
92
|
-
```
|
93
|
-
|
94
|
-
#### Special Considerations for Sources
|
95
|
-
##### rubygem
|
96
|
-
The rubygem source will explicitly exclude gems in the `:development` and `:test` groups. Be aware that if you have a local
|
97
|
-
bundler configuration (e.g. `.bundle`), that configuration will be respected as well. For example, if you have a local
|
98
|
-
configuration set for `without: [':server']`, the rubygem source will exclude all gems in the `:server` group.
|
99
|
-
|
100
|
-
##### cabal
|
101
|
-
Cabal sourced dependencies are found exclusively through `ghc-pkg`. `licensed` makes no assumptions on where `ghc` package dbs are found.
|
102
|
-
As a result, it is up to the caller to set `GHC_PACKAGE_PATHS` to all package db directories prior to calling into `licensed`.
|
103
|
-
|
104
|
-
##### manifests
|
105
|
-
Manifests are intended to be a stopgap if no package managers are available. The manifest is a JSON file that should be placed in
|
106
|
-
the same directory as `config.yml` and should have the following format
|
107
|
-
```JSON
|
108
|
-
{
|
109
|
-
"file1": "package1",
|
110
|
-
"path/to/file2": "package1",
|
111
|
-
"other/file3": "package2"
|
112
|
-
}
|
88
|
+
cabal: false
|
113
89
|
```
|
114
|
-
Paths to files are expected to be relative to the git repository root. Package names will match 1:1 with metadata files at `<licenses directory>/manifest/*.txt`.
|
115
|
-
|
116
|
-
It is the responsibility of the repository owner to maintain the manifest file.
|
117
90
|
|
118
91
|
## Development
|
119
92
|
|
120
|
-
After checking out the repo, run `
|
93
|
+
After checking out the repo, run `script/bootstrap` to install dependencies. Then, run `script/cibuild` to run the tests. You can also run `script/console` for an interactive prompt that will allow you to experiment.
|
121
94
|
|
122
95
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
123
96
|
|
124
97
|
#### Adding sources
|
125
98
|
|
126
|
-
When adding new dependency sources, ensure that `
|
99
|
+
When adding new dependency sources, ensure that `script/bootstrap` scripting and tests are only run if the required tooling is available on the development machine.
|
127
100
|
|
128
|
-
* See `
|
129
|
-
* Use `tool_available?` when writing test files to gate running a test suite when tooling executables aren't available.
|
101
|
+
* See `script/bootstrap` for examples of gating scripting based on whether tooling executables are found.
|
102
|
+
* Use `Licensed::Shell.tool_available?` when writing test files to gate running a test suite when tooling executables aren't available.
|
130
103
|
```ruby
|
131
|
-
if tool_available?('bundle')
|
104
|
+
if Licensed::Shell.tool_available?('bundle')
|
132
105
|
describe Licensed::Source::Bundler do
|
133
106
|
...
|
134
107
|
end
|
@@ -137,7 +110,13 @@ end
|
|
137
110
|
|
138
111
|
## Contributing
|
139
112
|
|
140
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/github/licensed. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org/) code of conduct.
|
113
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/github/licensed. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org/) code of conduct. See [CONTRIBUTING](CONTRIBUTING.md) for more details.
|
114
|
+
|
115
|
+
## Disclaimer
|
116
|
+
|
117
|
+
Licensed is **not** a complete open source license compliance solution. Like any bug, licensing issues are far cheaper to fix if found early. Licensed is intended to provide automation around documenting the licenses of dependencies and whether they are configured to be allowed by a user of licensed, in other words, to surface the most obvious licensing issues early.
|
118
|
+
|
119
|
+
Licensed is not a substitute for human review of each dependency for licensing or any other issues. It is not the goal of Licensed or GitHub, Inc. to provide legal advice about licensing or any other issues. If you have any questions regarding licensing compliance for your code or any other legal issues relating to it, it’s up to you to do further research or consult with a professional.
|
141
120
|
|
142
121
|
## License
|
143
122
|
|
data/Rakefile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "bundler/gem_tasks"
|
2
3
|
require "rake/testtask"
|
3
4
|
|
4
5
|
Rake::TestTask.new(:test) do |t|
|
5
6
|
t.libs << "test"
|
6
7
|
t.libs << "lib"
|
7
|
-
t.test_files = FileList[
|
8
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
8
9
|
end
|
9
10
|
|
10
|
-
task :
|
11
|
+
task default: :test
|
@@ -0,0 +1,131 @@
|
|
1
|
+
# Configuration file
|
2
|
+
|
3
|
+
A configuration file specifies the details of enumerating and operating on license metadata for apps.
|
4
|
+
|
5
|
+
Configuration can be specified in either YML or JSON formats. Examples below are given in YML.
|
6
|
+
|
7
|
+
## Applications
|
8
|
+
|
9
|
+
What is an "app"? In the context of `licensed`, an app is a combination of a source path and a cache path.
|
10
|
+
|
11
|
+
Configuration can be set up for single or multiple applications in the same repo. There are a number of settings available for each app:
|
12
|
+
```yml
|
13
|
+
# If not set, defaults to the directory name of `source_path`
|
14
|
+
name: 'My application'
|
15
|
+
|
16
|
+
# Path is relative to git repository root
|
17
|
+
# If not set, defaults to '.licenses'
|
18
|
+
cache_path: 'relative/path/to/cache'
|
19
|
+
|
20
|
+
# Path is relative to git repository root and specifies the working directory when enumerating dependencies
|
21
|
+
# Optional for single app configuration, required when specifying multiple apps
|
22
|
+
# Defaults to current directory when running `licensed`
|
23
|
+
source_path: 'relative/path/to/source'
|
24
|
+
|
25
|
+
# Sources of metadata
|
26
|
+
# All sources will attempt to run unless explicitly disabled
|
27
|
+
sources:
|
28
|
+
- bower: true
|
29
|
+
- rubygem: false
|
30
|
+
|
31
|
+
# Dependencies with these licenses are allowed by default.
|
32
|
+
allowed:
|
33
|
+
- mit
|
34
|
+
- apache-2.0
|
35
|
+
- bsd-2-clause
|
36
|
+
- bsd-3-clause
|
37
|
+
- cc0-1.0
|
38
|
+
|
39
|
+
# These dependencies are explicitly ignored.
|
40
|
+
ignored:
|
41
|
+
rubygem:
|
42
|
+
- some-internal-gem
|
43
|
+
|
44
|
+
bower:
|
45
|
+
- some-internal-package
|
46
|
+
|
47
|
+
# These dependencies have been reviewed.
|
48
|
+
reviewed:
|
49
|
+
rubygem:
|
50
|
+
- bcrypt-ruby
|
51
|
+
|
52
|
+
bower:
|
53
|
+
- classlist # public domain
|
54
|
+
- octicons
|
55
|
+
```
|
56
|
+
|
57
|
+
### Specifying a single app
|
58
|
+
To specify a single app, either include a single app with `source_path` in the `apps` configuration, or remove the `apps` setting entirely.
|
59
|
+
|
60
|
+
If the configuration does not contain an `apps` value, the root configuration will be used as an app definition. In this scenario, the `source_path` is not a required value and will default to the directory that `licensed` was executed from.
|
61
|
+
|
62
|
+
If the configuration contains an `apps` value with a single app configuration, `source_path` must be specified. Additionally, the applications inherited `cache_path` value will contain the application name. See [Inherited cache_path values](#inherited_cache_path_values)
|
63
|
+
|
64
|
+
### Specifying multiple apps
|
65
|
+
The configuration file can specify multiple source paths to enumerate metadata, each with their own configuration.
|
66
|
+
|
67
|
+
Nearly all configuration settings can be inherited from root configuration to app configuration. Only `source_path` is required to define an app.
|
68
|
+
|
69
|
+
Here are some examples:
|
70
|
+
|
71
|
+
#### Inheriting configuration
|
72
|
+
```yml
|
73
|
+
sources:
|
74
|
+
- go: true
|
75
|
+
- rubygem: false
|
76
|
+
|
77
|
+
ignored:
|
78
|
+
rubygem:
|
79
|
+
- some-internal-gem
|
80
|
+
|
81
|
+
reviewed:
|
82
|
+
rubygem:
|
83
|
+
- bcrypt-ruby
|
84
|
+
|
85
|
+
cache_path: 'path/to/cache'
|
86
|
+
apps:
|
87
|
+
- source_path: 'path/to/app1'
|
88
|
+
- source_path: 'path/to/app2'
|
89
|
+
sources:
|
90
|
+
- rubygem: true
|
91
|
+
- go: false
|
92
|
+
```
|
93
|
+
|
94
|
+
In this example, two apps have been declared. The first app, with `source_path` `path/to/app1`, inherits all configuration settings from the root configuration. The second app, with `source_path` `path/to/app2`, overrides the `sources` configuration and inherits all other settings.
|
95
|
+
|
96
|
+
#### Default app names
|
97
|
+
An app will not inherit a name set from the root configuration. If not provided, the `name` value will default to the directory name from `source_path`.
|
98
|
+
```yml
|
99
|
+
apps:
|
100
|
+
- source_path: 'path/to/app1'
|
101
|
+
- source_path: 'path/to/app2'
|
102
|
+
```
|
103
|
+
|
104
|
+
In this example, the apps have names of `app1` and `app2`, respectively.
|
105
|
+
|
106
|
+
#### Inherited cache_path values
|
107
|
+
When an app inherits a `cache_path` from the root configuration, it will automatically append it's name to the end of the path to separate it's metadata from other apps. To force multiple apps to use the same path to cached metadata, explicitly set the `cache_path` value for each app.
|
108
|
+
```yml
|
109
|
+
cache_path: 'path/to/cache'
|
110
|
+
apps:
|
111
|
+
- source_path: 'path/to/app1'
|
112
|
+
name: 'app1'
|
113
|
+
- source_path: 'path/to/app2'
|
114
|
+
name: 'app2'
|
115
|
+
- source_path: 'path/to/app3'
|
116
|
+
name: 'app3'
|
117
|
+
cache_path: 'path/to/app3/cache'
|
118
|
+
```
|
119
|
+
|
120
|
+
In this example `app1` and `app2` have `cache_path` values of `path/to/cache/app1` and `path/to/cache/app2`, respectively. `app3` has an explicit path set to `path/to/app3/cache`
|
121
|
+
|
122
|
+
```yml
|
123
|
+
apps:
|
124
|
+
- source_path: 'path/to/app1'
|
125
|
+
```
|
126
|
+
|
127
|
+
In this example, the root configuration will contain a default cache path of `.licenses`. `app1` will inherit this value and append it's name, resulting in a cache path of `.licenses/app1`.
|
128
|
+
|
129
|
+
## Source specific configuration
|
130
|
+
|
131
|
+
See the [source documentation](./sources) for details on any source specific configuration.
|