Skip to content

Commit

Permalink
added license plugin for subprojects
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Smelov committed Sep 15, 2023
1 parent c8442b8 commit cc7d8c8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ licenseReport {

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")
}
20 changes: 20 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.JsonReportRenderer

plugins {
id "org.jetbrains.kotlin.jvm"
id "com.github.jk1.dependency-license-report" version "2.5"
id "de.undercouch.download" version "5.5.0"
}

apply from: '../common.gradle'
Expand Down Expand Up @@ -92,4 +96,20 @@ jar {
'Implementation-Version': project.version
)
}
}

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)]
allowedLicensesFile = new URL("https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/allowed-licenses.json")
}
21 changes: 21 additions & 0 deletions grpc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.JsonReportRenderer

plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'signing'
id "com.google.protobuf" version "0.9.3"
id "com.github.jk1.dependency-license-report" version "2.5"
id "de.undercouch.download" version "5.5.0"
}

apply from: '../common.gradle'
Expand Down Expand Up @@ -83,4 +88,20 @@ processResources.dependsOn.add('generateProto')
java {
withJavadocJar()
withSourcesJar()
}

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)]
allowedLicensesFile = new URL("https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/allowed-licenses.json")
}

0 comments on commit cc7d8c8

Please sign in to comment.