license_finder 1.1.1-java → 1.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/CHANGELOG.rdoc +10 -0
  4. data/Gemfile +1 -1
  5. data/README.md +363 -0
  6. data/Rakefile +30 -1
  7. data/TODO.md +28 -0
  8. data/bin/license_finder_pip.py +18 -0
  9. data/db/migrate/201410031451_rename_dependency_license_name.rb +6 -0
  10. data/features/multiple_licenses.feature +9 -0
  11. data/features/step_definitions/cli_steps.rb +9 -9
  12. data/features/step_definitions/cocoapod_steps.rb +1 -1
  13. data/features/step_definitions/configure_bundler_groups_steps.rb +3 -3
  14. data/features/step_definitions/configure_whitelist_steps.rb +4 -4
  15. data/features/step_definitions/gradle_steps.rb +1 -1
  16. data/features/step_definitions/manually_added_steps.rb +3 -3
  17. data/features/step_definitions/manually_approved_steps.rb +5 -5
  18. data/features/step_definitions/manually_assigned_license_steps.rb +4 -4
  19. data/features/step_definitions/maven_steps.rb +1 -1
  20. data/features/step_definitions/multiple_licenses_steps.rb +14 -0
  21. data/features/step_definitions/node_steps.rb +1 -1
  22. data/features/step_definitions/python_steps.rb +1 -1
  23. data/features/step_definitions/report_csv_steps.rb +3 -3
  24. data/features/step_definitions/report_html_steps.rb +5 -5
  25. data/features/step_definitions/shared_steps.rb +23 -6
  26. data/lib/license_finder.rb +3 -0
  27. data/lib/license_finder/cli.rb +13 -34
  28. data/lib/license_finder/configuration.rb +8 -4
  29. data/lib/license_finder/dependency_manager.rb +25 -15
  30. data/lib/license_finder/license.rb +8 -0
  31. data/lib/license_finder/logger.rb +59 -0
  32. data/lib/license_finder/package.rb +37 -30
  33. data/lib/license_finder/package_manager.rb +20 -0
  34. data/lib/license_finder/package_managers/bower.rb +4 -9
  35. data/lib/license_finder/package_managers/bower_package.rb +2 -1
  36. data/lib/license_finder/package_managers/bundler.rb +26 -41
  37. data/lib/license_finder/package_managers/bundler_package.rb +6 -3
  38. data/lib/license_finder/package_managers/cocoa_pods.rb +18 -10
  39. data/lib/license_finder/package_managers/cocoa_pods_package.rb +4 -3
  40. data/lib/license_finder/package_managers/gradle.rb +7 -11
  41. data/lib/license_finder/package_managers/gradle_package.rb +2 -7
  42. data/lib/license_finder/package_managers/maven.rb +5 -9
  43. data/lib/license_finder/package_managers/maven_package.rb +4 -8
  44. data/lib/license_finder/package_managers/npm.rb +6 -10
  45. data/lib/license_finder/package_managers/npm_package.rb +2 -1
  46. data/lib/license_finder/package_managers/pip.rb +11 -24
  47. data/lib/license_finder/package_managers/pip_package.rb +2 -1
  48. data/lib/license_finder/package_saver.rb +2 -2
  49. data/lib/license_finder/platform.rb +4 -0
  50. data/lib/license_finder/possible_license_file.rb +4 -0
  51. data/lib/license_finder/possible_license_files.rb +2 -1
  52. data/lib/license_finder/reports/detailed_text_report.rb +1 -1
  53. data/lib/license_finder/reports/formatted_report.rb +1 -1
  54. data/lib/license_finder/tables/dependency.rb +22 -12
  55. data/lib/license_finder/yml_to_sql.rb +1 -1
  56. data/lib/templates/html_report.erb +4 -4
  57. data/lib/templates/markdown_report.erb +4 -4
  58. data/lib/templates/text_report.erb +1 -1
  59. data/license_finder.gemspec +28 -12
  60. data/spec/lib/license_finder/cli_spec.rb +193 -185
  61. data/spec/lib/license_finder/configuration_spec.rb +46 -47
  62. data/spec/lib/license_finder/dependency_manager_spec.rb +48 -44
  63. data/spec/lib/license_finder/license/definitions_spec.rb +26 -26
  64. data/spec/lib/license_finder/license_spec.rb +25 -25
  65. data/spec/lib/license_finder/package_managers/bower_package_spec.rb +33 -17
  66. data/spec/lib/license_finder/package_managers/bower_spec.rb +35 -35
  67. data/spec/lib/license_finder/package_managers/bundler_package_spec.rb +20 -15
  68. data/spec/lib/license_finder/package_managers/bundler_spec.rb +12 -19
  69. data/spec/lib/license_finder/package_managers/cocoa_pods_package_spec.rb +8 -5
  70. data/spec/lib/license_finder/package_managers/cocoa_pods_spec.rb +20 -22
  71. data/spec/lib/license_finder/package_managers/gradle_package_spec.rb +8 -5
  72. data/spec/lib/license_finder/package_managers/gradle_spec.rb +20 -20
  73. data/spec/lib/license_finder/package_managers/maven_package_spec.rb +8 -5
  74. data/spec/lib/license_finder/package_managers/maven_spec.rb +18 -18
  75. data/spec/lib/license_finder/package_managers/npm_package_spec.rb +36 -17
  76. data/spec/lib/license_finder/package_managers/npm_spec.rb +17 -17
  77. data/spec/lib/license_finder/package_managers/pip_package_spec.rb +16 -10
  78. data/spec/lib/license_finder/package_managers/pip_spec.rb +21 -18
  79. data/spec/lib/license_finder/package_saver_spec.rb +15 -25
  80. data/spec/lib/license_finder/possible_license_file_spec.rb +5 -4
  81. data/spec/lib/license_finder/possible_license_files_spec.rb +11 -5
  82. data/spec/lib/license_finder/reports/detailed_text_report_spec.rb +3 -3
  83. data/spec/lib/license_finder/reports/html_report_spec.rb +23 -23
  84. data/spec/lib/license_finder/reports/markdown_report_spec.rb +12 -12
  85. data/spec/lib/license_finder/reports/reporter_spec.rb +11 -11
  86. data/spec/lib/license_finder/reports/text_report_spec.rb +3 -3
  87. data/spec/lib/license_finder/tables/dependency_spec.rb +59 -41
  88. data/spec/lib/license_finder/yml_to_sql_spec.rb +21 -21
  89. data/spec/lib/license_finder_spec.rb +1 -1
  90. data/spec/spec_helper.rb +0 -13
  91. data/spec/support/shared_examples_for_package.rb +46 -0
  92. data/spec/support/shared_examples_for_package_manager.rb +15 -0
  93. metadata +19 -100
  94. data/readme.md +0 -259
@@ -0,0 +1,46 @@
1
+ module LicenseFinder
2
+ shared_examples "a Package" do
3
+ context "the interface required by PackageSave" do
4
+ it { expect { subject.name }.to_not raise_error }
5
+ it { expect { subject.version }.to_not raise_error }
6
+ it { expect { subject.summary }.to_not raise_error }
7
+ it { expect { subject.description }.to_not raise_error }
8
+ it { expect { subject.homepage }.to_not raise_error }
9
+ it { expect { subject.groups }.to_not raise_error }
10
+ it { expect { subject.children }.to_not raise_error }
11
+ it { expect { subject.licenses }.to_not raise_error }
12
+ end
13
+
14
+ context "logging" do
15
+ let!(:logger) { Logger::Quiet.new }
16
+ before { allow(Logger::Default).to receive(:new) { logger } }
17
+
18
+ it "logs licenses found in specs" do
19
+ license_short_name = "foo"
20
+ license_pretty_name = "pretty foo"
21
+ license = double(:license, name: license_pretty_name)
22
+
23
+ allow(subject).to receive(:license_names_from_spec).and_return([license_short_name])
24
+ allow(License).to receive(:find_by_name).with(license_short_name) { license }
25
+
26
+ expect(logger).to receive(:license).with(anything, subject.name, license_pretty_name, "from spec")
27
+
28
+ subject.licenses_from_spec
29
+ end
30
+
31
+ it "logs licenses found in files" do
32
+ license_short_name = "foo"
33
+ license_pretty_name = "pretty foo"
34
+ license_path = "/path/to/license"
35
+ license = double(:license, name: license_pretty_name)
36
+ license_file = double(:license_file, license: license, path: license_path)
37
+
38
+ allow(subject).to receive(:license_files) { [license_file] }
39
+
40
+ expect(logger).to receive(:license).with(anything, subject.name, license_pretty_name, "from file '#{license_path}'")
41
+
42
+ subject.licenses_from_files
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,15 @@
1
+ module LicenseFinder
2
+ shared_examples "a PackageManager" do
3
+ it { expect(described_class.ancestors).to include PackageManager }
4
+
5
+ context "logging" do
6
+ it "logs when it checks for active-ness" do
7
+ logger = double(:logger)
8
+ expect(logger).to receive(:active)
9
+
10
+ subject = described_class.new logger: logger
11
+ subject.active?
12
+ end
13
+ end
14
+ end
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: license_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: '1.2'
5
5
  platform: java
