diff --git a/.dependency_decisions.yml b/.dependency_decisions.yml new file mode 100644 index 00000000..5f0a66fb --- /dev/null +++ b/.dependency_decisions.yml @@ -0,0 +1,68 @@ +--- +- - :whitelist + - MIT + - :who: 3scale Engineering + :why: + :versions: [] + :when: 2016-08-16 09:25:15.635515271 Z +- - :whitelist + - Apache 2.0 + - :who: 3scale Engineering + :why: + :versions: [] + :when: 2016-08-16 09:26:31.814319646 Z +- - :whitelist + - MIT-LICENSE + - :who: 3scale Engineering + :why: It's the same as MIT + :versions: [] + :when: 2016-08-16 09:27:49.047135842 Z +- - :license + - rake + - MIT + - :who: 3scale Engineering + :why: Rake uses MIT but it's not automatically detected + :versions: [] + :when: 2016-08-18 15:16:38.712225384 Z +- - :whitelist + - BSD + - :who: Jeff Kaufmann and Richard Fontana (Red Hat Legal) + :why: + :versions: [] + :when: 2016-11-23 11:02:51.564502000 Z +- - :whitelist + - New BSD + - :who: Jeff Kaufmann and Richard Fontana (Red Hat Legal) + :why: + :versions: [] + :when: 2016-11-23 11:03:04.247155000 Z +- - :whitelist + - ruby + - :who: Jeff Kaufmann and Richard Fontana (Red Hat Legal) + :why: + :versions: [] + :when: 2016-11-23 11:03:15.526798000 Z +- - :whitelist + - Simplified BSD + - :who: Jeff Kaufmann and Richard Fontana (Red Hat Legal) + :why: + :versions: [] + :when: 2016-11-23 11:03:33.341497000 Z +- - :whitelist + - LGPLv2+ + - :who: Jeff Kaufmann and Richard Fontana (Red Hat Legal) + :why: + :versions: [] + :when: 2016-11-23 11:04:13.584885000 Z +- - :whitelist + - 2-clause BSDL + - :who: Jeff Kaufmann and Richard Fontana (Red Hat Legal) + :why: + :versions: [] + :when: 2016-11-23 11:04:37.776089000 Z +- - :approve + - colored + - :who: + :why: MIT License https://github.com/defunkt/colored/blob/master/LICENSE + :versions: [] + :when: 2018-12-06 16:05:25.674247558 Z diff --git a/.travis.yml b/.travis.yml index 2035c612..da7d1557 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,11 @@ cache: bundler before_install: - gem install bundler -v 1.15.1 rvm: -- 2.5.1 -- 2.4.1 -- 2.3.1 +- 2.5.3 +- 2.4.5 +- 2.3.8 script: + - bundle exec rake license_finder:check - bundle exec rake spec:all - bundle exec 3scale help - bundle exec 3scale help copy diff --git a/Gemfile b/Gemfile index d0a52c6e..dbd5773b 100644 --- a/Gemfile +++ b/Gemfile @@ -4,5 +4,6 @@ source 'https://rubygems.org' gemspec group :development do + gem 'license_finder', '~> 5.5' gem 'pry' end diff --git a/Rakefile b/Rakefile index 283254bc..7296d429 100644 --- a/Rakefile +++ b/Rakefile @@ -17,4 +17,22 @@ rescue LoadError warn 'RSpec is not installed!' end +namespace :license_finder do + DECISION_FILE = "#{File.dirname(__FILE__)}/.dependency_decisions.yml".freeze + + desc 'Check license compliance of dependencies' + task :check do + STDOUT.puts "Checking license compliance\n" + unless system("license_finder --decisions-file=#{DECISION_FILE}") + STDERR.puts "\n*** License compliance test failed ***\n" + exit 1 + end + end + + desc 'Generate an CSV report for licenses' + task :report do + system("license_finder report --decisions-file=#{DECISION_FILE} --format=csv") + end +end + task default: 'spec:all'