Skip to content
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

Merged
merged 15 commits into from
Aug 20, 2024
Merged

apply license gradle plugin #13535

merged 15 commits into from
Aug 20, 2024

Conversation

sdelamo
Copy link
Contributor

@sdelamo sdelamo commented Jul 4, 2024

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.

./gradlew downloadLicenses
open build/reports/license/license-dependency.html

puneetbehl and others added 5 commits April 30, 2024 16:59
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
@sdelamo sdelamo requested a review from davydotcom July 4, 2024 06:24
@CLAassistant
Copy link

CLAassistant commented Jul 4, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@matrei matrei left a 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?

@sdelamo
Copy link
Contributor Author

sdelamo commented Jul 17, 2024

To prevent bloating the root build file, could we extract this to a new file, for example: gradle/dependency-licenses.gradle?

@matrei I did that in 9e7b153

@sdelamo sdelamo requested a review from matrei July 17, 2024 07:02
@sdelamo sdelamo changed the base branch from 6.2.x to 7.0.x July 19, 2024 06:06
Copy link
Contributor

@matrei matrei left a 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 Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
@sdelamo sdelamo requested a review from matrei July 19, 2024 07:11
"org.grails:grails-web-boot",
"org.grails:grails-web-common",
"org.grails:grails-web-databinding",
"org.grails:grails-web-fileupload",
Copy link
Contributor

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()
    }
}

@matrei
Copy link
Contributor

matrei commented Jul 25, 2024

@sdelamo Sorry, for the delay in reviewing, I had not fully understood the process so my comments were left in pending state.

@sdelamo sdelamo requested a review from matrei August 16, 2024 07:51
@matrei matrei merged commit 2e03f58 into 7.0.x Aug 20, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants