license_finder 2.1.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +29 -0
  4. data/CONTRIBUTING.md +28 -3
  5. data/Dockerfile +82 -0
  6. data/README.md +11 -2
  7. data/Rakefile +27 -0
  8. data/appveyor.yml +21 -0
  9. data/bin/license_finder_pip.py +1 -1
  10. data/ci/pipelines/pipeline.yml.erb +78 -0
  11. data/ci/scripts/test.sh +27 -0
  12. data/ci/tasks/build.yml +16 -0
  13. data/features/features/package_managers/gradle_spec.rb +6 -0
  14. data/features/features/package_managers/maven_spec.rb +9 -0
  15. data/features/features/report/diff_spec.rb +26 -23
  16. data/features/fixtures/alternate-build-file-gradle/build-alt.gradle +26 -0
  17. data/features/fixtures/alternate-build-file-gradle/settings.gradle +1 -0
  18. data/features/fixtures/file-based-libs-gradle/build.gradle +1 -1
  19. data/features/fixtures/gradle-wrapper/build.gradle +26 -0
  20. data/features/fixtures/gradle-wrapper/gradlew +3 -0
  21. data/features/fixtures/gradle-wrapper/gradlew.bat +1 -0
  22. data/features/fixtures/maven-wrapper/mvnw +3 -0
  23. data/features/fixtures/maven-wrapper/mvnw.cmd +7 -0
  24. data/features/fixtures/maven-wrapper/pom.xml +37 -0
  25. data/features/support/testing_dsl.rb +12 -5
  26. data/lib/license_finder/cli/base.rb +1 -0
  27. data/lib/license_finder/cli/main.rb +2 -1
  28. data/lib/license_finder/configuration.rb +6 -13
  29. data/lib/license_finder/core.rb +2 -1
  30. data/lib/license_finder/diff.rb +4 -4
  31. data/lib/license_finder/package.rb +5 -3
  32. data/lib/license_finder/package_delta.rb +2 -5
  33. data/lib/license_finder/package_managers/bower.rb +1 -1
  34. data/lib/license_finder/package_managers/bundler.rb +4 -4
  35. data/lib/license_finder/package_managers/go_dep.rb +21 -4
  36. data/lib/license_finder/package_managers/go_package.rb +2 -1
  37. data/lib/license_finder/package_managers/go_vendor.rb +21 -7
  38. data/lib/license_finder/package_managers/go_workspace.rb +18 -11
  39. data/lib/license_finder/package_managers/gradle.rb +42 -15
  40. data/lib/license_finder/package_managers/maven.rb +31 -17
  41. data/lib/license_finder/package_managers/maven_dependency_finder.rb +13 -0
  42. data/lib/license_finder/package_managers/maven_package.rb +6 -1
  43. data/lib/license_finder/package_managers/npm.rb +4 -4
  44. data/lib/license_finder/package_managers/rebar.rb +1 -1
  45. data/lib/license_finder/reports/csv_report.rb +5 -1
  46. data/lib/license_finder/reports/diff_report.rb +3 -7
  47. data/lib/license_finder/reports/text_report.rb +6 -1
  48. data/lib/license_finder/version.rb +1 -1
  49. data/license_finder.gemspec +6 -0
  50. data/spec/lib/license_finder/configuration_spec.rb +0 -8
  51. data/spec/lib/license_finder/core_spec.rb +2 -1
  52. data/spec/lib/license_finder/diff_spec.rb +50 -27
  53. data/spec/lib/license_finder/package_managers/bower_spec.rb +1 -1
  54. data/spec/lib/license_finder/package_managers/bundler_spec.rb +1 -1
  55. data/spec/lib/license_finder/package_managers/go_dep_spec.rb +14 -1
  56. data/spec/lib/license_finder/package_managers/go_vendor_spec.rb +23 -2
  57. data/spec/lib/license_finder/package_managers/go_workspace_spec.rb +23 -7
  58. data/spec/lib/license_finder/package_managers/gradle_spec.rb +55 -2
  59. data/spec/lib/license_finder/package_managers/maven_package_spec.rb +16 -3
  60. data/spec/lib/license_finder/package_managers/maven_spec.rb +56 -4
  61. data/spec/lib/license_finder/package_managers/merged_package_spec.rb +8 -4
  62. data/spec/lib/license_finder/package_spec.rb +4 -1
  63. data/spec/lib/license_finder/reports/csv_report_spec.rb +8 -0
  64. data/spec/lib/license_finder/reports/diff_report_spec.rb +5 -5
  65. data/spec/lib/license_finder/reports/text_report_spec.rb +5 -0
  66. metadata +218 -9
  67. data/.travis.yml +0 -37
  68. data/.travis/install_bower.sh +0 -5
  69. data/.travis/install_godep.sh +0 -6
  70. data/.travis/install_gradle.sh +0 -12
  71. data/.travis/install_rebar.sh +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e877c82a3e1401eea4bab220ae192781e8349179