6
6
  authors:
7
7
  - Jacob Maine
@@ -16,10 +16,11 @@ authors:
16
16
  - David Dening
17
17
  - Geoff Pleiss
18
18
  - Mike Chinigo
19
+ - Mike Dalessio
19
20
  autorequire:
20
21
  bindir: bin
21
22
  cert_chain: []
22
- date: 2014-10-10 00:00:00.000000000 Z
23
+ date: 2014-11-10 00:00:00.000000000 Z
23
24
  dependencies:
24
25
  - !ruby/object:Gem::Dependency
25
26
  name: bundler
@@ -218,15 +219,15 @@ dependencies:
218
219
  prerelease: false
219
220
  type: :development
220
221
  description: |2
221
- Do you know the licenses of all your application's dependencies? What open source software licenses will your business accept?
222
-
223
- LicenseFinder culls your package managers, detects the licenses of the packages in them, and gives you a report that you can act on. If you already know
224
- what licenses your business is comfortable with, you can whitelist them, leaving you with an action report of only those dependencies that have
225
- licenses that fall outside of the whitelist.
222
+ LicenseFinder works with your package managers to find
223
+ dependencies, detect the licenses of the packages in them, compare
224
+ those licenses against a user-defined whitelist, and give you an
225
+ actionable exception report.
226
226
  email:
227
227
  - commoncode@pivotalabs.com
228
228
  executables:
229
229
  - license_finder
230
+ - license_finder_pip.py
230
231
  extensions: []
231
232
  extra_rdoc_files: []
232
233
  files:
@@ -237,8 +238,11 @@ files:
237
238
  - CHANGELOG.rdoc
238
239
  - Gemfile
239
240
  - LICENSE
241
+ - README.md
240
242
  - Rakefile
243
+ - TODO.md
241
244
  - bin/license_finder
245
+ - bin/license_finder_pip.py
242
246
  - db/migrate/201303290935_create_dependencies.rb
243
247
  - db/migrate/201303291155_create_licenses.rb
244
248
  - db/migrate/201303291402_create_approvals.rb
@@ -261,6 +265,7 @@ files:
261
265
  - db/migrate/201403190028_add_manual_approvals.rb
262
266
  - db/migrate/201403191419_add_timestamps_to_manual_approvals.rb
263
267
  - db/migrate/201403191645_remove_license_aliases.rb
268
+ - db/migrate/201410031451_rename_dependency_license_name.rb
264
269
  - features/cli.feature
265
270
  - features/cocoapods_dependencies.feature
266
271
  - features/configure_bundler_groups.feature
@@ -272,6 +277,7 @@ files:
272
277
  - features/manually_approved.feature
273
278
  - features/manually_assigned_license.feature
274
279
  - features/maven_dependencies.feature
280
+ - features/multiple_licenses.feature
275
281
  - features/node_dependencies.feature
276
282
  - features/python_dependencies.feature
277
283
  - features/report_csv.feature
@@ -287,6 +293,7 @@ files:
287
293
  - features/step_definitions/manually_approved_steps.rb
288
294
  - features/step_definitions/manually_assigned_license_steps.rb
289
295
  - features/step_definitions/maven_steps.rb
296
+ - features/step_definitions/multiple_licenses_steps.rb
290
297
  - features/step_definitions/node_steps.rb
291
298
  - features/step_definitions/python_steps.rb
292
299
  - features/step_definitions/report_csv_steps.rb
@@ -315,7 +322,9 @@ files:
315
322
  - lib/license_finder/license/none_matcher.rb
316
323
  - lib/license_finder/license/template.rb
