Skip to content

Commit

Permalink
Gradle: replace license check plugin and reorg includes for all projects
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 Aug 12, 2024
1 parent 13c2ddd commit a104580
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 212 deletions.
10 changes: 4 additions & 6 deletions acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ plugins {
id 'org.web3j.solidity' version '0.5.0'
}

apply from: rootProject.file("gradle/java.gradle")
apply from: rootProject.file("gradle/dependency-management.gradle")
apply from: rootProject.file('gradle/common-dependencies.gradle')
apply from: rootProject.file("gradle/tests.gradle")
apply from: rootProject.file("gradle/lint.gradle")

web3j {
generatedPackageName = 'linea.plugin.acc.test.tests.web3j.generated'
}
Expand Down Expand Up @@ -77,3 +71,7 @@ dependencies {
}

test.enabled = false

jar {
enabled = false
}
38 changes: 38 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.github.jk1.license.filter.LicenseBundleNormalizer

buildscript {
ext {
Expand All @@ -8,4 +9,41 @@ buildscript {
besuPluginDir = File.createTempDir("plugins")
}
}

plugins {
id 'com.github.jk1.dependency-license-report' version '2.8'
}

version = project.hasProperty('releaseVersion') ? project.getProperty('releaseVersion') : 'snapshot'

allprojects {
apply from: rootProject.file("gradle/dependency-management.gradle")
apply from: rootProject.file("gradle/java.gradle")
apply from: rootProject.file('gradle/common-dependencies.gradle')
apply from: rootProject.file("gradle/tests.gradle")
apply from: rootProject.file("gradle/lint.gradle")
apply from: rootProject.file("gradle/build-aliases.gradle")
}

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

excludes = []

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

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

build {
dependsOn checkLicense
}

jar {
enabled = false
}
74 changes: 74 additions & 0 deletions gradle/allowed-licenses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"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": "MIT-0",
"moduleVersion": "1.0.4",
"moduleName": "org.reactivestreams:reactive-streams"
},
{
"moduleLicense": "Eclipse Public License - v 1.0",
"moduleVersion": "4.13.2",
"moduleName": "junit:junit"
},
{
"moduleName": "org.jetbrains.kotlin:kotlin-stdlib-common",
"moduleVersion": "1.9.22"
}
]
}
4 changes: 2 additions & 2 deletions gradle/build-aliases.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
*/

// Default tasks and build aliases
defaultTasks 'build', 'checkLicenses', 'javadoc', 'jar'
defaultTasks 'build', 'checkLicense', 'javadoc', 'jar'

def buildAliases = ['dev': [
'spotlessApply',
'build',
'checkLicenses',
'checkLicense',
]]

def expandedTaskList = []
Expand Down
183 changes: 0 additions & 183 deletions gradle/check-licenses.gradle

This file was deleted.

Loading

0 comments on commit a104580

Please sign in to comment.