From 60885a5af05783f82be2fbe9e3b576ad9b0cbbd3 Mon Sep 17 00:00:00 2001 From: Oleg Cherednik Date: Tue, 30 Jan 2024 16:31:24 +0300 Subject: [PATCH] api --- build.gradle | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index e4c9253..be5db47 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,7 @@ +import com.github.jk1.license.filter.LicenseBundleNormalizer +import com.github.jk1.license.render.InventoryHtmlReportRenderer + + buildscript { repositories { mavenLocal() @@ -10,9 +14,11 @@ plugins { id 'checkstyle' id 'pmd' id 'java-library' - id 'org.cadixdev.licenser' version '0.6.1' id 'io.freefair.lombok' version '8.4' + id 'org.cadixdev.licenser' version '0.6.1' + id 'com.github.jk1.dependency-license-report' version '2.5' + id 'signing' id 'maven-publish' id 'io.github.gradle-nexus.publish-plugin' version '1.0.0' @@ -43,16 +49,16 @@ configurations { checkstyle { toolVersion = '10.10.0' configFile = "${projectDir}/misc/checkstyle/checkstyle.xml" as File - ignoreFailures = true + ignoreFailures = false maxWarnings = 0 maxErrors = 0 } pmd { toolVersion = '6.21.0' - consoleOutput = true + consoleOutput = false rulesMinimumPriority = 5 - ignoreFailures = true + ignoreFailures = false ruleSets = [ "${projectDir}/misc/pmd/bestpractices.xml", "${projectDir}/misc/pmd/codestyle.xml", @@ -120,9 +126,12 @@ jacocoTestReport { } } -check.dependsOn jacocoTestReport +check.finalizedBy(checkLicense) +check.finalizedBy(generateLicenseReport) +check.finalizedBy(jacocoTestReport) test { + dependsOn('jar') useTestNG() } @@ -131,6 +140,13 @@ license { include '**/*.java' } +licenseReport { + configurations = ['compileClasspath', 'runtimeClasspath', 'testCompileClasspath', 'testRuntimeClasspath'] + renderers = [new InventoryHtmlReportRenderer()] + allowedLicensesFile = new File("$projectDir/misc/license/allowed-licenses.json") + filters = [new LicenseBundleNormalizer(bundlePath: "$projectDir/misc/license/license-normalizer-bundle.json")] +} + signing { sign publishing.publications }