Skip to content

Commit f5b076b

Browse files
committed
sync
1 parent d0c170c commit f5b076b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

agent/agent/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
22
import com.github.jk1.license.filter.LicenseBundleNormalizer
33
import com.github.jk1.license.render.InventoryMarkdownReportRenderer
4+
import java.nio.file.Files
5+
import java.util.regex.Pattern
46

57
plugins {
68
id("com.github.jk1.dependency-license-report")
@@ -162,8 +164,18 @@ tasks {
162164
delete(rootProject.file("licenses"))
163165
}
164166

167+
val generateLicenseReportEnabled =
168+
gradle.startParameter.taskNames.any { it.equals("generateLicenseReport") }
165169
named("generateLicenseReport").configure {
166170
dependsOn(cleanLicenses)
171+
finalizedBy(":spotlessApply")
172+
// disable licence report generation unless this task is explicitly run
173+
// the files produced by this task are used by other tasks without declaring them as dependency
174+
// which gradle considers an error
175+
enabled = enabled && generateLicenseReportEnabled
176+
}
177+
if (generateLicenseReportEnabled) {
178+
project.parent?.parent?.tasks?.getByName("spotlessMisc")?.dependsOn(named("generateLicenseReport"))
167179
}
168180
}
169181

licenses/more-licenses.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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`

0 commit comments

Comments
 (0)