4
- data.tar.gz: ddd81a98f53d6f22010822560a0eb9b8b1c0e805
3
+ metadata.gz: 966af7ae1414671e4b0993c96df55ae99b57993f
4
+ data.tar.gz: '0319c59b0c751aae09e8822c30e6a27aa7a9d473'
5
5
  SHA512:
6
- metadata.gz: cdb32ad15e1b0b3a85fdfaa60f8b18842d0c88b178597ccc21339687916da1e369cf5fb3ae32bf97db57487a3b36ae6f1a3c46ad308a6ead80d7f509b31dd68c
7
- data.tar.gz: 0fd87c84593f98e17ecf0342adf8cddeff92966e055a2b51216095d9462b7cde35741ca1e0c5c7a58c858a1f8888d9e862d428592668dd9e20433511e2065597
6
+ metadata.gz: 7fa60bd67436b53b6de9ee386c6301bcc485a8076a5cea9c464a3f7e581ce23820246f0ca4a603875fcda88409632b7bb29973c4c4d8590b8a0bd1c100cf699b
7
+ data.tar.gz: 5317b4995bbfb33a9d5aaa9364e138eb9723d90aee8bd2cd102380fe078b91d32ee25c565ac4c356d572f9cfcec089c84a46c6a5b7da916c66a78e9b2c919602
data/.gitignore CHANGED
@@ -6,4 +6,5 @@
6
6
  Gemfile.lock
