Skip to content

Commit

Permalink
apply license gradle plugin (#13535)
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 named `downloadLicenses` which generates a license report of every dependency.

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

./gradlew downloadLicenses
open build/reports/license/license-dependency.html
  • Loading branch information
sdelamo authored Aug 20, 2024
1 parent d448954 commit 2e03f58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ 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")
}
}

Expand Down Expand Up @@ -295,6 +296,7 @@ allprojects {
}
}
}
apply from: rootProject.layout.projectDirectory.file('gradle/dependency-licenses.gradle')
}

apply from: "gradle/idea.gradle"
Expand Down
11 changes: 11 additions & 0 deletions gradle/dependency-licenses.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apply plugin: 'com.github.hierynomus.license-report'

List<String> licenseExclusions = rootProject.subprojects.collect {
"org.grails:${it.name}:${rootProject.projectVersion}" as String
}

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

0 comments on commit 2e03f58

Please sign in to comment.