-
-
Notifications
You must be signed in to change notification settings - Fork 952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apply license gradle plugin #13535
apply license gradle plugin #13535
Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
… v3.25.10 (#13501) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent bloating the root build file, could we extract this to a new file, for example: gradle/dependency-licenses.gradle
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, now just one more thing I saw (I'm a bit allergic to complex build files):
As we already have an allprojects
block in build.gradle
, we can apply the gradle/dependency-licenses.gradle
file there, so we don't have to do it in multiple places:
allprojects {
apply from: rootProject.layout.projectDirectory.file('gradle/dependency-licenses.gradle')
...
}
gradle/dependency-licenses.gradle
Outdated
"org.grails:grails-web-boot", | ||
"org.grails:grails-web-common", | ||
"org.grails:grails-web-databinding", | ||
"org.grails:grails-web-fileupload", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and org.grails:grails-web-fileupload
is removed in 7.0.x.
If all we want is to exclude all the subprojects, could we do this instead to not have to maintain the list:
// We don't want to include any of the libraries from this repo in the license report
List<String> licenseExclusions = rootProject.subprojects.collect {
"org.grails:${it.name}:${rootProject.projectVersion}" as String
}
and we probably want to be able to verify the list:
tasks.register('printLicenseExclusions') {
group = 'license'
description = 'Prints the license exclusions list'
doLast {
println """
|============================================================
|The following projects are excluded from the license report:
|============================================================
|${licenseExclusions.join('\n')}
""".stripMargin()
}
}
@sdelamo Sorry, for the delay in reviewing, I had not fully understood the process so my comments were left in pending state. |
This PR applies the Gradle License 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.