7
7
  pkg/*
8
8
  tmp/
9
+ features/fixtures/maven-wrapper/target
9
10
  *~
@@ -1,3 +1,32 @@
1
+ # 3.0.0 / 2016-03-02
2
+
3
+ Features:
4
+
5
+ * Changed dependencies to be unique based on name _and_ version (#241)
6
+ * Enable '--columns' option with text reports (#244, thanks @raimon49!)
7
+ * Flag maven-include-groups adds group to maven depenency information (#219, #258, thanks @dgodd!)
8
+ * Package managers determine their package management command (#250, Thanks @sschuberth!)
9
+ * Support --ignored_groups for maven
10
+ * Support `homepage` column for godeps dependencies, and dependencies from go workspaces using `.envrc`
11
+ * Support `license_links` column for csv option (#281, Thanks @lbalceda!)
12
+ * Added a Dockerfile for [licensefinder/license_finder](https://hub.docker.com/r/licensefinder/license_finder/)
13
+ * Switched from Travis to Concourse
14
+
15
+ Bugfixes:
16
+
17
+ * Gradle works in CI containers where TERM is not set (revert and fix of c15bdb7, which broke older versions of gradle)
18
+ * Check for the correct Ruby Bundler command: `bundle` (#233. Thanks, @raimon49!)
19
+ * Uses settings.gradle to determine the build file name (#248)
20
+ * Fix detecting the Gradle wrapper if not scanning the current directory (#238, Thanks @sschuberth!)
21
+ * Use maven wrapper if available on maven projects
22
+ * Check golang package lists against standard packages instead of excluding short package paths (#243)
23
+ * Update the project_sha method to return the sha of the dependency, not the parent project
24
+ * Change Maven wrapper to call mvn.cmd and fall back on mvn.bat (#263, Thanks @sschuberth!)
25
+ * Allow bower to run as root
26
+ * Fix packaging errors scanning pip based projects
27
+ * Add JSON lib attribute to handle deeply nested JSON (#269. Thanks, @antongurov!)
28
+ * Use the fully qualified name of the license-maven-plugin (#284)
29
+
1
30
  # 2.1.2 / 2016-06-10
2
31
 
3
32
  Bugfixes:
@@ -44,9 +44,18 @@ If you come up with something useful, consider posting it to the Google Group
44
44
 
45
45
 
46
46
  ## Development Dependencies
47
-
48
- To successfully run the test suite, you will need npm, maven, pip, gradle and
49
- bower installed. If you run `rake check_dependencies`, you'll see exactly what
47
+ To successfully run the test suite, you will need the following installed:
48
+ - NPM (requires Node)
49
+ - Bower (requires Node and NPM)
50
+ - Maven (requires Java)
51
+ - Gradle (requires Java)
52
+ - Pip (requires python)
53
+ - Rebar (requires erlang)
54
+ - GoDep, GoWorkspace, and GoVendor (requires golang)
55
+ - CocoaPods (requires ruby)
56
+ - Bundler (requires ruby)
57
+
58
+ If you run `rake check_dependencies`, you'll see exactly which package managers
50
59
  you're missing.
51
60
 
52
61
  ### Python
@@ -71,3 +80,19 @@ JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1' JRUBY_OPTS='-
71
80
  ### Gradle
72
81
 
73
82
  You'll need a gradle version >= 1.8.
83
+
84
+ ### CocoaPods
85
+ LicenseFinder supports CocoaPods 0.39 and below. If you are using a later version of CocoaPods, you will need to downgrade CocoaPods/Specs repository in order to use LicenseFinder. [This article](http://blog.cocoapods.org/Sharding/) describes the breaking change between CocoaPods 0.39 and 1.0. You will need to use an older, archived CocoaPods/Specs repo.
86
+
87
+ If you see the following error, try switching to the archived repo.
88
+
89
+ ```bash
90
+ [!] The `master` repo requires CocoaPods 1.0.0 - (currently using 0.34.0)
91
+ ```
92
+
93
+ Example of how to switch to the archived repo:
94
+
95
+ ```bash
96
+ mv ~/.cocoapods/repos/master ~/.cocoapods/repos/master.bak
97
+ git clone https://github.com/CocoaPods/Old-Specs.git ~/.cocoapods/repos/master
98
+ ```
@@ -0,0 +1,82 @@
1
+ FROM ubuntu:trusty
2
+ RUN apt-get update && apt-get install -y curl git-core
3
+
4
+ #install rvm
5
+ RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && \
6
+ curl -sSL https://get.rvm.io | bash -s stable --ruby
7
+ ENV PATH=/usr/local/rvm/bin:$PATH
8
+
9
+ # install build-essential wget unzip
10
+ RUN apt-get install -y build-essential wget unzip
11
+
12
+ # nodejs seems to be required for the one of the gems
13
+ RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
14
+ apt-get -y install nodejs
15
+
16
+ # install bower
17
+ RUN npm install -g bower && \
18
+ echo '{ "allow_root": true }' > /root/.bowerrc
19
+
20
+ # install bundler
21
+ RUN bash -lc "rvm install 2.3.3 && rvm use 2.3.3 && gem install bundler"
22
+
23
+ #install java 8
24
+ #http://askubuntu.com/questions/521145/how-to-install-oracle-java-on-ubuntu-14-04
25
+ RUN cd /tmp && \
26
+ wget --quiet --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u66-b17/jdk-8u66-linux-x64.tar.gz -O jdk-8.tgz && \
27
+ tar xf /tmp/jdk-8.tgz && \
28
+ mkdir -p /usr/lib/jvm && \
29
+ mv jdk1.8.0_66 /usr/lib/jvm/oracle_jdk8 && \
30
+ rm /tmp/jdk-8.tgz
31
+
32
+ ENV J2SDKDIR=/usr/lib/jvm/oracle_jdk8
33
+ ENV J2REDIR=/usr/lib/jvm/oracle_jdk8/jre
34
+ ENV PATH=$PATH:/usr/lib/jvm/oracle_jdk8/bin:/usr/lib/jvm/oracle_jdk8/db/bin:/usr/lib/jvm/oracle_jdk8/jre/bin
35
+ ENV JAVA_HOME=/usr/lib/jvm/oracle_jdk8
36
+ ENV DERBY_HOME=/usr/lib/jvm/oracle_jdk8/db
37
+
38
+ RUN java -version
39
+
40
+ # install python and rebar
41
+ RUN apt-get install -y python rebar
42
+
43
+ # install and update python-pip
44
+ RUN apt-get install -y python-pip && \
45
+ pip install --upgrade pip
46
+
47
+ # install maven
48
+ RUN curl -O http://www-us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz && \
49
+ tar -xf apache-maven-3.3.9-bin.tar.gz; rm -rf apache-maven-3.3.9-bin.tar.gz && \
50
+ mv apache-maven-3.3.9 /usr/local/lib/maven && \
51
+ ln -s /usr/local/lib/maven/bin/mvn /usr/local/bin/mvn
52
+
53
+ # install gradle
54
+ WORKDIR /tmp
55
+ RUN curl -L -o gradle.zip http://services.gradle.org/distributions/gradle-2.4-bin.zip && \
56
+ unzip -q gradle.zip && \
57
+ rm gradle.zip && \
58
+ mv gradle-2.4 /root/gradle
59
+ ENV PATH=/root/gradle/bin:$PATH
60
+
61
+ #install go
62
+ WORKDIR /go
63
+ RUN wget https://storage.googleapis.com/golang/go1.5.3.linux-amd64.tar.gz -O go.tar.gz && tar --strip-components=1 -xf go.tar.gz
64
+ ENV GOROOT /go
65
+ ENV PATH=$PATH:/go/bin
66
+
67
+ # godep is now required for license_finder to work for project that are still managed with GoDep
68
+ ENV GOROOT=/go
69
+ ENV GOPATH=/gopath
70
+ ENV PATH=$PATH:$GOPATH/bin
71
+ RUN mkdir /gopath && go get github.com/tools/godep
72
+
73
+ # Fix the locale
74
+ RUN locale-gen en_US.UTF-8
75
+ ENV LANG=en_US.UTF-8
76
+ ENV LANGUAGE=en_US:en
77
+ ENV LC_ALL=en_US.UTF-8
78
+
79
+ # install license_finder
80
+ RUN bash -lc "git clone https://github.com/pivotal/LicenseFinder /LicenseFinder && cd /LicenseFinder && bundle install -j4 && rake install"
81
+
82
+ WORKDIR /
data/README.md CHANGED
@@ -1,14 +1,22 @@
1
1
  # License Finder
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/pivotal/LicenseFinder.png)](http://travis-ci.org/pivotal/LicenseFinder)
4
3
  [![Code Climate](https://codeclimate.com/github/pivotal/LicenseFinder.png)](https://codeclimate.com/github/pivotal/LicenseFinder)
5
4
 
5
+ Build status
6
+ * Ruby 2.1.5 [![Ruby 2.1.5 build status](https://osl.ci.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.1.5/badge)](https://osl.ci.cf-app.com/teams/main/pipelines/LicenseFinder)
7
+ * Ruby 2.2.0 [![Ruby 2.2.0 build status](https://osl.ci.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.2.0/badge)](https://osl.ci.cf-app.com/teams/main/pipelines/LicenseFinder)
8
+ * Ruby 2.3.0 [![Ruby 2.3.0 build status](https://osl.ci.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.3.0/badge)](https://osl.ci.cf-app.com/teams/main/pipelines/LicenseFinder)
9
+ * Ruby 2.4.0 [![Ruby 2.4.0 build status](https://osl.ci.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.4.0/badge)](https://osl.ci.cf-app.com/teams/main/pipelines/LicenseFinder)
10
+ * JRuby 9.0.4.0 [![JRuby 9.0.4.0 build status](https://osl.ci.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-jruby-9.0.4.0/badge)](https://osl.ci.cf-app.com/teams/main/pipelines/LicenseFinder)
11
+
12
+
6
13
  LicenseFinder works with your package managers to find dependencies,
7
14
  detect the licenses of the packages in them, compare those licenses
8
15
  against a user-defined whitelist, and give you an actionable exception
9
16
  report.
10
17
 
11
18
  * code: https://github.com/pivotal/LicenseFinder
19
+ * ci: https://osl.ci.cf-app.com/teams/main/pipelines/LicenseFinder
12
20
  * support:
13
21
  * license-finder@googlegroups.com
14
22
  * https://groups.google.com/forum/#!forum/license-finder
@@ -30,7 +38,7 @@ report.
30
38
  ### Experimental project types
31
39
 
32
40
  * Erlang (via `rebar`)
33
- * Objective-C (+ CocoaPods)
41
+ * Objective-C (+ CocoaPods 0.39 and below. See [CocoaPods Specs Repo Sharding](http://blog.cocoapods.org/Sharding/))
34
42
 
35
43
  ## Installation
36
44
 
@@ -112,6 +120,7 @@ languages, as long as that language has a package definition in the project dire
112
120
  * `package.json` (for `npm`)
113
121
  * `pom.xml` (for `maven`)
114
122
  * `build.gradle` (for `gradle`)
123
+ * `settings.gradle` that specifies `rootProject.buildFileName` (for `gradle`)
115
124
  * `bower.json` (for `bower`)
116
125
  * `Podfile` (for CocoaPods)
117
126
  * `rebar.config` (for `rebar`)
data/Rakefile CHANGED
@@ -31,9 +31,36 @@ task :check_dependencies do
31
31
  LicenseFinder::PackageManager.package_managers.each do |package_manager|
32
32
  satisfied = false unless package_manager.installed?(LicenseFinder::Logger.new(debug:true))
33
33
  end
34
+ STDOUT.flush
34
35
  exit 1 unless satisfied
35
36
  end
36
37
 
38
+ desc "Configure ci pipeline"
39
+ task :update_pipeline, [:slack_url, :slack_channel, :github_access_token] do |_, args|
40
+ access_token = args[:github_access_token]
41
+ slack_url = args[:slack_url]
42
+ slack_channel = args[:slack_channel]
43
+
44
+ unless access_token
45
+ puts 'Warning: You should provide a Github access token with repo:status permission if you want to avoid rate limiting'
46
+ end
47
+
48
+ if !(slack_url || slack_channel)
49
+ puts 'Warning: skipping slack notifications setup'
50
+ puts 'Warning: You should provide slack channel and url to receive slack notifications on build failures'
51
+ end
52
+
53
+ params = []
54
+ params << "slack_url=#{slack_url}" if slack_url
55
+ params << "slack_channel=#{slack_channel}" if slack_channel
56
+ params << "github_access_token=#{access_token}" if access_token
57
+
58
+ vars = params.join(' ')
59
+ cmd = "bash -c \"fly -t osl set-pipeline -n -p LicenseFinder --config <(erb #{vars} ci/pipelines/pipeline.yml.erb)\""
60
+
61
+ system(cmd)
62
+ end
63
+
37
64
  task :spec => :check_dependencies
38
65
  task :features => :check_dependencies
39
66
 
@@ -0,0 +1,21 @@
1
+ environment:
2
+ HOME: $(HOMEDRIVE)$(HOMEPATH)
3
+ GOPATH: $(HOME)\go
4
+ PATH: $(PATH);$(GOPATH)\bin;$(HOME)\rebar;$(HOME)\gradle\bin
5
+
6
+ install:
7
+ - bundle install
8
+
9
+ build_script:
10
+ - rake build
11
+
12
+ # Prerequisites for running tests.
13
+ before_test:
14
+ - rake install
15
+ - bash --login -c "ci/install_godep.sh"
16
+ - bash --login -c "ci/install_bower.sh"
17
+ - bash --login -c "ci/install_rebar.sh"
18
+ - bash --login -c "ci/install_gradle.sh"
19
+
20
+ test_script:
21
+ - rake spec
@@ -6,7 +6,7 @@ from pip.download import PipSession
6
6
  from pip._vendor import pkg_resources
7
7
  from pip._vendor.six import print_
8
8
 
9
- requirements = [req.req for req
9
+ requirements = [pkg_resources.Requirement.parse(str(req.req)) for req
10
10
  in parse_requirements('requirements.txt', session=PipSession())]
11
11
 
12
12
  transform = lambda dist: {
@@ -0,0 +1,78 @@
1
+ <% setup_slack = defined?(slack_url) && defined?(slack_channel) %>
2
+
3
+ resource_types:
4
+ - name: pull-request
5
+ type: docker-image
6
+ source:
7
+ repository: jtarchie/pr
8
+ <% if setup_slack %>
9
+ - name: slack-notification
10
+ type: docker-image
11
+ source:
12
+ repository: cfcommunity/slack-notification-resource
13
+ tag: latest
14
+ <% end %>
15
+
16
+ resources:
17
+ - name: LicenseFinder
18
+ type: git
19
+ source:
20
+ uri: https://github.com/pivotal/LicenseFinder.git
21
+ branch: master
22
+ - name: pull-request
23
+ type: pull-request
24
+ source:
25
+ repo: pivotal/LicenseFinder
26
+ base: master
27
+ <% if defined?(github_access_token) %>
28
+ access_token: <%= github_access_token %>
29
+ <% end %>
30
+ <% if setup_slack %>
31
+ - name: slack-alert
32
+ type: slack-notification
33
+ source:
34
+ url: <%= slack_url %>
35
+ <% end %>
36
+
37
+ jobs:
38
+ <% ['2.4.0', '2.3.0', '2.2.0', '2.1.5', 'jruby-9.0.4.0'].each do |ruby_version| %>
39
+ - name: ruby-<%= ruby_version %>
40
+ public: true
41
+ plan:
42
+ - get: LicenseFinder
43
+ trigger: true
44
+ - task: ruby-<%= ruby_version %>
45
+ file: LicenseFinder/ci/tasks/build.yml
46
+ params:
47
+ RUBY_VERSION: <%= ruby_version %>
48
+ <% if setup_slack %>
49
+ on_failure:
50
+ put: slack-alert
51
+ params:
52
+ channel: '<%= slack_channel %>'
53
+ icon_emoji: ':crying_cat_face:'
54
+ 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" %>'
55
+ <% end %>
56
+ <% end %>
57
+
58
+ <% ['2.4.0', '2.3.0', '2.2.0', '2.1.5', 'jruby-9.0.4.0'].each do |ruby_version| %>
59
+ - name: PR-ruby-<%= ruby_version %>
60
+ public: true
61
+ plan:
62
+ - get: pull-request
63
+ trigger: true
64
+ version: every
65
+ - task: ruby-<%= ruby_version %>
66
+ file: pull-request/ci/tasks/build.yml
67
+ params:
68
+ RUBY_VERSION: <%= ruby_version %>
69
+ input_mapping: { LicenseFinder: pull-request }
70
+ <% if setup_slack %>
71
+ on_failure:
72
+ put: slack-alert
73
+ params:
74
+ channel: '<%= slack_channel %>'
75
+ icon_emoji: ':crying_cat_face:'
76
+ 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" %>'
77
+ <% end %>
78
+ <% end %>
@@ -0,0 +1,27 @@
1
+ #!/bin/bash --login
2
+
3
+ set -e -x
4
+
5
+ pushd LicenseFinder
6
+ rvm install $RUBY_VERSION
7
+ rvm use $RUBY_VERSION
8
+ ruby --version
9
+
10
+ export GOPATH=$HOME/go
11
+ export RUBYOPT='-E utf-8'
12
+
13
+ gem update --system
14
+ gem install bundler
15
+ bundle install
16
+
17
+ # jruby-9 specific: requires >= rack 2.x
18
+ if [ "$RUBY_VERSION" == "jruby-9.0.4.0" ]
19
+ then
20
+ bundle update rack
21
+ fi
22
+ #
23
+
24
+ bundle exec rake install
25
+ bundle exec rake spec
26
+ bundle exec rake features
27
+ popd
@@ -0,0 +1,16 @@
1
+ platform: linux
2
+
3
+ image_resource:
4
+ type: docker-image
5
+ source:
6
+ repository: licensefinder/license_finder
7
+ tag: latest
8
+
9
+ inputs:
10
+ - name: LicenseFinder
11
+
12
+ run:
13
+ path: ./LicenseFinder/ci/scripts/test.sh
14
+
15
+ params:
16
+ RUBY_VERSION:
@@ -25,4 +25,10 @@ describe 'Gradle Dependencies' do
25
25
  expect(java_developer).to be_seeing_line 'data.json-0.2.3.jar, unknown, unknown'
26
26
  expect(java_developer).to be_seeing_line 'guava, 18.0, "Apache 2.0"'
27
27
  end
28
+
29
+ specify 'are shown in reports for a project with an alternate build.gradle file' do
30
+ LicenseFinder::TestingDSL::AlternateBuildFileGradleProject.create
31
+ java_developer.run_license_finder('alternate-build-file-gradle')
32
+ expect(java_developer).to be_seeing_line 'junit, 4.11, "Common Public License Version 1.0"'
33
+ end
28
34
  end
@@ -11,4 +11,13 @@ describe "Maven Dependencies" do
11
11
  java_developer.run_license_finder
12
12
  expect(java_developer).to be_seeing_line 'junit, 4.11, "Common Public License Version 1.0"'
13
13
  end
14
+
15
+ context 'when using --maven_include_groups flag' do
16
+
17
+ it 'shows the groupid' do
18
+ LicenseFinder::TestingDSL::MavenProject.create
19
+ java_developer.run_license_finder nil, '--maven_include_groups'
20
+ expect(java_developer).to be_seeing_line 'junit:junit, 4.11, "Common Public License Version 1.0"'
21
+ end
22
+ end
14
23
  end
@@ -18,8 +18,8 @@ describe 'Diff report' do
18
18
 
19
19
  developer.execute_command('license_finder diff report-1.csv report-2.csv')
20
20
 
21
- expect(developer).to be_seeing('added,bar,2.0.0,,GPLv2')
22
- expect(developer).to be_seeing('unchanged,foo,1.0.0,1.0.0,MIT')
21
+ expect(developer).to be_seeing('added,bar,2.0.0,GPLv2')
22
+ expect(developer).to be_seeing('unchanged,foo,1.0.0,MIT')
23
23
  end
24
24
 
25
25
  specify 'shows version changes between two csv reports' do
@@ -31,7 +31,8 @@ describe 'Diff report' do
31
31
  developer.execute_command('license_finder report --save=report-2.csv --format=csv')
32
32
 
33
33
  developer.execute_command('license_finder diff report-1.csv report-2.csv')
34
- expect(developer).to be_seeing('unchanged,foo,2.0.0,1.0.0,MIT')
34
+ expect(developer).to be_seeing('added,foo,2.0.0,MIT')
35
+ expect(developer).to be_seeing('removed,foo,1.0.0,MIT')
35
36
  end
36
37
 
37
38
  specify 'shows license changes between two csv reports' do
@@ -43,8 +44,8 @@ describe 'Diff report' do
43
44
  developer.execute_command('license_finder report --save=report-2.csv --format=csv')
44
45
 
45
46
  developer.execute_command('license_finder diff report-1.csv report-2.csv')
46
- expect(developer).to be_seeing('removed,foo,,1.0.0,MIT')
47
- expect(developer).to be_seeing('added,foo,2.0.0,,GPLv2')
47
+ expect(developer).to be_seeing('removed,foo,1.0.0,MIT')
48
+ expect(developer).to be_seeing('added,foo,2.0.0,GPLv2')
48
49
  end
49
50
  end
50
51
 
@@ -69,9 +70,9 @@ describe 'Diff report' do
69
70
  developer.execute_command('license_finder diff report-1.csv report-2.csv --save=diff.csv --format=csv')
70
71
 
71
72
  diff = IO.read(project.project_dir.join('diff.csv'))
72
- expect(diff).to include("unchanged,foo,1.0.0,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
73
- expect(diff).to include("unchanged,bar,2.0.0,2.0.0,GPLv2,#{project1.project_dir}")
74
- expect(diff).to include("added,baz,3.0.0,,BSD,#{project2.project_dir}")
73
+ expect(diff).to include("unchanged,foo,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
74
+ expect(diff).to include("unchanged,bar,2.0.0,GPLv2,#{project1.project_dir}")
75
+ expect(diff).to include("added,baz,3.0.0,BSD,#{project2.project_dir}")
75
76
  end
76
77
 
77
78
  context 'when change affects only one file' do
@@ -96,9 +97,10 @@ describe 'Diff report' do
96
97
  developer.execute_command('license_finder diff report-1.csv report-2.csv --save=diff.csv --format=csv')
97
98
 
98
99
  diff = IO.read(project.project_dir.join('diff.csv'))
99
- expect(diff).to include("unchanged,foo,1.0.0,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
100
- expect(diff).to include("unchanged,bar,3.0.0,2.0.0,GPLv2,#{project1.project_dir}")
101
- expect(diff).to include("added,baz,3.0.0,,BSD,#{project2.project_dir}")
100
+ expect(diff).to include("unchanged,foo,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
101
+ expect(diff).to include("added,bar,3.0.0,GPLv2,#{project1.project_dir}")
102
+ expect(diff).to include("removed,bar,2.0.0,GPLv2,#{project1.project_dir}")
103
+ expect(diff).to include("added,baz,3.0.0,BSD,#{project2.project_dir}")
102
104
  end
103
105
 
104
106
  specify 'shows license changes' do
@@ -122,10 +124,10 @@ describe 'Diff report' do
122
124
  developer.execute_command('license_finder diff report-1.csv report-2.csv --save=diff.csv --format=csv')
123
125
 
124
126
  diff = IO.read(project.project_dir.join('diff.csv'))
125
- expect(diff).to include("unchanged,foo,1.0.0,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
126
- expect(diff).to include("removed,bar,,2.0.0,GPLv2,#{project1.project_dir}")
127
- expect(diff).to include("added,bar,3.0.0,,MIT,#{project1.project_dir}")
128
- expect(diff).to include("added,baz,3.0.0,,BSD,#{project2.project_dir}")
127
+ expect(diff).to include("unchanged,foo,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
128
+ expect(diff).to include("removed,bar,2.0.0,GPLv2,#{project1.project_dir}")
129
+ expect(diff).to include("added,bar,3.0.0,MIT,#{project1.project_dir}")
130
+ expect(diff).to include("added,baz,3.0.0,BSD,#{project2.project_dir}")
129
131
  end
130
132
  end
131
133
 
@@ -151,10 +153,10 @@ describe 'Diff report' do
151
153
  developer.execute_command('license_finder diff report-1.csv report-2.csv --save=diff.csv --format=csv')
152
154
 
153
155
  diff = IO.read(project.project_dir.join('diff.csv'))
154
- expect(diff).to include("unchanged,bar,2.0.0,2.0.0,GPLv2,#{project1.project_dir}")
155
- expect(diff).to include("removed,foo,,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
156
- expect(diff).to include("added,foo,2.0.0,,BSD,\"#{project1.project_dir},#{project2.project_dir}\"")
157
- expect(diff).to include("added,baz,3.0.0,,BSD,#{project2.project_dir}")
156
+ expect(diff).to include("unchanged,bar,2.0.0,GPLv2,#{project1.project_dir}")
157
+ expect(diff).to include("removed,foo,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
158
+ expect(diff).to include("added,foo,2.0.0,BSD,\"#{project1.project_dir},#{project2.project_dir}\"")
159
+ expect(diff).to include("added,baz,3.0.0,BSD,#{project2.project_dir}")
158
160
  end
159
161
 
160
162
  xspecify 'show licenses change when files do not contain exact copies of a dep' do
@@ -178,12 +180,13 @@ describe 'Diff report' do
178
180
  developer.execute_command('license_finder diff report-1.csv report-2.csv --save=diff.csv --format=csv')
179
181
 
180
182
  diff = IO.read(project.project_dir.join('diff.csv'))
181
- expect(diff).to include("removed,foo,,1.0.0,MIT,#{project1.project_dir}")
183
+ expect(diff).to include("removed,foo,1.0.0,MIT,#{project1.project_dir}")
182
184
  # expect(diff).to include("removed,foo,,2.0.0,BSD,#{project2.project_dir}")
183
- expect(diff).to include("unchanged,foo,2.0.0,1.0.0,BSD,\"#{project1.project_dir},#{project2.project_dir}\"")
185
+ expect(diff).to include("added,foo,2.0.0,BSD,\"#{project1.project_dir},#{project2.project_dir}\"")
186
+ expect(diff).to include("removed,foo,1.0.0,BSD,\"#{project1.project_dir},#{project2.project_dir}\"")
184
187
 
185
- expect(diff).to include("unchanged,bar,2.0.0,2.0.0,GPLv2,#{project1.project_dir}")
186
- expect(diff).to include("added,baz,3.0.0,,BSD,#{project2.project_dir}")
188
+ expect(diff).to include("unchanged,bar,2.0.0,GPLv2,#{project1.project_dir}")
189
+ expect(diff).to include("added,baz,3.0.0,BSD,#{project2.project_dir}")
187
190
  end
188
191
  end
189
192
  end