317
324
  - lib/license_finder/license/text.rb
325
+ - lib/license_finder/logger.rb
318
326
  - lib/license_finder/package.rb
327
+ - lib/license_finder/package_manager.rb
319
328
  - lib/license_finder/package_managers/bower.rb
320
329
  - lib/license_finder/package_managers/bower_package.rb
321
330
  - lib/license_finder/package_managers/bundler.rb
@@ -350,7 +359,6 @@ files:
350
359
  - lib/templates/markdown_report.erb
351
360
  - lib/templates/text_report.erb
352
361
  - license_finder.gemspec
353
- - readme.md
354
362
  - release/gem_version.rb
355
363
  - release/manual_instructions.md
356
364
  - release/publish.sh
@@ -413,6 +421,8 @@ files:
413
421
  - spec/lib/license_finder/yml_to_sql_spec.rb
414
422
  - spec/lib/license_finder_spec.rb
415
423
  - spec/spec_helper.rb
424
+ - spec/support/shared_examples_for_package.rb
425
+ - spec/support/shared_examples_for_package_manager.rb
416
426
  - spec/support/stdout_helpers.rb
417
427
  homepage: https://github.com/pivotal/LicenseFinder
418
428
  licenses:
@@ -438,95 +448,4 @@ rubygems_version: 2.1.9
438
448
  signing_key:
439
449
  specification_version: 4
440
450
  summary: Audit the OSS licenses of your application's dependencies.
