jaredsburrows / gradle-license-plugin

Gradle plugin that provides a task to generate a HTML license report of your project.
https://central.sonatype.com/artifact/com.jaredsburrows/gradle-license-plugin
Apache License 2.0
411 stars 65 forks source link

Empty report when licenseReport is a dependency of another task #488

Open oharaandrew314 opened 5 months ago

oharaandrew314 commented 5 months ago

If I configure licenseReport to be a dependency of build, processResources, or compileKotlin, then the generated reports are empty if I run any task that directly or implicitly depends on licenseReport. This does not happen if I run the licenseReport task individually.

Ultimately, I need the reports to be present before the shadowJar task and ideally before compileKotlin so I can unit test the reports. Any idea how this can be done?

tasks.withType<ProcessResources> {
    dependsOn("licenseReport")
    from ("build/reports/licenses") {
        into("public/oss")
    }
}

This is a jpackaged desktop application, so the typical android workflow isn't going to work. I already use this strategy to include the assets of an SPA from a neighboring module, which works perfectly.

Kuba15 commented 2 weeks ago

If it may help, I share a diff of the build log between running the task via a dependency (left) and directly (right) image