license_finder 3.0.4 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (251) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +56 -0
  3. data/CHANGELOG.md +29 -2
  4. data/CONTRIBUTING.md +5 -1
  5. data/Dockerfile +33 -10
  6. data/Gemfile +2 -2
  7. data/README.md +27 -5
  8. data/Rakefile +15 -21
  9. data/ci/pipelines/pipeline.yml.erb +40 -6
  10. data/ci/pipelines/release.yml +11 -5
  11. data/ci/scripts/containerize-tests.sh +16 -0
  12. data/ci/scripts/run-rubocop.sh +8 -0
  13. data/ci/scripts/run-tests.sh +22 -0
  14. data/ci/scripts/test.ps1 +81 -0
  15. data/ci/tasks/build-windows.yml +6 -0
  16. data/ci/tasks/build.yml +2 -2
  17. data/ci/tasks/rubocop.yml +13 -0
  18. data/features/features/cli/cli_spec.rb +8 -8
  19. data/features/features/configure/add_dependencies_spec.rb +7 -7
  20. data/features/features/configure/approve_dependencies_spec.rb +15 -15
  21. data/features/features/configure/assign_licenses_spec.rb +4 -4
  22. data/features/features/configure/blacklist_licenses_spec.rb +3 -3
  23. data/features/features/configure/ignore_dependencies_spec.rb +3 -3
  24. data/features/features/configure/ignore_groups_spec.rb +4 -4
  25. data/features/features/configure/name_project_spec.rb +4 -4
  26. data/features/features/configure/set_project_path_spec.rb +2 -2
  27. data/features/features/configure/whitelist_licenses_spec.rb +4 -4
  28. data/features/features/package_managers/bower_spec.rb +3 -3
  29. data/features/features/package_managers/carthage_spec.rb +14 -0
  30. data/features/features/package_managers/cocoapods_spec.rb +3 -3
  31. data/features/features/package_managers/conan_spec.rb +11 -0
  32. data/features/features/package_managers/dep_spec.rb +15 -0
  33. data/features/features/package_managers/glide_spec.rb +14 -0
  34. data/features/features/package_managers/govendor_spec.rb +15 -0
  35. data/features/features/package_managers/gradle_spec.rb +1 -1
  36. data/features/features/package_managers/gvt_spec.rb +14 -0
  37. data/features/features/package_managers/maven_spec.rb +2 -3
  38. data/features/features/package_managers/mix_spec.rb +16 -0
  39. data/features/features/package_managers/npm_spec.rb +3 -3
  40. data/features/features/package_managers/nuget_spec.rb +4 -4
  41. data/features/features/package_managers/pip_spec.rb +2 -2
  42. data/features/features/package_managers/rebar_spec.rb +3 -3
  43. data/features/features/package_managers/yarn_spec.rb +14 -0
  44. data/features/features/report/composite_spec.rb +1 -1
  45. data/features/features/report/csv_spec.rb +3 -3
  46. data/features/features/report/diff_spec.rb +20 -10
  47. data/features/features/report/html_spec.rb +10 -10
  48. data/features/features/report/subproject_spec.rb +15 -4
  49. data/features/fixtures/Cartfile +1 -0
  50. data/features/fixtures/Podfile +1 -1
  51. data/features/fixtures/alternate-build-file-gradle/build-alt.gradle +5 -15
  52. data/features/fixtures/build.gradle +5 -15
  53. data/features/fixtures/conanfile.txt +11 -0
  54. data/features/fixtures/file-based-libs-gradle/build.gradle +5 -7
  55. data/features/fixtures/gopath_dep/src/foo-dep/Gopkg.lock +9 -0
  56. data/features/fixtures/gopath_dep/src/foo-dep/Gopkg.toml +7 -0
  57. data/features/fixtures/gopath_dep/src/foo-dep/bar/bar.go +10 -0
  58. data/features/fixtures/gopath_dep/src/foo-dep/foo.go +7 -0
  59. data/features/fixtures/gopath_glide/src/glide.lock +9 -0
  60. data/features/fixtures/gopath_glide/src/glide.yaml +6 -0
  61. data/features/fixtures/gopath_govendor/src/vendor/vendor.json +19 -0
  62. data/features/fixtures/gopath_gvt/src/vendor/manifest +22 -0
  63. data/features/fixtures/gradle-wrapper/build.gradle +5 -15
  64. data/features/fixtures/gradle-wrapper/gradlew +6 -1
  65. data/features/fixtures/gradle-wrapper/gradlew.bat +9 -1
  66. data/features/fixtures/mix.exs +22 -0
  67. data/features/fixtures/multi-module-gradle/build.gradle +7 -15
  68. data/features/fixtures/single-module-gradle/build.gradle +5 -15
  69. data/features/support/testing_dsl.rb +155 -43
  70. data/lib/license_finder.rb +4 -3
  71. data/lib/license_finder/cli.rb +0 -3
  72. data/lib/license_finder/cli/approvals.rb +3 -3
  73. data/lib/license_finder/cli/base.rb +11 -8
  74. data/lib/license_finder/cli/blacklist.rb +7 -7
  75. data/lib/license_finder/cli/dependencies.rb +8 -8
  76. data/lib/license_finder/cli/ignored_dependencies.rb +4 -4
  77. data/lib/license_finder/cli/ignored_groups.rb +4 -4
  78. data/lib/license_finder/cli/licenses.rb +2 -2
  79. data/lib/license_finder/cli/main.rb +59 -39
  80. data/lib/license_finder/cli/makes_decisions.rb +2 -2
  81. data/lib/license_finder/cli/patched_thor.rb +6 -7
  82. data/lib/license_finder/cli/project_name.rb +5 -6
  83. data/lib/license_finder/cli/whitelist.rb +7 -7
  84. data/lib/license_finder/configuration.rb +15 -4
  85. data/lib/license_finder/core.rb +20 -4
  86. data/lib/license_finder/decision_applier.rb +0 -1
  87. data/lib/license_finder/decisions.rb +12 -14
  88. data/lib/license_finder/diff.rb +33 -31
  89. data/lib/license_finder/license.rb +13 -9
  90. data/lib/license_finder/license/definitions.rb +55 -55
  91. data/lib/license_finder/license/none_matcher.rb +1 -1
  92. data/lib/license_finder/license/template.rb +1 -1
  93. data/lib/license_finder/license/text.rb +0 -1
  94. data/lib/license_finder/license_aggregator.rb +1 -0
  95. data/lib/license_finder/logger.rb +18 -61
  96. data/lib/license_finder/package.rb +25 -11
  97. data/lib/license_finder/package_delta.rb +3 -6
  98. data/lib/license_finder/package_manager.rb +77 -34
  99. data/lib/license_finder/package_managers/bower.rb +8 -8
  100. data/lib/license_finder/package_managers/bower_package.rb +12 -12
  101. data/lib/license_finder/package_managers/bundler.rb +21 -9
  102. data/lib/license_finder/package_managers/bundler_package.rb +1 -1
  103. data/lib/license_finder/package_managers/carthage.rb +66 -0
  104. data/lib/license_finder/package_managers/carthage_package.rb +16 -0
  105. data/lib/license_finder/package_managers/cocoa_pods.rb +13 -13
  106. data/lib/license_finder/package_managers/cocoa_pods_package.rb +1 -1
  107. data/lib/license_finder/package_managers/conan.rb +26 -0
  108. data/lib/license_finder/package_managers/conan_info_parser.rb +74 -0
  109. data/lib/license_finder/package_managers/conan_package.rb +17 -0
  110. data/lib/license_finder/package_managers/dep.rb +33 -0
  111. data/lib/license_finder/package_managers/glide.rb +30 -0
  112. data/lib/license_finder/package_managers/{go_vendor.rb → go_15vendorexperiment.rb} +19 -24
  113. data/lib/license_finder/package_managers/go_dep.rb +15 -12
  114. data/lib/license_finder/package_managers/go_package.rb +15 -13
  115. data/lib/license_finder/package_managers/go_workspace.rb +39 -34
  116. data/lib/license_finder/package_managers/govendor.rb +32 -0
  117. data/lib/license_finder/package_managers/gradle.rb +16 -16
  118. data/lib/license_finder/package_managers/gradle_package.rb +8 -8
  119. data/lib/license_finder/package_managers/gvt.rb +61 -0
  120. data/lib/license_finder/package_managers/maven.rb +17 -18
  121. data/lib/license_finder/package_managers/maven_package.rb +4 -6
  122. data/lib/license_finder/package_managers/merged_package.rb +25 -2
  123. data/lib/license_finder/package_managers/mix.rb +51 -0
  124. data/lib/license_finder/package_managers/mix_package.rb +7 -0
  125. data/lib/license_finder/package_managers/npm.rb +8 -32
  126. data/lib/license_finder/package_managers/npm_package.rb +51 -48
  127. data/lib/license_finder/package_managers/nuget.rb +30 -40
  128. data/lib/license_finder/package_managers/pip.rb +11 -11
  129. data/lib/license_finder/package_managers/pip_package.rb +8 -8
  130. data/lib/license_finder/package_managers/rebar.rb +11 -11
  131. data/lib/license_finder/package_managers/yarn.rb +62 -0
  132. data/lib/license_finder/packages/activation.rb +2 -2
  133. data/lib/license_finder/packages/license_files.rb +6 -6
  134. data/lib/license_finder/packages/licensing.rb +8 -10
  135. data/lib/license_finder/packages/manual_package.rb +2 -2
  136. data/lib/license_finder/project_finder.rb +6 -5
  137. data/lib/license_finder/report.rb +1 -0
  138. data/lib/license_finder/reports/csv_report.rb +4 -4
  139. data/lib/license_finder/reports/diff_report.rb +2 -2
  140. data/lib/license_finder/reports/erb_report.rb +2 -4
  141. data/lib/license_finder/reports/html_report.rb +2 -2
  142. data/lib/license_finder/reports/markdown_report.rb +1 -1
  143. data/lib/license_finder/reports/merged_report.rb +1 -1
  144. data/lib/license_finder/reports/text_report.rb +3 -5
  145. data/lib/license_finder/shared_helpers/cmd.rb +11 -0
  146. data/lib/license_finder/version.rb +1 -1
  147. data/license_finder-2.1.2.gem +0 -0
  148. data/license_finder.gemspec +38 -38
  149. metadata +84 -118
  150. data/ci/scripts/test.sh +0 -26
  151. data/ci/tasks/create-source-archives.yml +0 -23
  152. data/spec/dummy_app/Gemfile +0 -6
  153. data/spec/fixtures/all_pms/.envrc +0 -1
  154. data/spec/fixtures/all_pms/.nuget/.keep +0 -0
  155. data/spec/fixtures/all_pms/Gemfile +0 -0
  156. data/spec/fixtures/all_pms/Godeps/Godeps.json +0 -0
  157. data/spec/fixtures/all_pms/Podfile +0 -0
  158. data/spec/fixtures/all_pms/bower.json +0 -0
  159. data/spec/fixtures/all_pms/build.gradle +0 -0
  160. data/spec/fixtures/all_pms/package.json +0 -0
  161. data/spec/fixtures/all_pms/pom.xml +0 -0
  162. data/spec/fixtures/all_pms/rebar.config +0 -0
  163. data/spec/fixtures/all_pms/requirements.txt +0 -0
  164. data/spec/fixtures/all_pms/vendor/.gitkeep +0 -0
  165. data/spec/fixtures/composite/Gemfile +0 -0
  166. data/spec/fixtures/composite/nested_project/.envrc +0 -8
  167. data/spec/fixtures/composite/nested_project/src/github.com/pivotal/foo/Godeps/Godeps.json +0 -16
  168. data/spec/fixtures/composite/nested_project/src/github.com/pivotal/foo/Godeps/Readme +0 -5
  169. data/spec/fixtures/composite/nested_project/src/github.com/pivotal/foo/foo.go +0 -6
  170. data/spec/fixtures/composite/not_a_project/DONTREADME.md +0 -0
  171. data/spec/fixtures/composite/project1/Gemfile +0 -0
  172. data/spec/fixtures/composite/project2/package.json +0 -0
  173. data/spec/fixtures/config/license_finder.yml +0 -5
  174. data/spec/fixtures/license_directory/COPYING +0 -1
  175. data/spec/fixtures/license_directory/LICENSE/MIT.txt +0 -1
  176. data/spec/fixtures/license_directory/LICENSE/lib/unrelated.txt +0 -2
  177. data/spec/fixtures/license_names/COPYING.txt +0 -1
  178. data/spec/fixtures/license_names/LICENSE +0 -1
  179. data/spec/fixtures/license_names/Licence.rdoc +0 -1
  180. data/spec/fixtures/license_names/Mit-License +0 -1
  181. data/spec/fixtures/license_names/README.rdoc +0 -1
  182. data/spec/fixtures/nested_gem/vendor/LICENSE +0 -1
  183. data/spec/fixtures/npm-circular-dependencies/npm-list.json +0 -5339
  184. data/spec/fixtures/npm-circular-dependencies/package.json +0 -5
  185. data/spec/fixtures/npm-circular-licenses/npm-list.json +0 -7597
  186. data/spec/fixtures/npm-circular-licenses/package.json +0 -23
  187. data/spec/fixtures/npm-licenses-string/npm-list.json +0 -7597
  188. data/spec/fixtures/npm-licenses-string/package.json +0 -23
  189. data/spec/fixtures/npm-recursive-dependencies/npm-list.json +0 -5158
  190. data/spec/fixtures/npm-recursive-dependencies/package.json +0 -15
  191. data/spec/fixtures/npm-stack-too-deep/npm-list.json +0 -13464
  192. data/spec/fixtures/npm-stack-too-deep/package.json +0 -5
  193. data/spec/fixtures/utf8_gem/README +0 -210
  194. data/spec/lib/license_finder/cli/approvals_spec.rb +0 -71
  195. data/spec/lib/license_finder/cli/blacklist_spec.rb +0 -58
  196. data/spec/lib/license_finder/cli/dependencies_spec.rb +0 -73
  197. data/spec/lib/license_finder/cli/ignored_dependencies_spec.rb +0 -47
  198. data/spec/lib/license_finder/cli/ignored_groups_spec.rb +0 -40
  199. data/spec/lib/license_finder/cli/licenses_spec.rb +0 -60
  200. data/spec/lib/license_finder/cli/main_spec.rb +0 -243
  201. data/spec/lib/license_finder/cli/project_name_spec.rb +0 -40
  202. data/spec/lib/license_finder/cli/whitelist_spec.rb +0 -58
  203. data/spec/lib/license_finder/configuration_spec.rb +0 -115
  204. data/spec/lib/license_finder/core_spec.rb +0 -54
  205. data/spec/lib/license_finder/decision_applier_spec.rb +0 -219
  206. data/spec/lib/license_finder/decisions_spec.rb +0 -408
  207. data/spec/lib/license_finder/diff_spec.rb +0 -129
  208. data/spec/lib/license_finder/license/definitions_spec.rb +0 -177
  209. data/spec/lib/license_finder/license_aggregator_spec.rb +0 -61
  210. data/spec/lib/license_finder/license_spec.rb +0 -106
  211. data/spec/lib/license_finder/package_delta_spec.rb +0 -18
  212. data/spec/lib/license_finder/package_manager_spec.rb +0 -62
  213. data/spec/lib/license_finder/package_managers/bower_package_spec.rb +0 -71
  214. data/spec/lib/license_finder/package_managers/bower_spec.rb +0 -39
  215. data/spec/lib/license_finder/package_managers/bundler_package_spec.rb +0 -35
  216. data/spec/lib/license_finder/package_managers/bundler_spec.rb +0 -56
  217. data/spec/lib/license_finder/package_managers/cocoa_pods_package_spec.rb +0 -48
  218. data/spec/lib/license_finder/package_managers/cocoa_pods_spec.rb +0 -59
  219. data/spec/lib/license_finder/package_managers/go_dep_spec.rb +0 -126
  220. data/spec/lib/license_finder/package_managers/go_package_spec.rb +0 -33
  221. data/spec/lib/license_finder/package_managers/go_vendor_spec.rb +0 -144
  222. data/spec/lib/license_finder/package_managers/go_workspace_spec.rb +0 -286
  223. data/spec/lib/license_finder/package_managers/gradle_package_spec.rb +0 -80
  224. data/spec/lib/license_finder/package_managers/gradle_spec.rb +0 -180
  225. data/spec/lib/license_finder/package_managers/maven_package_spec.rb +0 -63
  226. data/spec/lib/license_finder/package_managers/maven_spec.rb +0 -128
  227. data/spec/lib/license_finder/package_managers/merged_package_spec.rb +0 -60
  228. data/spec/lib/license_finder/package_managers/npm_package_spec.rb +0 -57
  229. data/spec/lib/license_finder/package_managers/npm_spec.rb +0 -253
  230. data/spec/lib/license_finder/package_managers/nuget_package_spec.rb +0 -9
  231. data/spec/lib/license_finder/package_managers/nuget_spec.rb +0 -157
  232. data/spec/lib/license_finder/package_managers/pip_package_spec.rb +0 -87
  233. data/spec/lib/license_finder/package_managers/pip_spec.rb +0 -47
  234. data/spec/lib/license_finder/package_managers/rebar_package_spec.rb +0 -24
  235. data/spec/lib/license_finder/package_managers/rebar_spec.rb +0 -50
  236. data/spec/lib/license_finder/package_spec.rb +0 -179
  237. data/spec/lib/license_finder/packages/activation_spec.rb +0 -41
  238. data/spec/lib/license_finder/packages/license_files_spec.rb +0 -46
  239. data/spec/lib/license_finder/packages/licensing_spec.rb +0 -1
  240. data/spec/lib/license_finder/packages/possible_license_file_spec.rb +0 -38
  241. data/spec/lib/license_finder/project_finder_spec.rb +0 -33
  242. data/spec/lib/license_finder/reports/csv_report_spec.rb +0 -70
  243. data/spec/lib/license_finder/reports/diff_report_spec.rb +0 -56
  244. data/spec/lib/license_finder/reports/html_report_spec.rb +0 -101
  245. data/spec/lib/license_finder/reports/markdown_report_spec.rb +0 -45
  246. data/spec/lib/license_finder/reports/merged_report_spec.rb +0 -21
  247. data/spec/lib/license_finder/reports/text_report_spec.rb +0 -43
  248. data/spec/spec_helper.rb +0 -27
  249. data/spec/support/shared_examples_for_package_manager.rb +0 -52
  250. data/spec/support/stdout_helpers.rb +0 -31
  251. data/spec/support/test_fixtures.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df518f591c669fe1a648f5513797ba99701be14b
