license_finder 1.0.0.0-java → 1.1.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.force-build +0 -0
  3. data/.travis.yml +8 -7
  4. data/CHANGELOG.rdoc +29 -1
  5. data/Rakefile +2 -2
  6. data/db/migrate/201311192003_reassociate_manual_approval.rb +2 -3
  7. data/db/migrate/201403181732_rename_manual_fields.rb +10 -0
  8. data/db/migrate/201403190028_add_manual_approvals.rb +22 -0
  9. data/db/migrate/201403191419_add_timestamps_to_manual_approvals.rb +15 -0
  10. data/db/migrate/201403191645_remove_license_aliases.rb +23 -0
  11. data/features/cli.feature +21 -20
  12. data/features/cocoapods_dependencies.feature +10 -0
  13. data/features/configure_bundler_groups.feature +23 -0
  14. data/features/configure_ignore_dependencies.feature +16 -0
  15. data/features/{project_name.feature → configure_project_name.feature} +1 -1
  16. data/features/{whitelist.feature → configure_whitelist.feature} +6 -6
  17. data/features/manually_added.feature +19 -0
  18. data/features/{approve_dependencies.feature → manually_approved.feature} +2 -2
  19. data/features/manually_assigned_license.feature +16 -0
  20. data/features/{text_report.feature → report_csv.feature} +2 -2
  21. data/features/{html_report.feature → report_html.feature} +2 -2
  22. data/features/step_definitions/cli_steps.rb +22 -32
  23. data/features/step_definitions/cocoapod_steps.rb +8 -0
  24. data/features/step_definitions/configure_bundler_groups_steps.rb +30 -0
  25. data/features/step_definitions/configure_ignore_dependencies.rb +35 -0
  26. data/features/step_definitions/{project_name_steps.rb → configure_project_name_steps.rb} +0 -0
  27. data/features/step_definitions/configure_whitelist_steps.rb +45 -0
  28. data/features/step_definitions/gradle_steps.rb +2 -2
  29. data/features/step_definitions/manually_added_steps.rb +28 -0
  30. data/features/step_definitions/manually_approved_steps.rb +24 -0
  31. data/features/step_definitions/manually_assigned_license_steps.rb +34 -0
  32. data/features/step_definitions/maven_steps.rb +2 -2
  33. data/features/step_definitions/node_steps.rb +2 -2
  34. data/features/step_definitions/python_steps.rb +1 -1
  35. data/features/step_definitions/report_csv_steps.rb +20 -0
  36. data/features/step_definitions/report_html_steps.rb +60 -0
  37. data/features/step_definitions/shared_steps.rb +125 -104
  38. data/{files/license_finder.yml → lib/data/license_finder.example.yml} +3 -0
  39. data/lib/license_finder.rb +3 -2
  40. data/lib/license_finder/cli.rb +94 -49
  41. data/lib/license_finder/configuration.rb +21 -14
  42. data/lib/license_finder/dependency_manager.rb +27 -19
  43. data/lib/license_finder/license.rb +33 -19
  44. data/lib/license_finder/license/definitions.rb +153 -104
  45. data/lib/license_finder/license/matcher.rb +6 -1
  46. data/lib/license_finder/license/none_matcher.rb +9 -0
  47. data/lib/license_finder/license/text.rb +1 -0
  48. data/lib/license_finder/package.rb +30 -6
  49. data/lib/license_finder/package_managers/bower.rb +2 -2
  50. data/lib/license_finder/package_managers/bower_package.rb +2 -2
  51. data/lib/license_finder/package_managers/bundler.rb +9 -17
  52. data/lib/license_finder/package_managers/bundler_package.rb +1 -1
  53. data/lib/license_finder/package_managers/cocoa_pods.rb +35 -0
  54. data/lib/license_finder/package_managers/cocoa_pods_package.rb +19 -0
  55. data/lib/license_finder/package_managers/gradle.rb +9 -5
  56. data/lib/license_finder/package_managers/gradle_package.rb +4 -4
  57. data/lib/license_finder/package_managers/maven.rb +7 -3
  58. data/lib/license_finder/package_managers/maven_package.rb +5 -5
  59. data/lib/license_finder/package_managers/npm.rb +2 -2
  60. data/lib/license_finder/package_managers/npm_package.rb +2 -2
  61. data/lib/license_finder/package_managers/pip.rb +2 -2
  62. data/lib/license_finder/package_managers/pip_package.rb +7 -11
  63. data/lib/license_finder/package_saver.rb +12 -10
  64. data/lib/license_finder/possible_license_file.rb +1 -1
  65. data/lib/license_finder/possible_license_files.rb +11 -15
  66. data/lib/license_finder/reports/formatted_report.rb +25 -6
  67. data/lib/license_finder/reports/html_report.rb +2 -1
  68. data/lib/license_finder/reports/reporter.rb +3 -3
  69. data/lib/license_finder/tables.rb +6 -4
  70. data/lib/license_finder/tables/dependency.rb +36 -16
  71. data/lib/license_finder/tables/manual_approval.rb +13 -0
  72. data/lib/license_finder/yml_to_sql.rb +12 -9
  73. data/lib/templates/html_report.erb +68 -74
  74. data/lib/templates/markdown_report.erb +20 -21
  75. data/license_finder.gemspec +7 -7
  76. data/readme.md +76 -79
  77. data/spec/fixtures/Podfile +3 -0
  78. data/spec/lib/license_finder/cli_spec.rb +71 -23
  79. data/spec/lib/license_finder/configuration_spec.rb +61 -21
  80. data/spec/lib/license_finder/dependency_manager_spec.rb +52 -33
  81. data/spec/lib/license_finder/license/definitions_spec.rb +30 -14
  82. data/spec/lib/license_finder/license_spec.rb +55 -12
  83. data/spec/lib/license_finder/package_managers/bower_package_spec.rb +38 -19
  84. data/spec/lib/license_finder/package_managers/bower_spec.rb +10 -16
  85. data/spec/lib/license_finder/package_managers/bundler_package_spec.rb +39 -15
  86. data/spec/lib/license_finder/package_managers/bundler_spec.rb +10 -22
  87. data/spec/lib/license_finder/package_managers/cocoa_pods_package_spec.rb +44 -0
  88. data/spec/lib/license_finder/package_managers/cocoa_pods_spec.rb +79 -0
  89. data/spec/lib/license_finder/package_managers/gradle_package_spec.rb +4 -5
  90. data/spec/lib/license_finder/package_managers/gradle_spec.rb +26 -20
  91. data/spec/lib/license_finder/package_managers/maven_package_spec.rb +4 -5
  92. data/spec/lib/license_finder/package_managers/maven_spec.rb +16 -19
  93. data/spec/lib/license_finder/package_managers/npm_package_spec.rb +39 -19
  94. data/spec/lib/license_finder/package_managers/npm_spec.rb +10 -16
  95. data/spec/lib/license_finder/package_managers/pip_package_spec.rb +8 -8
  96. data/spec/lib/license_finder/package_managers/pip_spec.rb +10 -16
  97. data/spec/lib/license_finder/package_saver_spec.rb +27 -3
  98. data/spec/lib/license_finder/possible_license_file_spec.rb +25 -23
  99. data/spec/lib/license_finder/reports/detailed_text_report_spec.rb +6 -8
  100. data/spec/lib/license_finder/reports/html_report_spec.rb +45 -44
  101. data/spec/lib/license_finder/reports/markdown_report_spec.rb +8 -9
  102. data/spec/lib/license_finder/reports/reporter_spec.rb +1 -1
  103. data/spec/lib/license_finder/reports/text_report_spec.rb +6 -8
  104. data/spec/lib/license_finder/tables/dependency_spec.rb +57 -41
  105. data/spec/lib/license_finder/yml_to_sql_spec.rb +94 -92
  106. data/spec/spec_helper.rb +1 -0
  107. data/spec/support/stdout_helpers.rb +25 -0
  108. metadata +86 -69
  109. data/MIT.LICENSE +0 -20
  110. data/features/ignore_bundle_groups.feature +0 -23
  111. data/features/manually_managed_dependencies.feature +0 -19
  112. data/features/set_license.feature +0 -10
  113. data/features/step_definitions/approve_dependencies_steps.rb +0 -25
  114. data/features/step_definitions/html_report_steps.rb +0 -62
  115. data/features/step_definitions/ignore_bundle_groups_steps.rb +0 -29
  116. data/features/step_definitions/manually_managed_steps.rb +0 -33
  117. data/features/step_definitions/set_license_steps.rb +0 -20
  118. data/features/step_definitions/text_report_steps.rb +0 -19
  119. data/features/step_definitions/whitelist_steps.rb +0 -45
  120. data/files/dependency_breakdown.png +0 -0
  121. data/files/report_breakdown.png +0 -0
  122. data/lib/license_finder/license_url.rb +0 -9
  123. data/lib/license_finder/tables/license_alias.rb +0 -22
  124. data/spec/lib/license_finder/license_url_spec.rb +0 -16
  125. data/spec/lib/license_finder/tables/license_alias_spec.rb +0 -37
  126. data/spec/support/silence_stdout.rb +0 -13
