Skip to content

Commit 3b1ce21

Browse files
committed
Replace unmantained Gradle license plugin
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
1 parent 27d400d commit 3b1ce21

File tree

6 files changed

+316
-246
lines changed

6 files changed

+316
-246
lines changed

build.gradle

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616

17+
import com.github.jk1.license.filter.LicenseBundleNormalizer
1718
import groovy.transform.CompileStatic
1819
import groovy.transform.Memoized
1920
import net.ltgt.gradle.errorprone.CheckSeverity
@@ -24,7 +25,7 @@ import java.util.regex.Pattern
2425
plugins {
2526
id 'com.diffplug.spotless' version '6.23.3'
2627
id 'com.github.ben-manes.versions' version '0.50.0'
27-
id 'com.github.hierynomus.license' version '0.16.1-fix'
28+
id 'com.github.jk1.dependency-license-report' version '2.5'
2829
id 'com.jfrog.artifactory' version '5.1.11'
2930
id 'io.spring.dependency-management' version '1.1.4'
3031
id 'me.champeau.jmh' version '0.7.2' apply false
@@ -87,13 +88,33 @@ def _strListCmdArg(name) {
8788
return _strListCmdArg(name, null)
8889
}
8990

91+
licenseReport {
92+
// This is for the allowed-licenses-file in checkLicense Task
93+
// Accepts File, URL or String path to local or remote file
94+
allowedLicensesFile = new File("$rootDir/gradle/allowed-licenses.json")
95+
96+
excludes = [
97+
// only used for static analysis, not actually shipped
98+
'com.google.errorprone:javac',
99+
'org.checkerframework:dataflow-shaded',
100+
'org.checkerframework:dataflow-errorprone',
101+
// exclude Kotlin multiplatform dependencies container, they have the same license of what they contain
102+
'com.squareup.okio:okio',
103+
'org.jetbrains.kotlinx:kotlinx-coroutines-core'
104+
]
105+
106+
// If set to true, then all boms will be excluded from the report
107+
excludeBoms = true
108+
109+
filters = [new LicenseBundleNormalizer(bundlePath: "$rootDir/gradle/license-normalizer-bundle.json")]
110+
}
111+
90112
allprojects {
91113
apply plugin: 'java-library'
92114
apply plugin: 'io.spring.dependency-management'
93115
apply plugin: 'jacoco'
94116
apply plugin: 'net.ltgt.errorprone'
95117
apply from: "${rootDir}/gradle/versions.gradle"
96-
apply from: "${rootDir}/gradle/check-licenses.gradle"
97118

98119
version = rootProject.version
99120

@@ -623,10 +644,10 @@ task autocomplete(type: JavaExec) {
623644
}
624645
}
625646

626-
installDist { dependsOn checkLicenses, untunedStartScripts, evmToolStartScripts }
647+
installDist { dependsOn checkLicense, untunedStartScripts, evmToolStartScripts }
627648

628649
distTar {
629-
dependsOn checkLicenses, autocomplete, untunedStartScripts, evmToolStartScripts
650+
dependsOn checkLicense, autocomplete, untunedStartScripts, evmToolStartScripts
630651
doFirst {
631652
delete fileTree(dir: 'build/distributions', include: '*.tar.gz')
632653
}
@@ -635,7 +656,7 @@ distTar {
635656
}
636657

637658
distZip {
638-
dependsOn checkLicenses, autocomplete, untunedStartScripts, evmToolStartScripts
659+
dependsOn checkLicense, autocomplete, untunedStartScripts, evmToolStartScripts
639660
doFirst {
640661
delete fileTree(dir: 'build/distributions', include: '*.zip')
641662
}

gradle/allowed-licenses.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"allowedLicenses": [
3+
{
4+
"moduleLicense": "Apache License, Version 2.0",
5+
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0"
6+
},
7+
{
8+
"moduleLicense": "BSD Zero Clause License",
9+
"moduleLicenseUrl": "https://opensource.org/licenses/0BSD"
10+
},
11+
{
12+
"moduleLicense" : "The 2-Clause BSD License",
13+
"moduleLicenseUrl" : "https://opensource.org/licenses/BSD-2-Clause"
14+
},
15+
{
16+
"moduleLicense": "The 3-Clause BSD License",
17+
"moduleLicenseUrl": "https://opensource.org/licenses/BSD-3-Clause"
18+
},
19+
{
20+
"moduleLicense": "Bouncy Castle Licence",
21+
"moduleLicenseUrl": "https://www.bouncycastle.org/licence.html"
22+
},
23+
{
24+
"moduleLicense": "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0",
25+
"moduleLicenseUrl": "https://oss.oracle.com/licenses/CDDL"
26+
},
27+
{
28+
"moduleLicense" : "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1",
29+
"moduleLicenseUrl" : "https://oss.oracle.com/licenses/CDDL-1.1"
30+
},
31+
{
32+
"moduleLicense": "Eclipse Distribution License - v 1.0",
33+
"moduleLicenseUrl": "http://www.eclipse.org/legal/epl-v10.html"
34+
},
35+
{
36+
"moduleLicense": "Eclipse Public License - v 2.0",
37+
"moduleLicenseUrl": "https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt"
38+
},
39+
{
40+
"moduleLicense": "MIT License",
41+
"moduleLicenseUrl": "https://opensource.org/licenses/MIT"
42+
},
43+
{
44+
"moduleLicense": "CC0-1.0",
45+
"moduleLicenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/legalcode"
46+
},
47+
{
48+
"moduleLicense": "Public-Domain"
49+
},
50+
{
51+
"moduleLicense": "Unicode/ICU License",
52+
"moduleLicenseUrl": "https://raw.githubusercontent.com/unicode-org/icu/main/icu4c/LICENSE"
53+
},
54+
{
55+
"moduleLicense": "Creative Commons Legal Code",
56+
"moduleVersion": "1.0.3",
57+
"moduleName": "org.reactivestreams:reactive-streams"
58+
},
59+
{
60+
"moduleLicense": "Eclipse Public License - v 1.0",
61+
"moduleVersion": "4.13.2",
62+
"moduleName": "junit:junit"
63+
}
64+
]
65+
}

gradle/check-licenses.gradle

Lines changed: 0 additions & 216 deletions
This file was deleted.

0 commit comments

Comments
 (0)