From 1e8ab4762c591fbf5cc079301276d0304cd3d4e1 Mon Sep 17 00:00:00 2001 From: "andrey.shulika" Date: Fri, 11 Aug 2023 00:23:21 +0300 Subject: [PATCH] TH2-1836 --- build.gradle | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f5aa186..403f5dd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,6 @@ +import com.github.jk1.license.filter.LicenseBundleNormalizer +import com.github.jk1.license.render.JsonReportRenderer + plugins { id "org.jetbrains.kotlin.jvm" version "${kotlin_version}" id "org.jetbrains.kotlin.kapt" version "${kotlin_version}" @@ -11,6 +14,8 @@ plugins { id 'signing' id 'distribution' id "org.owasp.dependencycheck" version "${owaspVersion}" + id 'com.github.jk1.dependency-license-report' version '2.5' + id "de.undercouch.download" version "5.4.0" } ext { @@ -252,4 +257,25 @@ configurations { compileClasspath { resolutionStrategy.activateDependencyLocking() } -} \ No newline at end of file +} + +licenseReport { + def licenseNormalizerBundlePath = "$buildDir/license-normalizer-bundle.json" + + if (!file(licenseNormalizerBundlePath).exists()) { + download.run { + src 'https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/license-normalizer-bundle.json' + dest "$buildDir/license-normalizer-bundle.json" + overwrite false + } + } + + filters = [ + new LicenseBundleNormalizer(licenseNormalizerBundlePath, false) + ] + renderers = [ + new JsonReportRenderer('licenses.json', false), + ] + excludeOwnGroup = false + allowedLicensesFile = new URL("https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/allowed-licenses.json") +}