File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -162,8 +162,18 @@ tasks {
162162 delete(rootProject.file(" licenses" ))
163163 }
164164
165+ val generateLicenseReportEnabled =
166+ gradle.startParameter.taskNames.any { it.equals(" generateLicenseReport" ) }
165167 named(" generateLicenseReport" ).configure {
166168 dependsOn(cleanLicenses)
169+ finalizedBy(" :spotlessApply" )
170+ // disable licence report generation unless this task is explicitly run
171+ // the files produced by this task are used by other tasks without declaring them as dependency
172+ // which gradle considers an error
173+ enabled = enabled && generateLicenseReportEnabled
174+ }
175+ if (generateLicenseReportEnabled) {
176+ project.parent?.parent?.tasks?.getByName(" spotlessMisc" )?.dependsOn(named(" generateLicenseReport" ))
167177 }
168178}
169179
Original file line number Diff line number Diff line change 11
22# agent
33## Dependency License Report
4- _ 2025-07-21 03:47:53 UTC _
4+ _ 2025-07-21 13:02:04 PDT _
55## Apache License, Version 2.0
66
77** 1** ** Group:** ` com.fasterxml.jackson.core ` ** Name:** ` jackson-annotations ` ** Version:** ` 2.19.2 `
You can’t perform that action at this time.
0 commit comments