Skip to content

Commit

Permalink
Replace unmantained Gradle license plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
  • Loading branch information
fab-10 committed Dec 14, 2023
1 parent 27d400d commit fdc450c
Show file tree
Hide file tree
Showing 6 changed files with 318 additions and 246 deletions.
33 changes: 28 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/


import com.github.jk1.license.filter.LicenseBundleNormalizer
import groovy.transform.CompileStatic
import groovy.transform.Memoized
import net.ltgt.gradle.errorprone.CheckSeverity
Expand All @@ -24,7 +25,7 @@ import java.util.regex.Pattern
plugins {
id 'com.diffplug.spotless' version '6.23.3'
id 'com.github.ben-manes.versions' version '0.50.0'
id 'com.github.hierynomus.license' version '0.16.1-fix'
id 'com.github.jk1.dependency-license-report' version '2.5'
id 'com.jfrog.artifactory' version '5.1.11'
id 'io.spring.dependency-management' version '1.1.4'
id 'me.champeau.jmh' version '0.7.2' apply false
Expand Down Expand Up @@ -87,13 +88,35 @@ def _strListCmdArg(name) {
return _strListCmdArg(name, null)
}

licenseReport {
// This is for the allowed-licenses-file in checkLicense Task
// Accepts File, URL or String path to local or remote file
allowedLicensesFile = new File("$rootDir/gradle/allowed-licenses.json")

excludes = [
// only used for static analysis, not actually shipped
'com.google.errorprone:javac',
'org.checkerframework:dataflow-shaded',
'org.checkerframework:dataflow-errorprone',
// exclude Kotlin multiplatform dependencies container, they have the same license of what they contain
'com.squareup.okio:okio',
'org.jetbrains.kotlinx:kotlinx-coroutines-core'
]

// If set to true, then all boms will be excluded from the report
excludeBoms = true

filters = [
new LicenseBundleNormalizer(bundlePath: "$rootDir/gradle/license-normalizer-bundle.json")
]
}

allprojects {
apply plugin: 'java-library'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'net.ltgt.errorprone'
apply from: "${rootDir}/gradle/versions.gradle"
apply from: "${rootDir}/gradle/check-licenses.gradle"

version = rootProject.version

Expand Down Expand Up @@ -623,10 +646,10 @@ task autocomplete(type: JavaExec) {
}
}

installDist { dependsOn checkLicenses, untunedStartScripts, evmToolStartScripts }
installDist { dependsOn checkLicense, untunedStartScripts, evmToolStartScripts }

distTar {
dependsOn checkLicenses, autocomplete, untunedStartScripts, evmToolStartScripts
dependsOn checkLicense, autocomplete, untunedStartScripts, evmToolStartScripts
doFirst {
delete fileTree(dir: 'build/distributions', include: '*.tar.gz')
}
Expand All @@ -635,7 +658,7 @@ distTar {
}

distZip {
dependsOn checkLicenses, autocomplete, untunedStartScripts, evmToolStartScripts
dependsOn checkLicense, autocomplete, untunedStartScripts, evmToolStartScripts
doFirst {
delete fileTree(dir: 'build/distributions', include: '*.zip')
}
Expand Down
65 changes: 65 additions & 0 deletions gradle/allowed-licenses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"allowedLicenses": [
{
"moduleLicense": "Apache License, Version 2.0",
"moduleLicenseUrl": "https://www.apache.org/licenses/LICENSE-2.0"
},
{
"moduleLicense": "BSD Zero Clause License",
"moduleLicenseUrl": "https://opensource.org/licenses/0BSD"
},
{
"moduleLicense" : "The 2-Clause BSD License",
"moduleLicenseUrl" : "https://opensource.org/licenses/BSD-2-Clause"
},
{
"moduleLicense": "The 3-Clause BSD License",
"moduleLicenseUrl": "https://opensource.org/licenses/BSD-3-Clause"
},
{
"moduleLicense": "Bouncy Castle Licence",
"moduleLicenseUrl": "https://www.bouncycastle.org/licence.html"
},
{
"moduleLicense": "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0",
"moduleLicenseUrl": "https://oss.oracle.com/licenses/CDDL"
},
{
"moduleLicense" : "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1",
"moduleLicenseUrl" : "https://oss.oracle.com/licenses/CDDL-1.1"
},
{
"moduleLicense": "Eclipse Distribution License - v 1.0",
"moduleLicenseUrl": "http://www.eclipse.org/legal/epl-v10.html"
},
{
"moduleLicense": "Eclipse Public License - v 2.0",
"moduleLicenseUrl": "https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt"
},
{
"moduleLicense": "MIT License",
"moduleLicenseUrl": "https://opensource.org/licenses/MIT"
},
{
"moduleLicense": "CC0-1.0",
"moduleLicenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/legalcode"
},
{
"moduleLicense": "Public-Domain"
},
{
"moduleLicense": "Unicode/ICU License",
"moduleLicenseUrl": "https://raw.githubusercontent.com/unicode-org/icu/main/icu4c/LICENSE"
},
{
"moduleLicense": "Creative Commons Legal Code",
"moduleVersion": "1.0.3",
"moduleName": "org.reactivestreams:reactive-streams"
},
{
"moduleLicense": "Eclipse Public License - v 1.0",
"moduleVersion": "4.13.2",
"moduleName": "junit:junit"
}
]
}
216 changes: 0 additions & 216 deletions gradle/check-licenses.gradle

This file was deleted.

Loading

0 comments on commit fdc450c

Please sign in to comment.