4
- data.tar.gz: e19c932c315fe285f147adc7c99f5ab982be13f2
3
+ metadata.gz: 956d6a13cb2fb6bdcaa433ec77957db763a41d6b
4
+ data.tar.gz: 1f9a2da6f824d793b9dffb6a1e5903de465d8d13
5
5
  SHA512:
6
- metadata.gz: 4ed3e1a000a8838c366b9773bcf7fffd508e7a61398e72173d2b38e1ea6538c944a13eb1d5bb176c61f994ce2bcf2b46e7a2c8507ee02c383d20d95f2e23040c
7
- data.tar.gz: 0f575f901938b93b9acde6dd461a7ed57ed99224862ec0fb3e1f68f128ec4a9685836f64b9852522af6d96326a76681549a67cde1f736590edb67e17699513ba
6
+ metadata.gz: d2fb7013ff3482c23d1fba6c30aef68df057e1c61665f50907ed0f8e1151a0785430c4a233424d8c5d890f426e57234df435dec7c5e7ea70712eb21941271c17
7
+ data.tar.gz: 9805ab07f8d85a4b1d34d4a4e26b44c645e4477eef615b870692c9099233ecb072b9acc895917960ad2763c447825a059d7ee04e144a062e2231499b4006cc2a
data/.rubocop.yml ADDED
@@ -0,0 +1,56 @@
1
+ #Layout Cops
2
+ IndentHeredoc:
3
+ Enabled: false
4
+
5
+ #Linting Cops
6
+ AmbiguousRegexpLiteral:
7
+ Enabled: false
8
+
9
+ # Metrics Cops
10
+ AbcSize:
11
+ Max: 30
12
+ BlockLength:
13
+ Enabled: false # TODO: enable and refactor long methods
14
+ # ExcludedMethods: ['describe', 'context', 'it', 'shared_examples'] # uncomment once enabled
15
+ ClassLength:
16
+ Enabled: false
17
+ CyclomaticComplexity:
18
+ Max: 10
19
+ PerceivedComplexity:
20
+ Max: 10
21
+ LineLength:
22
+ Max: 200
23
+ MethodLength:
24
+ Enabled: false
25
+ ModuleLength:
26
+ Enabled: false
27
+
28
+ # Security Cops
29
+ YAMLLoad:
30
+ Enabled: false
31
+
32
+ #Style Cops
33
+ DoubleNegation:
34
+ Enabled: false
35
+ Documentation:
36
+ Enabled: false
37
+ FileName:
38
+ Exclude:
39
+ - '**/Rakefile'
40
+ - '**/Gemfile'
41
+ - '**/Podfile'
42
+ MethodMissing:
43
+ Enabled: false
44
+ ModuleFunction:
45
+ Enabled: false
46
+
47
+ AllCops:
48
+ Include:
49
+ - 'bin/license_finder'
50
+ Exclude:
51
+ - 'lib/license_finder/reports/**/*'
52
+ - 'features/fixtures/**/*'
53
+ - 'releases/**/*'
54
+ - 'ci/**/*'
55
+ - 'tmp/**/*'
56
+ - 'Gemfile'
data/CHANGELOG.md CHANGED
@@ -1,4 +1,29 @@
1
- # [3.0.4] / 2017-09-11
1
+ # [3.1.0] / 2017-11-10
2
+
3
+ ### Added
4
+
5
+ * Added support for [Carthage](https://github.com/Carthage/Carthage)
6
+ * Added support for [gvt](https://github.com/FiloSottile/gvt)
7
+ * Added support for [yarn](https://yarnpkg.com/en/)
8
+ * Added support for [glide](https://github.com/Masterminds/glide)
9
+ * Added support for [GoVendor](https://github.com/kardianos/govendor)
10
+ * Added support for [Dep](https://github.com/golang/dep)
11
+ * Added support for [Conan](https://conan.io/)
12
+ * Added `--prepare` option
13
+ * `--prepare`/`-p` is an option which can now be passed to the `action_items` or `report` task of `license_finder`
14
+ * `prepare` will indicate to License Finder that it should attempt to prepare the project before running in a License scan.
15
+
16
+ ### Changed
17
+
18
+ * Upgrade `Gradle` in Dockerfile
19
+ * Clean up some CLI interaction and documentation
20
+
21
+ ### Fixed
22
+
23
+ * `build-essential` was added back into the Dockerfile after accidentally being removed
24
+ * Ignore leading prefixes such as 'The' when looking for licenses
25
+
26
+ # [3.0.4] / 2017-09-14
2
27
 
3
28
  ### Added
4
29
  * Added concourse pipeline file for Docker image process (#335, #337)
@@ -461,7 +486,9 @@ Bugfixes:
461
486
  * Fix blow up if there's not `ignore_groups` setting in the config file.
462
487
 
463
488
 
464
- [Unreleased]: https://github.com/pivotal/LicenseFinder/compare/v3.0.2...HEAD
489
+ [Unreleased]: https://github.com/pivotal/LicenseFinder/compare/v3.0.4...HEAD
490
+ [3.1.0]: https://github.com/pivotal/LicenseFinder/compare/v3.0.4...v3.1.0
491
+ [3.0.4]: https://github.com/pivotal/LicenseFinder/compare/v3.0.2...v3.0.4
465
492
  [3.0.2]: https://github.com/pivotal/LicenseFinder/compare/v3.0.1...v3.0.2
466
493
  [3.0.1]: https://github.com/pivotal/LicenseFinder/compare/v3.0.0...v3.0.1
467
494
  [3.0.0]: https://github.com/pivotal/LicenseFinder/compare/v2.1.2...v3.0.0
data/CONTRIBUTING.md CHANGED
@@ -59,14 +59,18 @@ If you come up with something useful, consider posting it to the Google Group
59
59
 
60
60
  To successfully run the test suite, you will need the following installed:
61
61
  - NPM (requires Node)
62
+ - Yarn (requires Node)
62
63
  - Bower (requires Node and NPM)
63
64
  - Maven (requires Java)
64
65
  - Gradle (requires Java)
65
66
  - Pip (requires python)
66
67
  - Rebar (requires erlang)
67
- - GoDep, GoWorkspace, and GoVendor (requires golang)
68
+ - GoDep, GoWorkspace, govendor, Glide, Dep, and Gvt (requires golang)
68
69
  - CocoaPods (requires ruby)
69
70
  - Bundler (requires ruby)
71
+ - Carthage (requires homebrew)
72
+ - Mix (requires Elixir)
73
+ - Conan
70
74
 
71
75
  The [LicenseFinder docker image](https://hub.docker.com/r/licensefinder/license_finder/) already contains these dependencies.
72
76
 
data/Dockerfile CHANGED
@@ -1,10 +1,16 @@
1
1
  FROM ubuntu:trusty
2
- RUN apt-get update && apt-get install -y curl git-core wget unzip
2
+ RUN apt-get update && apt-get install -y curl git-core build-essential wget unzip
3
3
 
4
4
  # nodejs seems to be required for the one of the gems
5
5
  RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
6
6
  apt-get -y install nodejs
7
7
 
8
+ # install yarn
9
+ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
10
+ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
11
+ apt-get update && \
12
+ apt-get install yarn
13
+
8
14
  # install bower
9
15
  RUN npm install -g bower && \
10
16
  echo '{ "allow_root": true }' > /root/.bowerrc
@@ -34,17 +40,17 @@ RUN apt-get install -y python-pip && \
34
40
  pip install --upgrade pip
35
41
 
36
42
  # install maven
37
- RUN curl -O http://www-us.apache.org/dist/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz && \
38
- tar -xf apache-maven-3.5.0-bin.tar.gz; rm -rf apache-maven-3.5.0-bin.tar.gz && \
39
- mv apache-maven-3.5.0 /usr/local/lib/maven && \
43
+ RUN curl -O http://www-us.apache.org/dist/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz && \
44
+ tar -xf apache-maven-3.5.2-bin.tar.gz; rm -rf apache-maven-3.5.2-bin.tar.gz && \
45
+ mv apache-maven-3.5.2 /usr/local/lib/maven && \
40
46
  ln -s /usr/local/lib/maven/bin/mvn /usr/local/bin/mvn
41
47
 
42
48
  # install gradle
43
49
  WORKDIR /tmp
44
- RUN curl -L -o gradle.zip http://services.gradle.org/distributions/gradle-2.9-bin.zip && \
50
+ RUN curl -L -o gradle.zip http://services.gradle.org/distributions/gradle-4.2-bin.zip && \
45
51
  unzip -q gradle.zip && \
46
52
  rm gradle.zip && \
47
- mv gradle-2.9 /root/gradle
53
+ mv gradle-4.2 /root/gradle
48
54
  ENV PATH=/root/gradle/bin:$PATH
49
55
 
50
56
  #install go
@@ -57,7 +63,12 @@ ENV PATH=$PATH:/go/bin
57
63
  ENV GOROOT=/go
58
64
  ENV GOPATH=/gopath
59
65
  ENV PATH=$PATH:$GOPATH/bin
60
- RUN mkdir /gopath && go get github.com/tools/godep
66
+ RUN mkdir /gopath && \
67
+ go get github.com/tools/godep && \
68
+ go get github.com/FiloSottile/gvt && \
69
+ go get github.com/Masterminds/glide && \
70
+ go get github.com/kardianos/govendor && \
71
+ go get github.com/golang/dep/cmd/dep
61
72
 
62
73
  # Fix the locale
63
74
  RUN locale-gen en_US.UTF-8
@@ -66,14 +77,26 @@ ENV LANGUAGE=en_US:en
66
77
  ENV LC_ALL=en_US.UTF-8
67
78
 
68
79
  #install rvm
69
- RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && \
80
+ RUN gpg --keyserver hkp://pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && \
70
81
  curl -sSL https://raw.githubusercontent.com/wayneeseguin/rvm/stable/binscripts/rvm-installer | sudo bash -s stable --ruby=2.4.1
71
82
  ENV PATH=/usr/local/rvm/bin:$PATH
72
83
 
84
+ #install mix
85
+ RUN wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && \
86
+ sudo dpkg -i erlang-solutions_1.0_all.deb && \
87
+ sudo apt-get update && \
88
+ sudo apt-get install -y esl-erlang && \
89
+ sudo apt-get install -y elixir
90
+
73
91
  # install bundler
74
- RUN bash -lc "rvm install 2.4.1 --default && gem install bundler"
92
+ RUN bash -lc "gem update --system && gem install bundler"
93
+
94
+ # install conan
95
+ RUN apt-get install -y python-dev && \
96
+ pip install conan
75
97
 
76
98
  # install license_finder
77
- RUN bash -lc "git clone https://github.com/pivotal/LicenseFinder /LicenseFinder && cd /LicenseFinder && bundle install -j4 && rake install"
99
+ COPY . /LicenseFinder
100
+ RUN bash -lc "cd /LicenseFinder && bundle install -j4 && rake install"
78
101
 
79
102
  WORKDIR /
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source "https://rubygems.org"
2
-
1
+ source 'https://rubygems.org'
3
2
  gemspec
3
+ gem 'toml', '0.1.2'
data/README.md CHANGED
@@ -37,12 +37,17 @@ report.
37
37
  | Go workspace (via a `.envrc` file) | Go lang | 1.8.3 |
38
38
  | Go submodules | Go lang | 1.8.3 |
39
39
  | Java | maven | 3.5.0 |
40
- | Java | gradle | 2.9 |
40
+ | Java | gradle | 4.2 |
41
41
 
42
42
  ### Experimental project types
43
43
 
44
44
  * Erlang (via `rebar`)
45
+ * Objective-C, Swift (via Carthage or CocoaPods \[0.39 and below. See [CocoaPods Specs Repo Sharding](http://blog.cocoapods.org/Sharding/)\])
45
46
  * Objective-C (+ CocoaPods 0.39 and below. See [CocoaPods Specs Repo Sharding](http://blog.cocoapods.org/Sharding/))
47
+ * Elixir (via `mix`)
48
+ * Golang (via `gvt`, `glide`,`dep`, and `govendor`)
49
+ * JavaScript (via `yarn`)
50
+ * C++/C (via `conan`)
46
51
 
47
52
  ## Installation
48
53
 
@@ -151,8 +156,16 @@ languages, as long as that language has a package definition in the project dire
151
156
  * `settings.gradle` that specifies `rootProject.buildFileName` (for `gradle`)
152
157
  * `bower.json` (for `bower`)
153
158
  * `Podfile` (for CocoaPods)
159
+ * `Cartfile` (for Carthage)
154
160
  * `rebar.config` (for `rebar`)
161
+ * `mix.exs` (for `mix`)
155
162
  * `packages/` directory (for `Nuget`)
163
+ * `vendor/manifest` or `*/vendor/manifest` file (for `gvt`)
164
+ * `glide.lock` file (for `glide`)
165
+ * `vendor/vendor.json` file (for `govendor`)
166
+ * `Gopkg.lock` file (for `dep`)
167
+ * `yarn.lock` file (for `yarn`)
168
+ * `conanfile.txt` file (for `conan`)
156
169
 
157
170
 
158
171
  ### Continuous Integration
@@ -336,11 +349,14 @@ If you have a gradle project, you can invoke gradle with a custom script by
336
349
  passing (for example) `--gradle_command gradlew` to `license_finder` or
337
350
  `license_finder report`.
338
351
 
339
-
340
352
  Similarly you can invoke a custom rebar script with `--rebar_command rebar2`.
341
353
  If you store rebar dependencies in a custom directory (by setting `deps_dir` in
342
354
  `rebar.config`), set `--rebar_deps_dir`.
343
355
 
356
+ You can also invoke a custom Mix script `remix` with `--mix_command remix` and
357
+ set `--mix_deps_dir` to fetch Mix dependencies from a custom directory.
358
+
359
+
344
360
  ### Saving Configuration
345
361
 
346
362
  It may be difficult to remember to pass command line options to every command.
@@ -355,6 +371,8 @@ decisions_file: './some_path/decisions.yml'
355
371
  gradle_command: './gradlew'
356
372
  rebar_command: './rebarw'
357
373
  rebar_deps_dir: './rebar_deps'
374
+ mix_command: './mixw'
375
+ mix_deps_dir: './mix_deps'
358
376
  ```
359
377
 
360
378
  ### Gradle Projects
@@ -376,11 +394,15 @@ downloadLicenses {
376
394
  }
377
395
  ```
378
396
 
397
+ ### Conan rojects
379
398
 
380
- ### Maven Projects
381
-
382
- `license_finder` supports Maven.
399
+ `license_finder` supports Conan. You need to have the following lines in your conanfile.txt for `license_finder` to retrieve dependencies' licenses.
400
+ Ensure that `conan install` does not generate an error.
383
401
 
402
+ ```
403
+ [imports]
404
+ ., license* -> ./licenses @ folder=True, ignore_case=True
405
+ ```
384
406
 
385
407
  ## Requirements
386
408
 
data/Rakefile CHANGED
@@ -4,55 +4,50 @@ Bundler::GemHelper.install_tasks
4
4
  require './lib/license_finder/platform'
5
5
  require 'rspec/core/rake_task'
6
6
 
7
- desc "Run all specs in spec/"
7
+ desc 'Run all specs in spec/'
8
8
  task :spec do
9
9
  RSpec::Core::RakeTask.new(:spec) do |t|
10
10
  t.fail_on_error = true
11
- t.pattern = "./spec/**/*_spec.rb"
11
+ t.pattern = './spec/**/*_spec.rb'
12
12
  t.rspec_opts = %w[--color]
13
13
  end
14
14
  end
15
15
 
16
- desc "Only run cocoapods specs"
17
- RSpec::Core::RakeTask.new("spec:cocoapods") do |t|
16
+ desc 'Only run cocoapods specs'
17
+ RSpec::Core::RakeTask.new('spec:cocoapods') do |t|
18
18
  t.fail_on_error = true
19
- t.pattern = "./spec/lib/license_finder/package_managers/cocoa_pods_*spec.rb"
19
+ t.pattern = './spec/lib/license_finder/package_managers/cocoa_pods_*spec.rb'
20
20
  t.rspec_opts = %w[--color]
21
21
  end
22
22
 
23
- desc "Run all specs in features/"
23
+ desc 'Run all specs in features/'
24
24
  task :features do
25
25
  RSpec::Core::RakeTask.new(:features) do |t|
26
26
  t.fail_on_error = true
27
- t.pattern = "./features/**/*_spec.rb"
27
+ t.pattern = './features/**/*_spec.rb'
28
28
  opts = %w[--color --format d]
29
29
  opts += LicenseFinder::Platform.darwin? ? [] : %w[--tag ~ios]
30
30
  t.rspec_opts = opts
31
31
  end
32
32
  end
33
33
 
34
- desc "Check for non-Ruby development dependencies."
34
+ desc 'Check for non-Ruby development dependencies.'
35
35
  task :check_dependencies do
36
36
  require './lib/license_finder'
37
37
  satisfied = true
38
38
  LicenseFinder::PackageManager.package_managers.each do |package_manager|
39
- satisfied = false unless package_manager.installed?(LicenseFinder::Logger.new(debug:true))
39
+ satisfied = false unless package_manager.installed?(LicenseFinder::Logger.new(debug: true))
40
40
  end
41
41
  STDOUT.flush
42
42
  exit 1 unless satisfied
43
43
  end
44
44
 
45
- desc "Configure ci pipeline"
46
- task :update_pipeline, [:slack_url, :slack_channel, :github_access_token] do |_, args|
47
- access_token = args[:github_access_token]
45
+ desc 'Configure ci pipeline'
46
+ task :update_pipeline, [:slack_url, :slack_channel] do |_, args|
48
47
  slack_url = args[:slack_url]
49
48
  slack_channel = args[:slack_channel]
50
49
 
51
- unless access_token
52
- puts 'Warning: You should provide a Github access token with repo:status permission if you want to avoid rate limiting'
53
- end
54
-
55
- if !(slack_url || slack_channel)
50
+ unless slack_url || slack_channel
56
51
  puts 'Warning: skipping slack notifications setup'
57
52
  puts 'Warning: You should provide slack channel and url to receive slack notifications on build failures'
58
53
  end
@@ -60,7 +55,6 @@ task :update_pipeline, [:slack_url, :slack_channel, :github_access_token] do |_,
60
55
  params = []
61
56
  params << "slack_url=#{slack_url}" if slack_url
62
57
  params << "slack_channel=#{slack_channel}" if slack_channel
63
- params << "github_access_token=#{access_token}" if access_token
64
58
 
65
59
  vars = params.join(' ')
66
60
  cmd = "bash -c \"fly -t osl set-pipeline -n -p LicenseFinder --config <(erb #{vars} ci/pipelines/pipeline.yml.erb)\""
@@ -68,7 +62,7 @@ task :update_pipeline, [:slack_url, :slack_channel, :github_access_token] do |_,
68
62
  system(cmd)
69
63
  end
70
64
 
71
- task :spec => :check_dependencies
72
- task :features => :check_dependencies
65
+ task spec: :check_dependencies
66
+ task features: :check_dependencies
73
67
 
74
- task :default => [:spec, :features]
68
+ task default: %i[spec features]
@@ -1,4 +1,5 @@
1
1
  <% setup_slack = defined?(slack_url) && defined?(slack_channel) %>
2
+ <% ruby_versions = %w(2.4.1 2.3.0 2.2.0 2.1.5 jruby-9.0.4.0) %>
2
3
 
3
4
  resource_types:
4
5
  - name: pull-request
@@ -24,9 +25,8 @@ resources:
24
25
  source:
25
26
  repo: pivotal/LicenseFinder
26
27
  base: master
27
- <% if defined?(github_access_token) %>
28
- access_token: <%= github_access_token %>
29
- <% end %>
28
+ access_token: ((GithubApiTokenLicenseFinder))
29
+
30
30
  <% if setup_slack %>
31
31
  - name: slack-alert
32
32
  type: slack-notification
@@ -35,13 +35,14 @@ resources:
35
35
  <% end %>
36
36
 
37
37
  jobs:
38
- <% %w(2.4.1 2.3.0 2.2.0 2.1.5 jruby-9.0.4.0).each do |ruby_version| %>
38
+ <% ruby_versions.each do |ruby_version| %>
39
39
  - name: ruby-<%= ruby_version %>
40
40
  public: true
41
41
  plan:
42
42
  - get: LicenseFinder
43
43
  trigger: true
44
44
  - task: ruby-<%= ruby_version %>
45
+ privileged: true
45
46
  file: LicenseFinder/ci/tasks/build.yml
46
47
  params:
47
48
  RUBY_VERSION_UNDER_TEST: <%= ruby_version %>
@@ -55,14 +56,24 @@ jobs:
55
56
  <% end %>
56
57
  <% end %>
57
58
 
58
- <% %w(2.4.1 2.3.0 2.2.0 2.1.5 jruby-9.0.4.0).each do |ruby_version| %>
59
- - name: PR-ruby-<%= ruby_version %>
59
+ <% if setup_slack %>
60
+ on_failure:
61
+ put: slack-alert
62
+ params:
63
+ channel: '<%= slack_channel %>'
64
+ icon_emoji: ':crying_cat_face:'
65
+ text: '<%= "License Finder build failed. Build: https://osl.ci.cf-app.com/teams/main/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME" %>'
66
+ <% end %>
67
+
68
+ <% ruby_versions.each do |ruby_version| %>
69
+ - name: PR-ruby-<%= ruby_version %>-linux
60
70
  public: true
61
71
  plan:
62
72
  - get: pull-request
63
73
  trigger: true
64
74
  version: every
65
75
  - task: ruby-<%= ruby_version %>
76
+ privileged: true
66
77
  file: pull-request/ci/tasks/build.yml
67
78
  params:
68
79
  RUBY_VERSION_UNDER_TEST: <%= ruby_version %>
@@ -88,3 +99,26 @@ jobs:
88
99
  text: '<%= "License Finder build failed. Build: https://osl.ci.cf-app.com/teams/main/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME" %>'
89
100
  <% end %>
90
101
  <% end %>
102
+
103
+ - name: PR-rubocop
104
+ public: true
105
+ plan:
106
+ - get: pull-request
107
+ trigger: true
108
+ version: every
109
+ - task: run-rubocop
110
+ privileged: true
111
+ file: pull-request/ci/tasks/rubocop.yml
112
+ input_mapping: { LicenseFinder: pull-request }
113
+ on_success:
114
+ put: pull-request
115
+ params:
116
+ path: pull-request
117
+ status: success
118
+ context: run-rubocop
119
+ on_failure:
120
+ put: pull-request
121
+ params:
122
+ path: pull-request
123
+ status: failure
124
+ context: run-rubocop