441
- test_files:
442
- - features/cli.feature
443
- - features/cocoapods_dependencies.feature
444
- - features/configure_bundler_groups.feature
445
- - features/configure_ignore_dependencies.feature
446
- - features/configure_project_name.feature
447
- - features/configure_whitelist.feature
448
- - features/gradle_dependencies.feature
449
- - features/manually_added.feature
450
- - features/manually_approved.feature
451
- - features/manually_assigned_license.feature
452
- - features/maven_dependencies.feature
453
- - features/node_dependencies.feature
454
- - features/python_dependencies.feature
455
- - features/report_csv.feature
456
- - features/report_html.feature
457
- - features/step_definitions/cli_steps.rb
458
- - features/step_definitions/cocoapod_steps.rb
459
- - features/step_definitions/configure_bundler_groups_steps.rb
460
- - features/step_definitions/configure_ignore_dependencies.rb
461
- - features/step_definitions/configure_project_name_steps.rb
462
- - features/step_definitions/configure_whitelist_steps.rb
463
- - features/step_definitions/gradle_steps.rb
464
- - features/step_definitions/manually_added_steps.rb
465
- - features/step_definitions/manually_approved_steps.rb
466
- - features/step_definitions/manually_assigned_license_steps.rb
467
- - features/step_definitions/maven_steps.rb
468
- - features/step_definitions/node_steps.rb
469
- - features/step_definitions/python_steps.rb
470
- - features/step_definitions/report_csv_steps.rb
471
- - features/step_definitions/report_html_steps.rb
472
- - features/step_definitions/shared_steps.rb
473
- - spec/fixtures/APACHE-2-LICENSE
474
- - spec/fixtures/GPLv2
475
- - spec/fixtures/ISC-LICENSE
476
- - spec/fixtures/MIT-LICENSE
477
- - spec/fixtures/MIT-LICENSE-with-varied-disclaimer
478
- - spec/fixtures/Podfile
479
- - spec/fixtures/README-with-MIT-LICENSE
480
- - spec/fixtures/build.gradle
481
- - spec/fixtures/license_directory/COPYING
482
- - spec/fixtures/license_directory/LICENSE/BSD-2-Clause.txt
483
- - spec/fixtures/license_directory/LICENSE/GPL-2.0.txt
484
- - spec/fixtures/license_directory/LICENSE/LICENSE
485
- - spec/fixtures/license_directory/LICENSE/MIT.txt
486
- - spec/fixtures/license_directory/LICENSE/RUBY.txt
487
- - spec/fixtures/license_names/COPYING.txt
488
- - spec/fixtures/license_names/LICENSE
489
- - spec/fixtures/license_names/Licence.rdoc
490
- - spec/fixtures/license_names/Mit-License
491
- - spec/fixtures/license_names/README.rdoc
492
- - spec/fixtures/mit_licensed_gem/LICENSE
493
- - spec/fixtures/nested_gem/vendor/LICENSE
494
- - spec/fixtures/nested_readme/vendor/README
495
- - spec/fixtures/other_licensed_gem/LICENSE
496
- - spec/fixtures/pom.xml
497
- - spec/fixtures/readme/Project ReadMe
498
- - spec/fixtures/readme/README
499
- - spec/fixtures/readme/Readme.markdown
500
- - spec/fixtures/utf8_gem/README
501
- - spec/lib/license_finder/cli_spec.rb
502
- - spec/lib/license_finder/configuration_spec.rb
503
- - spec/lib/license_finder/dependency_manager_spec.rb
504
- - spec/lib/license_finder/license/definitions_spec.rb
505
- - spec/lib/license_finder/license_spec.rb
506
- - spec/lib/license_finder/package_managers/bower_package_spec.rb
507
- - spec/lib/license_finder/package_managers/bower_spec.rb
508
- - spec/lib/license_finder/package_managers/bundler_package_spec.rb
509
- - spec/lib/license_finder/package_managers/bundler_spec.rb
510
- - spec/lib/license_finder/package_managers/cocoa_pods_package_spec.rb
511
- - spec/lib/license_finder/package_managers/cocoa_pods_spec.rb
512
- - spec/lib/license_finder/package_managers/gradle_package_spec.rb
513
- - spec/lib/license_finder/package_managers/gradle_spec.rb
514
- - spec/lib/license_finder/package_managers/maven_package_spec.rb
515
- - spec/lib/license_finder/package_managers/maven_spec.rb
516
- - spec/lib/license_finder/package_managers/npm_package_spec.rb
517
- - spec/lib/license_finder/package_managers/npm_spec.rb
518
- - spec/lib/license_finder/package_managers/pip_package_spec.rb
519
- - spec/lib/license_finder/package_managers/pip_spec.rb
520
- - spec/lib/license_finder/package_saver_spec.rb
521
- - spec/lib/license_finder/possible_license_file_spec.rb
522
- - spec/lib/license_finder/possible_license_files_spec.rb
523
- - spec/lib/license_finder/reports/detailed_text_report_spec.rb
524
- - spec/lib/license_finder/reports/html_report_spec.rb
525
- - spec/lib/license_finder/reports/markdown_report_spec.rb
526
- - spec/lib/license_finder/reports/reporter_spec.rb
527
- - spec/lib/license_finder/reports/text_report_spec.rb
528
- - spec/lib/license_finder/tables/dependency_spec.rb
529
- - spec/lib/license_finder/yml_to_sql_spec.rb
530
- - spec/lib/license_finder_spec.rb
531
- - spec/spec_helper.rb
532
- - spec/support/stdout_helpers.rb
451
+ test_files: []
data/readme.md DELETED
@@ -1,259 +0,0 @@
1
- # License Finder
2
-
3
- [![Build Status](https://secure.travis-ci.org/pivotal/LicenseFinder.png)](http://travis-ci.org/pivotal/LicenseFinder)
4
- [![Code Climate](https://codeclimate.com/github/pivotal/LicenseFinder.png)](https://codeclimate.com/github/pivotal/LicenseFinder)
5
-
6
- With bundler and other dependency management tools, it's easy for your project to depend on many packages. This decomposition is nice, but managing licenses becomes difficult. license_finder gathers info about the licenses of the packages in your project.
7
-
8
- ### Supported project types
9
- - Ruby (+ Bundler)
10
- - Python (+ Eggs)
11
- - Node.js (+ Modules)
12
- - Bower
13
-
14
- ### Experimental project types
15
- - Java (+ Maven)
16
- - Java (+ Gradle)
17
- - Objective-C (+ CocoaPods)
18
-
19
- ## Installation
20
-
21
- Add license_finder to your project's Gemfile and `bundle`:
22
-
23
- ```ruby
24
- gem 'license_finder'
25
- ```
26
-
27
- ## Usage
28
-
29
-
30
- license_finder will generate reports of action items - i.e., dependencies that do not fall within your license "whitelist".
31
-
32
- ```sh
33
- $ license_finder
34
- ```
35
-
36
- (Note) If you wish to run license_finder without the progress spinner use the --quiet option.
37
-
38
- license_finder will include packages for all supported languages, as long as that language has a Gemfile/requirements.txt/package.json in the project directory.
39
-
40
- On a brand new Rails project, you could expect license_finder to output something like the following
41
- (assuming you whitelisted the MIT license -- see [Configuration](#configuration)):
42
-
43
- ```
44
- Dependencies that need approval:
45
-
46
- highline, 1.6.14, ruby
47
- json, 1.7.5, ruby
48
- mime-types, 1.19, ruby
49
- rails, 3.2.8, other
50
- rdoc, 3.12, other
51
- rubyzip, 0.9.9, ruby
52
- xml-simple, 1.1.1, other
53
- ```
54
-
55
- The executable task will also write out a dependencies.db, dependencies.csv, and dependencies.html file (in the doc/
56
- directory by default -- see [Configuration](#configuration)).
57
-
58
- The latter two files are human readable reports that you could send to your non-technical business partners, lawyers, etc.
59
-
60
- license_finder will also return a non-zero exit status if there are
61
- unapproved dependencies. You could use this in a CI build, for example, to alert you whenever someone adds an
62
- unapproved dependency to the project.
63
-
64
- Run `license_finder help` to see other available commands.
65
-
66
- ### Manually setting licenses
67
-
68
- When license_finder reports that a dependency's license is 'other', you should manually research what the actual
69
- license is. When you have established the real license, you can record it with:
70
-
71
- ```sh
72
- $ license_finder license MIT my_unknown_dependency
73
- ```
74
-
75
- This command would assign the MIT license to the dependency `my_unknown_dependency`.
76
-
77
- ### Manually approving dependencies
78
-
79
- Whenever you have a dependency that falls outside of your whitelist, license_finder will tell you.
80
- If your business decides that this is an acceptable risk, you can manually approve the dependency by using the
81
- `license_finder approve` command.
82
-
83
- For example, lets assume you've only
84
- whitelisted the "MIT" license in your `config/license_finder.yml`. You then add the `awesome_gpl_gem` to your Gemfile,
85
- which we'll assume is licensed with the `GPL` license. You then run `license_finder` and see
86
- the gem listed in the output:
87
-
88
- ```sh
89
- awesome_gpl_gem, 1.0.0, GPL
90
- ```
91
-
92
- Your business tells you that in this case, it's acceptable to use this gem. You now run:
93
-
94
- ```sh
95
- $ license_finder approve awesome_gpl_gem
96
- ```
97
-
98
- If you rerun license_finder, you should no longer see `awesome_gpl_gem` in the output.
99
-
100
- To record who approved the dependency and why:
101
-
102
- ```sh
103
- $ license_finder approve awesome_gpl_gem --approver CTO --message "Go ahead"
104
- ```
105
-
106
- ### Manually managing dependencies
107
-
108
- license_finder can track dependencies that your package managers don't know about (JS libraries that don't
109
- appear in your Gemfile/requirements.txt/package.json, etc.)
110
-
111
- ```sh
112
- $ license_finder dependencies add MIT my_js_dep 0.1.2
113
- ```
114
-
115
- To automatically approve an unmanaged dependency when you add it, use:
116
-
117
- ```sh
118
- $ license_finder dependencies add MIT my_js_dep 0.1.2 --approve
119
- ```
120
-
121
- To record who approved the dependency when you add it, use:
122
-
123
- ```sh
124
- $ license_finder dependencies add MIT my_js_dep 0.1.2 --approve --approver CTO --message "Go ahead"
125
- ```
126
-
127
- The version is optional. Run `license_finder dependencies help` for additional documentation about
128
- managing these dependencies.
129
-
130
- license_finder cannot automatically detect when one of these dependencies has been removed from your
131
- project, so you can use:
132
-
133
- ```sh
134
- $ license_finder dependencies remove my_js_dep
135
- ```
136
-
137
-
138
- ## Configuration
139
-
140
- The first time you run license_finder it will create a default configuration file `./config/license_finder.yml`:
141
-
142
- ```yaml
143
- ---
144
- whitelist:
145
- #- MIT
146
- #- Apache 2.0
147
- ignore_groups:
148
- #- test
149
- #- development
150
- ignore_dependencies:
151
- #- bundler
152
- dependencies_file_dir: './doc/'
153
- project_name: My Project Name
154
- gradle_command: # only meaningful if used with a Java/gradle project. Defaults to "gradle".
155
- ```
156
-
157
- By modifying this file, you can configure license_finder's behavior.
158
-
159
- - Licenses in the `whitelist` will be automatically approved.
160
- - You can exclude test or development dependencies by setting `ignore_groups`. (Currently this only
161
- works for Bundler.)
162
- - You can exclude specific dependencies by setting `ignore_dependencies`.
163
- (Think carefully before adding dependencies to this list. A likely item to exclude is
164
- bundler itself, to avoid noisy changes to the doc files when different people run
165
- license_finder with different versions of bundler.)
166
- - You can store the license database and text files in another directory by changing
167
- `dependencies_file_dir`. And the `project_name`, which defaults to your working
168
- directory, appears in the [HTML report](#html-report).
169
- - See below for explanation of "gradle_command".
170
-
171
- You can also configure license_finder through the command line. See
172
- `license_finder whitelist help`, `license_finder ignored_bundler_groups help`
173
- and `license_finder project_name help` for more details.
174
-
175
- ### For gradle projects
176
-
177
- You need to install the license gradle plugin: [https://github.com/hierynomus/license-gradle-plugin](https://github.com/hierynomus/license-gradle-plugin)
178
-
179
- LicenseFinder assumes that gradle is on your shell's include path and is invoked by just calling `gradle`. If you invoke gradle some other way (say, with a custom `gradlew` script), set the `gradle_command` option in your project's `license_finder.yml`:
180
-
181
- ```yaml
182
- # … other configuration …
183
-
184
- gradle_command: ./gradlew
185
- ```
186
-
187
- By default, license_finder will report on gradle's "runtime" dependencies. If you want to generate a report for some other dependency configuration (e.g. Android projects will sometimes specify their meaningful dependencies in the "compile" group), you can specify it in your project's `build.gradle` like so:
188
-
189
- ```
190
- // Must come *after* the 'apply plugin: license' line
191
-
192
- downloadLicenses {
193
- dependencyConfiguration "compile"
194
- }
195
- ```
196
-
197
- ## HTML Report
198
-
199
- The HTML report generated by license_finder shows a summary of the project's dependencies
200
- and dependencies which need to be approved. The project name at the top of the report can
201
- be set in `config/license_finder.yml`.
202
-
203
- ## Upgrade for pre 0.8.0 users
204
-
205
- If you wish to cleanup your root directory you can run:
206
-
207
- ```sh
208
- $ license_finder move
209
- ```
210
-
211
- This will move your `dependencies.*` files to the doc/ directory and update the config.
212
-
213
-
214
- ## Compatibility
215
-
216
- license_finder is compatible with ruby >= 1.9, and jruby.
217
-
218
-
219
- ## A note to gem authors / maintainers
220
-
221
- For the good of humanity, please add a license to your gemspec!
222
-
223
- ```ruby
224
- Gem::Specification.new do |s|
225
- s.name = "my_great_gem"
226
- s.license = "MIT"
227
- end
228
- ```
229
-
230
- And add a `LICENSE` file to your gem that contains your license text.
231
-
232
-
233
- ## Support
234
-
235
- * Send an email to the list: [license-finder@googlegroups.com](license-finder@googlegroups.com)
236
- * View the project backlog at Pivotal Tracker: [https://www.pivotaltracker.com/s/projects/234851](https://www.pivotaltracker.com/s/projects/234851)
237
-
238
-
239
- ## Contributing
240
-
241
- * Fork the project
242
- * Create a feature branch
243
- * Make your feature addition or bug fix (with tests)
244
- * Rebase on top of master
245
- * Send a pull request
246
-
247
- To successfully run the test suite, you will need node.js, python, pip and gradle installed.
248
-
249
- For the python dependency tests you will want to have virtualenv installed. See: http://hackercodex.com/guide/python-development-environment-on-mac-osx/#virtualenv (This will allow pip to work without sudo)
250
-
251
- If you're running the test suite with jruby, you're probably going to want to set up these environment variables:
252
-
253
- ```
254
- JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1' JRUBY_OPTS='-J-Djruby.launch.inproc=true'
255
- ```
256
-
257
- ## License
258
-
259
- LicenseFinder is released under the MIT License. http://www.opensource.org/licenses/mit-license