@@ -0,0 +1,13 @@
1
+ require 'time'
2
+
3
+ module LicenseFinder
4
+ class ManualApproval < Sequel::Model
5
+ plugin :timestamps, update_on_create: true
6
+
7
+ def safe_created_at
8
+ created_at.is_a?(String) ?
9
+ Time.parse(created_at) :
10
+ created_at
11
+ end
12
+ end
13
+ end
@@ -39,8 +39,8 @@ module LicenseFinder
39
39
 
40
40
  def convert
41
41
  @dep = create_dependency
42
- @dep.license = create_license
43
- @dep.manual = manually_managed?
42
+ @dep.added_manually = manually_managed?
43
+ add_approval
44
44
  associate_bundler_groups
45
45
  @dep.save
46
46
  end
@@ -58,15 +58,15 @@ module LicenseFinder
58
58
  end
59
59
 
60
60
  def manually_managed?
61
- @legacy_attrs['source'] != "bundle"
61
+ legacy_attrs['source'] != "bundle"
62
62
  end
63
63
 
64
- def create_dependency
65
- Sql::Dependency.convert(legacy_attrs)
64
+ def add_approval
65
+ @dep.manual_approval = Sql::ManualApproval.new if legacy_attrs['approved']
66
66
  end
67
67
 
68
- def create_license
69
- LicenseAlias.find_or_create(name: legacy_attrs['license'])
68
+ def create_dependency
69
+ Sql::Dependency.convert(legacy_attrs)
70
70
  end
71
71
 
72
72
  def find_children
@@ -83,7 +83,7 @@ module LicenseFinder
83
83
  class Dependency < Sequel::Model
84
84
  plugin :boolean_readers
85
85
 
86
- many_to_one :license, class: LicenseAlias
86
+ one_to_one :manual_approval
87
87
  many_to_many :children, join_table: :ancestries, left_key: :parent_dependency_id, right_key: :child_dependency_id, class: self
88
88
  many_to_many :bundler_groups
89
89
 
@@ -93,7 +93,7 @@ module LicenseFinder
93
93
  'summary' => 'summary',
94
94
  'description' => 'description',
95
95
  'homepage' => 'homepage',
96
- 'approved' => 'manually_approved'
96
+ 'license' => 'license_name'
97
97
  }
98
98
 
99
99
  def self.convert(attrs)
@@ -109,6 +109,9 @@ module LicenseFinder
109
109
 
110
110
  class BundlerGroup < Sequel::Model
111
111
  end
112
+
113
+ class ManualApproval < Sequel::Model
114
+ end
112
115
  end
113
116
  end
114
117
  end
@@ -16,12 +16,8 @@
16
16
  body {
17
17
  margin: 50px;
18
18
  }
19
-
20
- .unapproved h2, .unapproved h2 a {
21
- color: red;
22
- }
23
- .unapproved h2:after {
24
- content: " (unapproved)"
19
+ .dependencies blockquote {
20
+ margin-top: 15px;
25
21
  }
26
22
  </style>
27
23
  </head>
@@ -29,90 +25,88 @@
29
25
  <div class="container">
30
26
  <h1><%= LicenseFinder.config.project_name %></h1>
31
27
  <div class="summary hero-unit">
32
- <h2>Dependencies</h2>
28
+ <div class="row">
29
+ <div class="span5">
30
+ <h2>Dependencies</h2>
33
31
 
34
- <p>As of <%= Time.now.strftime("%B %e, %Y %l:%M%P") %></p>
32
+ <p>As of <%= Time.now.strftime("%B %e, %Y %l:%M%P") %></p>
35
33
 
36
- <h4>
37
- <%= dependencies.size %> total
34
+ <h4><%= dependencies.size %> total</h4>
38
35
 
36
+ <ul>
37
+ <% grouped_dependencies.each do |license_name, group| -%>
38
+ <li><%= group.size %> <%= license_name %></li>
39
+ <% end -%>
40
+ </ul>
41
+ </div>
39
42
  <% if unapproved_dependencies.any? -%>
40
- <span class="badge badge-important"><%= unapproved_dependencies.size %> unapproved</span>
41
- <% end -%>
42
- </h4>
43
-
44
- <ul>
45
- <% grouped_dependencies.each do |license_name, group| -%>
46
- <li><%= group.size %> <%= license_name %></li>
43
+ <div class="action-items span5">
44
+ <h2>Action Items</h2>
45
+ <h4>
46
+ <%= unapproved_dependencies.size %> unapproved
47
+ <span class="badge badge-important">&#x2717;</span>
48
+ </h4>
49
+ <ul>
50
+ <% unapproved_dependencies.each do |dependency| -%>
51
+ <li>
52
+ <a href='#<%= dependency.name %>'>
53
+ <%= dependency.name %>
54
+ </a>
55
+ (<%= dependency.license.name %>)
56
+ </li>
57
+ <% end -%>
58
+ </ul>
59
+ </div>
47
60
  <% end -%>
48
- </ul>
49
- </div>
50
- <% if unapproved_dependencies.any? -%>
51
- <div class="action-items hero-unit">
52
- <h2>Action Items</h2>
53
- <h4><%= unapproved_dependencies.size %> unapproved dependencies</h4>
54
- <ul>
55
- <% unapproved_dependencies.each do |dependency| -%>
56
- <li>
57
- <a href='#<%= dependency.name %>'>
58
- <%= dependency.name %>
59
- </a>
60
- (<%= dependency.license.name %>)
61
- </li>
62
- <% end -%>
63
- </ul>
64
61
  </div>
65
- <% end -%>
62
+ </div>
66
63
  <div class="dependencies">
67
64
  <% sorted_dependencies.each do |dependency| -%>
68
- <div id="<%= dependency.name %>" class="<%= dependency.approved? ? "approved" : "unapproved" %>">
69
- <h2>
70
- <% if dependency.homepage && !dependency.homepage.empty? -%>
71
- <a href="<%= dependency.homepage %>"><%= dependency.name %></a>
65
+ <div id="<%= dependency.name %>" class="clearfix <%= dependency.approved? ? "approved" : "unapproved" %>">
66
+ <blockquote class="pull-right">
67
+ <% if dependency.approved_manually? -%>
68
+ <p>
69
+ <%= link_to_license(dependency.license) %>
70
+ manually approved
71
+ <span class="badge badge-success">&#x2713;</span>
72
+ </p>
73
+ <p><%= dependency.manual_approval.notes %></p>
74
+ <small>
75
+ <% if dependency.manual_approval.approver -%>
76
+ <%= dependency.manual_approval.approver %>,
77
+ <% end -%>
78
+ <time datetime="<%= dependency.manual_approval.safe_created_at.utc.iso8601 %>"><%= dependency.manual_approval.safe_created_at.to_date %></time>
79
+ </small>
80
+ <% elsif dependency.whitelisted? -%>
81
+ <p>
82
+ <%= link_to_license(dependency.license) %>
83
+ whitelisted
84
+ <span class="badge badge-success">&#x2713;</span>
85
+ </p>
72
86
  <% else -%>
73
- <%= dependency.name %>
74
- <% end -%>
75
- v<%= dependency.version %>
76
- <% if dependency.bundler_groups.any? -%>
77
- (<%= dependency.bundler_groups.map(&:name).join(", ") %>)
87
+ <p>
88
+ <%= link_to_license(dependency.license) %>
89
+ unapproved
90
+ <span class="badge badge-important">&#x2717;</span>
91
+ </p>
78
92
  <% end -%>
93
+ </blockquote>
94
+ <h2>
95
+ <%= link_to_dependency(dependency) %>
96
+ <small><%= version_groups(dependency) %></small>
79
97
  </h2>
80
- <table class="table table-striped table-bordered">
81
- <thead>
82
- <tr>
83
- <th>Summary</th>
84
- <th>Description</th>
85
- <th>License</th>
86
- </tr>
87
- </thead>
88
- <tbody>
89
- <tr>
90
- <td><%= dependency.summary %></td>
91
- <td><%= dependency.description %></td>
92
- <td>
93
- <% if dependency.license.url && !dependency.license.url.empty? -%>
94
- <a href="<%= dependency.license.url %>"><%= dependency.license.name %></a>
95
- <% else -%>
96
- <%= dependency.license.name %>
97
- <% end -%>
98
- </td>
99
- </tr>
100
- </tbody>
101
- </table>
98
+ <h4><%= dependency.summary %></h4>
99
+ <p><%= dependency.description %></p>
102
100
  <% if dependency.parents.any? -%>
103
101
  <dl>
104
- <dt>Parents</dt>
105
- <% dependency.parents.each do |parent| -%>
106
- <dd><%= parent.name %></dd>
107
- <% end -%>
102
+ <dt><%=dependency.name%> is required by:</dt>
103
+ <dd><%= dependency.parents.map(&:name).join(", ") -%></dd>
108
104
  </dl>
109
105
  <% end -%>
110
106
  <% if dependency.children.any? -%>
111
107
  <dl>
112
- <dt>Children</dt>
113
- <% dependency.children.each do |child| -%>
114
- <dd><%= child.name %></dd>
115
- <% end -%>
108
+ <dt><%=dependency.name%> relies on:</dt>
109
+ <dd><%= dependency.children.map(&:name).join(", ") -%></dd>
116
110
  </dl>
117
111
  <% end -%>
118
112
  </div>
@@ -120,4 +114,4 @@
120
114
  </div>
121
115
  </div>
122
116
  </body>
123
- </html>
117
+ </html>
@@ -1,14 +1,15 @@
1
1
  # <%= LicenseFinder.config.project_name %>
2
2
 
3
- As of <%= Time.now.strftime("%B %e, %Y %l:%M%P") %>. <%= dependencies.size %> total, _<%= unapproved_dependencies.size %> unapproved_
3
+ As of <%= Time.now.strftime("%B %e, %Y %l:%M%P") %>. <%= dependencies.size %> total
4
4
 
5
5
  ## Summary
6
6
  <% grouped_dependencies.each do |license_name, group| -%>
7
- * <%= group.size %> <%= license_name %>
7
+ * <%= group.size %> <%= license_name %>
8
8
  <% end %>
9
9
 
10
10
  <% if unapproved_dependencies.any? -%>
11
- <%= unapproved_dependencies.size %> unapproved dependencies
11
+ ## Action
12
+ <%= unapproved_dependencies.size %> *unapproved*
12
13
 
13
14
  <% unapproved_dependencies.each do |dependency| -%>
14
15
  * <a href='#<%= dependency.name %>'><%= dependency.name %></a> (<%= dependency.license.name %>)
@@ -17,27 +18,25 @@ As of <%= Time.now.strftime("%B %e, %Y %l:%M%P") %>. <%= dependencies.size %> to
17
18
 
18
19
  ## Items
19
20
 
20
- <% sorted_dependencies.each do |dependency|
21
- version_groups = "v#{dependency.version}"
22
- if dependency.bundler_groups.any?
23
- version_groups += "(#{dependency.bundler_groups.map(&:name).join(", ")})"
24
- end -%>
21
+ <% sorted_dependencies.each do |dependency| -%>
25
22
 
26
- <% if dependency.homepage && !dependency.homepage.empty? -%>
27
23
  <a name="<%= dependency.name %>"></a>
28
- ### [<%= dependency.name %>](<%= dependency.homepage %>) <%= version_groups -%>
24
+ ### <%= link_to_dependency(dependency) %> <%= version_groups(dependency) %>
25
+ #### <%= dependency.summary %>
26
+
27
+ <% if dependency.approved_manually? -%>
28
+ <%= link_to_license(dependency.license) %> manually approved
29
+
30
+ ><%= dependency.manual_approval.notes %>
31
+
32
+ ><cite> <%= dependency.manual_approval.approver %> <%= dependency.manual_approval.safe_created_at.to_date %></cite>
33
+ <% elsif dependency.whitelisted? -%>
34
+ <%= link_to_license(dependency.license) %> whitelisted
29
35
  <% else -%>
30
- ### <%= dependency.name %> <%= version_groups -%>
36
+ <%= link_to_license(dependency.license) %> _**unapproved**_
31
37
  <% end -%>
32
- <%
33
- license_text = (dependency.license.url && !dependency.license.url.empty?) ? "<a href='#{dependency.license.url}'>#{dependency.license.name}</a>" : dependency.license.name
34
- %>
35
38
 
36
- | Summary | License | Approved? |
37
- |---------|-------------|---------|
38
- |<%= dependency.summary %>|<%= license_text %>| <%= dependency.approved? ? 'Yes' : '_*No*_' %> |
39
-
40
- <% if dependency.description %>
41
- <% dependency.description.lines.each{|l| %>> <%= l -%><% } %>
42
- <% end %>
39
+ <% if dependency.description -%>
40
+ <%= dependency.description %>
41
+ <% end -%>
43
42
  <% end -%>
@@ -3,16 +3,16 @@ require './lib/license_finder/platform'
3
3
  Gem::Specification.new do |s|
4
4
  s.required_ruby_version = '>= 1.9.3'
5
5
  s.name = "license_finder"
6
- s.version = "1.0.0.0"
7
- s.authors = ["Jacob Maine", "Matthew Kane Parker", "Ian Lesperance", "David Edwards", "Paul Meskers", "Brent Wheeldon", "Trevor John", "David Tengdin", "William Ramsey"]
8
- s.email = ["licensefinder@pivotalabs.com"]
6
+ s.version = "1.1.1"
7
+ s.authors = ["Jacob Maine", "Matthew Kane Parker", "Ian Lesperance", "David Edwards", "Paul Meskers", "Brent Wheeldon", "Trevor John", "David Tengdin", "William Ramsey", "David Dening", "Geoff Pleiss", "Mike Chinigo"]
8
+ s.email = ["commoncode@pivotalabs.com"]
9
9
  s.homepage = "https://github.com/pivotal/LicenseFinder"
10
10
  s.summary = "Audit the OSS licenses of your application's dependencies."
11
11
 
12
12
  s.description = <<-DESCRIPTION
13
13
  Do you know the licenses of all your application's dependencies? What open source software licenses will your business accept?
14
14
 
15
- LicenseFinder culls your Gemfile, detects the licenses of the gems in it, and gives you a report that you can act on. If you already know
15
+ 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
16
16
  what licenses your business is comfortable with, you can whitelist them, leaving you with an action report of only those dependencies that have
17
17
  licenses that fall outside of the whitelist.
18
18
  DESCRIPTION
@@ -26,14 +26,14 @@ Gem::Specification.new do |s|
26
26
  s.add_dependency "xml-simple"
27
27
  s.add_dependency LicenseFinder::Platform.sqlite_gem
28
28
 
29
- %w(rspec xpath cucumber pry).each do |gem|
29
+ %w(rake rspec-its xpath cucumber pry).each do |gem|
30
30
  s.add_development_dependency gem
31
31
  end
32
32
 
33
+ s.add_development_dependency "rspec", "~> 3"
33
34
  s.add_development_dependency "capybara", "~> 2.0.0"
34
- s.add_development_dependency "rails", "~> 3.2.0"
35
35
  s.add_development_dependency "webmock", "~> 1.13"
36
- s.add_development_dependency "rake"
36
+ s.add_development_dependency "cocoapods" if RUBY_PLATFORM =~ /darwin/
37
37
 
38
38
  s.files = `git ls-files`.split("\n")
39
39
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
data/readme.md CHANGED
@@ -3,10 +3,18 @@
3
3
  [![Build Status](https://secure.travis-ci.org/pivotal/LicenseFinder.png)](http://travis-ci.org/pivotal/LicenseFinder)
4
4
  [![Code Climate](https://codeclimate.com/github/pivotal/LicenseFinder.png)](https://codeclimate.com/github/pivotal/LicenseFinder)
5
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.
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
7
 
8
- License Finder currently supports ruby gems, python eggs, and node modules. If you are looking to manage licenses on a java/maven project, we recommend using the [license maven plugin](http://mojo.codehaus.org/license-maven-plugin/).
8
+ ### Supported project types
9
+ - Ruby (+ Bundler)
10
+ - Python (+ Eggs)
11
+ - Node.js (+ Modules)
12
+ - Bower
9
13
 
14
+ ### Experimental project types
15
+ - Java (+ Maven)
16
+ - Java (+ Gradle)
17
+ - Objective-C (+ CocoaPods)
10
18
 
11
19
  ## Installation
12
20
 
@@ -16,15 +24,10 @@ Add license_finder to your project's Gemfile and `bundle`:
16
24
  gem 'license_finder'
17
25
  ```
18
26
 
19
- #### For gradle projects
20
-
21
- You need to install the license gradle plugin: [https://github.com/hierynomus/license-gradle-plugin](https://github.com/hierynomus/license-gradle-plugin)
22
-
23
-
24
27
  ## Usage
25
28
 
26
29
 
27
- License finder will generate reports of action items - i.e., dependencies that do not fall within your license "whitelist".
30
+ license_finder will generate reports of action items - i.e., dependencies that do not fall within your license "whitelist".
28
31
 
29
32
  ```sh
30
33
  $ license_finder
@@ -32,9 +35,9 @@ $ license_finder
32
35
 
33
36
  (Note) If you wish to run license_finder without the progress spinner use the --quiet option.
34
37
 
35
- 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.
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.
36
39
 
37
- On a brand new Rails project, you could expect `license_finder` to output something like the following
40
+ On a brand new Rails project, you could expect license_finder to output something like the following
38
41
  (assuming you whitelisted the MIT license -- see [Configuration](#configuration)):
39
42
 
40
43
  ```
@@ -49,12 +52,12 @@ rubyzip, 0.9.9, ruby
49
52
  xml-simple, 1.1.1, other
50
53
  ```
51
54
 
52
- The executable task will also write out a dependencies.db, dependencies.csv, and dependencies.html file in the doc/
53
- directory (by default -- see [Configuration](#configuration)).
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)).
54
57
 
55
58
  The latter two files are human readable reports that you could send to your non-technical business partners, lawyers, etc.
56
59
 
57
- `license_finder` will also return a non-zero exit status if there are
60
+ license_finder will also return a non-zero exit status if there are
58
61
  unapproved dependencies. You could use this in a CI build, for example, to alert you whenever someone adds an
59
62
  unapproved dependency to the project.
60
63
 
@@ -62,7 +65,7 @@ Run `license_finder help` to see other available commands.
62
65
 
63
66
  ### Manually setting licenses
64
67
 
65
- When `license_finder` reports that a dependency's license is 'other', you should manually research what the actual
68
+ When license_finder reports that a dependency's license is 'other', you should manually research what the actual
66
69
  license is. When you have established the real license, you can record it with:
67
70
 
68
71
  ```sh
@@ -73,7 +76,7 @@ This command would assign the MIT license to the dependency `my_unknown_dependen
73
76
 
74
77
  ### Manually approving dependencies
75
78
 
76
- Whenever you have a dependency that falls outside of your whitelist, `license_finder` will tell you.
79
+ Whenever you have a dependency that falls outside of your whitelist, license_finder will tell you.
77
80
  If your business decides that this is an acceptable risk, you can manually approve the dependency by using the
78
81
  `license_finder approve` command.
79
82
 
@@ -92,52 +95,12 @@ Your business tells you that in this case, it's acceptable to use this gem. You
92
95
  $ license_finder approve awesome_gpl_gem
93
96
  ```
94
97
 
95
- If you rerun `license_finder`, you should no longer see `awesome_gpl_gem` in the output.
96
-
97
- ### Managing license whitelist
98
-
99
- Licenses can be added to a whitelist that tells LicenseFinder to automatically approve dependencies using the specified licenses.
100
- These licenses can be managed with the `whitelist` command.
101
-
102
- To list licenses currently on the whitelist:
103
-
104
- ```sh
105
- $ license_finder whitelist list
106
- ```
107
-
108
- To add a licenses to the whitelist:
109
-
110
- ```sh
111
- $ license_finder whitelist add MIT [BSD [...]]
112
- ```
98
+ If you rerun license_finder, you should no longer see `awesome_gpl_gem` in the output.
113
99
 
114
- To remove a licenses from the whitelist:
100
+ To record who approved the dependency and why:
115
101
 
116
102
  ```sh
117
- $ license_finder whitelist remove MIT [BSD [...]]
118
- ```
119
-
120
- ### Managing ignored Bundler groups
121
-
122
- Bundler groups can be added to an ignore list which will prevent LicenseFinder from evaluating their licenses.
123
- These groups can be managed with the `ignored_bundler_groups` command.
124
-
125
- To list currently ignored Bundler groups:
126
-
127
- ```sh
128
- $ license_finder ignored_bundler_groups list
129
- ```
130
-
131
- To add a group to the ignored Bundler groups:
132
-
133
- ```sh
134
- $ license_finder ignored_bundler_groups add development
135
- ```
136
-
137
- To remove a group from the ignored Bundler groups:
138
-
139
- ```sh
140
- $ license_finder ignored_bundler_groups remove development
103
+ $ license_finder approve awesome_gpl_gem --approver CTO --message "Go ahead"
141
104
  ```
142
105
 
143
106
  ### Manually managing dependencies
@@ -155,6 +118,12 @@ To automatically approve an unmanaged dependency when you add it, use:
155
118
  $ license_finder dependencies add MIT my_js_dep 0.1.2 --approve
156
119
  ```
157
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
+
158
127
  The version is optional. Run `license_finder dependencies help` for additional documentation about
159
128
  managing these dependencies.
160
129
 
@@ -165,20 +134,10 @@ project, so you can use:
165
134
  $ license_finder dependencies remove my_js_dep
166
135
  ```
167
136
 
168
- ### Managing project name
169
-
170
- The HTML report generated by license_finder will have the name of your project at the top. By default, this is set to the name of your working directory. However, this can be changed using the command line:
171
-
172
- ```sh
173
- $ license_finder project_name set 'My Project Name'
174
- ```
175
-
176
- The changes will be reflected in the report the next time you run license_finder.
177
-
178
137
 
179
138
  ## Configuration
180
139
 
181
- The first time you run `license_finder` it will create a default configuration file `./config/license_finder.yml`:
140
+ The first time you run license_finder it will create a default configuration file `./config/license_finder.yml`:
182
141
 
183
142
  ```yaml
184
143
  ---
@@ -188,24 +147,58 @@ whitelist:
188
147
  ignore_groups:
189
148
  #- test
190
149
  #- development
150
+ ignore_dependencies:
151
+ #- bundler
191
152
  dependencies_file_dir: './doc/'
192
153
  project_name: My Project Name
154
+ gradle_command: # only meaningful if used with a Java/gradle project. Defaults to "gradle".
193
155
  ```
194
156
 
195
- By modifying this file, you can configure license_finder's behavior. `Whitelisted` licenses will be automatically approved
196
- and `ignore_groups` will limit which dependencies are included in your license report. You can store the license database
197
- and text files in another directory by changing `dependencies_file_dir`.
157
+ By modifying this file, you can configure license_finder's behavior.
198
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".
199
170
 
200
- ## HTML Report
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
201
176
 
202
- The HTML report generated by license_finder has two sections, an overview at the top, and then a series of dependency summaries afterwards.
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`:
203
180
 
204
- ![HTML Report](files/report_breakdown.png)
181
+ ```yaml
182
+ # … other configuration …
205
183
 
206
- The individual dependency summary follows a pattern like this:
184
+ gradle_command: ./gradlew
185
+ ```
207
186
 
208
- ![HTML Report](files/dependency_breakdown.png)
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`.
209
202
 
210
203
  ## Upgrade for pre 0.8.0 users
211
204
 
@@ -215,7 +208,7 @@ If you wish to cleanup your root directory you can run:
215
208
  $ license_finder move
216
209
  ```
217
210
 
218
- This will move your dependencies.* files to the /doc directory and update the config.
211
+ This will move your `dependencies.*` files to the doc/ directory and update the config.
219
212
 
220
213
 
221
214
  ## Compatibility
@@ -251,7 +244,11 @@ And add a `LICENSE` file to your gem that contains your license text.
251
244
  * Rebase on top of master
252
245
  * Send a pull request
253
246
 
254
- To successfully run the test suite, you will need node.js, python and pip installed (pip should not require sudo to work, virtualenv will work for this). If you're running the test suite with jruby, you're probably going to want to set up these environment variables:
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:
255
252
 
256
253
  ```
257
254
  JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1' JRUBY_OPTS='-J-Djruby.launch.inproc=true'