Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,15 @@ jobs:
run: |
# add any untracked folders that may have been added by generateLicenseReport
git add licenses
# there's always going to one line difference due to the timestamp included in the report
if [[ $(git diff --cached --shortstat licenses) == " 1 file changed, 1 insertion(+), 1 deletion(-)" ]]
if git diff --cached --quiet licenses
then
echo "Licenses are up-to-date."
else
echo "Licenses are not up-to-date, please run './gradlew generateLicenseReport' locally and commit."
echo
echo "$(git diff --cached --stat licenses)"
git diff --cached --stat licenses
echo
echo "$(git diff --cached licenses)"
git diff --cached licenses
exit 1
fi

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/pull-request-helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ jobs:
run: |
./gradlew generateLicenseReport
git add licenses
# there's always going to one line difference due to the timestamp included in the report
if [[ $(git diff --cached --shortstat licenses) == " 1 file changed, 1 insertion(+), 1 deletion(-)" ]]
then
git reset HEAD licenses
git checkout -- licenses
if git diff --cached --quiet; then
exit 0 # success
fi
git commit -m "./gradlew generateLicenseReport"
Expand Down
17 changes: 17 additions & 0 deletions agent/agent/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.InventoryMarkdownReportRenderer
import java.nio.charset.StandardCharsets

plugins {
id("com.github.jk1.dependency-license-report")
Expand Down Expand Up @@ -169,6 +170,22 @@ tasks {
named("generateLicenseReport").configure {
dependsOn(cleanLicenses)
finalizedBy(":spotlessApply")
doLast {
val reportFile = rootProject.file("licenses/more-licenses.md")
if (reportFile.exists()) {
val reportContents = reportFile.readText(StandardCharsets.UTF_8)
val normalizedReportContents =
reportContents.replace(
Regex(
"""(?m)(^## Dependency License Report\r?\n)_\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}[^\r\n]*_\r?\n"""
),
"$1",
)
if (normalizedReportContents != reportContents) {
reportFile.writeText(normalizedReportContents, StandardCharsets.UTF_8)
}
}
}
// disable licence report generation unless this task is explicitly run
// the files produced by this task are used by other tasks without declaring them as dependency
// which gradle considers an error
Expand Down
1 change: 0 additions & 1 deletion licenses/more-licenses.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

# agent
## Dependency License Report
_2026-07-29 22:55:05 UTC_
## Apache License, Version 2.0

**1** **Group:** `com.fasterxml.jackson.core` **Name:** `jackson-annotations` **Version:** `2.22`
Expand Down