Skip to content

Commit

Permalink
apply license gradle plugin
Browse files Browse the repository at this point in the history
This PR applies the [Gradle License Plugin](https://github.com/hierynomus/license-gradle-plugin). The plugin contributes a gradle task `downloadLicenses` which generates a license report of every dependencies.

The plugin is applied to subprojects and the root project to get an aggregated report.

./gradlew downloadLicenses
open build/reports/license/license-dependency.html
  • Loading branch information
sdelamo committed Jul 4, 2024
1 parent 26245fe commit 434b370
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,59 @@ buildscript {
classpath "javax.xml.bind:jaxb-api:$jaxbApiVersion"
classpath "com.sun.xml.bind:jaxb-impl:$jaxbImplVersion"
classpath "org.codehaus.groovy.modules.http-builder:http-builder:0.7.2"
classpath("gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1")
}
}

import static groovyx.net.http.ContentType.*

apply plugin: 'idea'
apply plugin: 'com.github.hierynomus.license-report'

List<String> licenseExclusions = [
"org.grails.grails-bom",
"org.grails:grails-bootstrap",
"org.grails:grails-codecs",
"org.grails:grails-console",
"org.grails:grails-core",
"org.grails:grails-databinding",
"org.grails:grails-dependencies",
"org.grails:grails-docs",
"org.grails:grails-encoder",
"org.grails:grails-gradle-model",
"org.grails:grails-logging",
"org.grails:grails-plugin-codecs",
"org.grails:grails-plugin-controllers",
"org.grails:grails-plugin-databinding",
"org.grails:grails-plugin-datasource",
"org.grails:grails-plugin-domain-class",
"org.grails:grails-plugin-i18n",
"org.grails:grails-plugin-interceptors",
"org.grails:grails-plugin-mimetypes",
"org.grails:grails-plugin-rest",
"org.grails:grails-plugin-services",
"org.grails:grails-plugin-url-mappings",
"org.grails:grails-plugin-validation",
"org.grails:grails-spring",
"org.grails:grails-test",
"org.grails:grails-test-suite-base",
"org.grails:grails-test-suite-persistence",
"org.grails:grails-test-suite-uber",
"org.grails:grails-test-suite-web",
"org.grails:grails-web",
"org.grails:grails-web-boot",
"org.grails:grails-web-common",
"org.grails:grails-web-databinding",
"org.grails:grails-web-fileupload",
"org.grails:grails-web-mvc",
"org.grails:grails-web-url-mappings",
].collect { "${it}:${project.projectVersion}" as String}

downloadLicenses {
includeProjectDependencies = true
dependencyConfiguration = 'runtimeClasspath'
excludeDependencies = licenseExclusions
}

ext {
isJava8Compatible = org.gradle.api.JavaVersion.current().isJava8Compatible()
Expand Down Expand Up @@ -352,6 +399,12 @@ subprojects { project ->
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'project-report'
apply plugin: 'com.github.hierynomus.license-report'
downloadLicenses {
includeProjectDependencies = true
dependencyConfiguration = 'runtimeClasspath'
excludeDependencies = licenseExclusions
}

if (!isTestSuite) {

Expand Down

0 comments on commit 434b370

Please sign in to comment.