diff options
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | Gemfile.lock | 2 | ||||
| -rw-r--r-- | config/.bashrc | 1 | ||||
| -rw-r--r-- | license-management.gemspec | 1 | ||||
| -rw-r--r-- | normalized-licenses.yml | 16 | ||||
| -rw-r--r-- | spec/fixtures/java/pom-public-gitlab-repository.xml | 5 | ||||
| -rw-r--r-- | spec/integration/java/maven_spec.rb | 6 | ||||
| -rw-r--r-- | spec/unit/license/management/repository_spec.rb | 17 |
8 files changed, 49 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ac2e94b..c019ad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # GitLab License management changelog +## v3.12.1 + +- Detect variations of the "Eclipse Public License" (!174) + ## v3.12.0 - Update default name of the generated report. (!167) diff --git a/Gemfile.lock b/Gemfile.lock index f9508ff..0f17bcb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,6 +10,7 @@ GEM addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) ast (2.4.0) + byebug (11.1.3) diff-lcs (1.3) docile (1.3.2) gitlab-styles (3.1.0) @@ -85,6 +86,7 @@ PLATFORMS ruby DEPENDENCIES + byebug (~> 11.1) gitlab-styles (~> 3.1) json-schema (~> 2.8) license-management! diff --git a/config/.bashrc b/config/.bashrc index 5ab592a..a3cde0d 100644 --- a/config/.bashrc +++ b/config/.bashrc @@ -1,6 +1,7 @@ #!/bin/bash alias nuget='mono /usr/local/bin/nuget.exe' +set -o vi function inflate() { local file=$1 diff --git a/license-management.gemspec b/license-management.gemspec index 58ec211..252047f 100644 --- a/license-management.gemspec +++ b/license-management.gemspec @@ -28,6 +28,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.add_dependency 'license_finder', '~> 6.0.0' + spec.add_development_dependency 'byebug', '~> 11.1' spec.add_development_dependency 'gitlab-styles', '~> 3.1' spec.add_development_dependency 'json-schema', '~> 2.8' spec.add_development_dependency 'rspec', '~> 3.9' diff --git a/normalized-licenses.yml b/normalized-licenses.yml index 28bc1c4..a2e4487 100644 --- a/normalized-licenses.yml +++ b/normalized-licenses.yml @@ -5,6 +5,8 @@ ids: Apache 2.0: Apache-2.0 Apache2: Apache-2.0 Apache License v2.0: Apache-2.0 + Apache Software License - Version 2.0: Apache-2.0 + ASF 2.0: Apache-2.0 ASL, version 2: Apache-2.0 BSD 3-Clause: BSD-3-Clause BSD (3 clause): BSD-3-Clause @@ -15,12 +17,23 @@ ids: CC0 1.0 Universal: CC0-1.0 CC01: CC0-1.0 CDDL1: CDDL-1.0 + COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0: CDDL-1.0 + Common Development and Distribution License 1.1: CDDL-1.1 Common Public License Version 1.0: CPL-1.0 Eclipse Distribution License (EDL), Version 1.0: BSD-3-Clause # https://wiki.spdx.org/view/Legal_Team/License_List/Licenses_Under_Consideration Eclipse Public License (EPL), Version 1.0: EPL-1.0 Eclipse Public License - Version 1.0: EPL-1.0 + Eclipse Public License - v 1.0: EPL-1.0 + Eclipse Public License 1.0: EPL-1.0 + Eclipse Public License v1.0: EPL-1.0 EPL1: EPL-1.0 Gnu General Public License, Version 3: GPL-3.0 + GNU General Public License v2.0 only, with Classpath exception: GPL-2.0-only + GNU General Public License, version 2: GPL-2.0-only + GNU Lesser General Public License v2.1 or later: LGPL-2.1-or-later + GNU Library General Public License v2.1 or later: LGPL-2.1+ + GPL-2.0: GPL-2.0-only + GPL2 w/ CPE: GPL-2.0-only GPLv2: GPL-2.0 GPLv3: GPL-3.0 http://www.apache.org/licenses/LICENSE-2.0: Apache-2.0 @@ -30,6 +43,7 @@ ids: ISC license: ISC ISC License (ISCL): ISC LGPL 2.1: LGPL-2.1 + LGPL-2.1: LGPL-2.1 LGPL2_1: LGPL-2.1 LGPL: LGPL-3.0-only LGPL, version 2.1: LGPL-2.1 @@ -43,6 +57,8 @@ ids: New BSD: BSD-3-Clause NewBSD: BSD-3-Clause New BSD License: BSD-3-Clause + BSD 3-Clause License: BSD-3-Clause + The BSD 3-Clause License: BSD-3-Clause Python: Python-2.0 Python Software Foundation License: Python-2.0 Ruby: Ruby diff --git a/spec/fixtures/java/pom-public-gitlab-repository.xml b/spec/fixtures/java/pom-public-gitlab-repository.xml index c39e703..11abf7f 100644 --- a/spec/fixtures/java/pom-public-gitlab-repository.xml +++ b/spec/fixtures/java/pom-public-gitlab-repository.xml @@ -12,5 +12,10 @@ <artifactId>example</artifactId> <version>1.0</version> </dependency> + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.3.0</version> + </dependency> </dependencies> </project> diff --git a/spec/integration/java/maven_spec.rb b/spec/integration/java/maven_spec.rb index 9230a9f..3da50dd 100644 --- a/spec/integration/java/maven_spec.rb +++ b/spec/integration/java/maven_spec.rb @@ -13,8 +13,9 @@ RSpec.describe "maven" do }) expect(report).to match_schema - expect(report.dependency_names).to match_array(['example']) + expect(report.dependency_names).to match_array(['example', 'jaxb-api']) expect(report.licenses_for('example')).to match_array(['MIT']) + expect(report.licenses_for('jaxb-api')).to match_array(['GPL-2.0-only', 'cddl 1.1']) end it 'downloads packages from by using a custom `settings.xml`' do @@ -27,7 +28,8 @@ RSpec.describe "maven" do }) expect(report).to match_schema - expect(report[:dependencies]).to match_array([{ name: 'example', url: '', description: '', paths: ['.'], licenses: ['MIT'] }]) + expect(report[:dependencies]).to match_array([{ name: 'example', url: '', description: '', paths: ['.'], licenses: ['MIT'] }, + { description: '', licenses: ['GPL-2.0-only', 'cddl 1.1'], name: 'jaxb-api', paths: ['.'], url: '' }]) end end diff --git a/spec/unit/license/management/repository_spec.rb b/spec/unit/license/management/repository_spec.rb index 6006e8a..6925c2c 100644 --- a/spec/unit/license/management/repository_spec.rb +++ b/spec/unit/license/management/repository_spec.rb @@ -32,7 +32,22 @@ RSpec.describe License::Management::Repository do end [ - ['Apache License v2.0', 'Apache-2.0'] + ['Apache License v2.0', 'Apache-2.0'], + ['COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0', 'CDDL-1.0'], + ['Common Development and Distribution License 1.1', 'CDDL-1.1'], + ['Apache Software License - Version 2.0', 'Apache-2.0'], + ['ASF 2.0', 'Apache-2.0'], + ['Eclipse Public License - v 1.0', 'EPL-1.0'], + ['Eclipse Public License 1.0', 'EPL-1.0'], + ['Eclipse Public License v1.0', 'EPL-1.0'], + ['GNU General Public License v2.0 only, with Classpath exception', 'GPL-2.0-only'], + ['GNU General Public License, version 2', 'GPL-2.0-only'], + ['GNU Lesser General Public License v2.1 or later', 'LGPL-2.1-or-later'], + ['GNU Library General Public License v2.1 or later', 'LGPL-2.1+'], + ['GPL-2.0', 'GPL-2.0-only'], + ['GPL2 w/ CPE', 'GPL-2.0-only'], + ['BSD 3-Clause License', 'BSD-3-Clause'], + ['The BSD 3-Clause License', 'BSD-3-Clause'] ].each do |short_name, spdx_id| context "when mapping a `#{short_name}` license" do let(:license) { LicenseFinder::License.new(short_name: short_name, matcher: LicenseFinder::License::NoneMatcher.new, url: nil) } |
