File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,16 +64,15 @@ jobs:
6464 run : |
6565 # add any untracked folders that may have been added by generateLicenseReport
6666 git add licenses
67- # there's always going to one line difference due to the timestamp included in the report
68- if [[ $(git diff --cached --shortstat licenses) == " 1 file changed, 1 insertion(+), 1 deletion(-)" ]]
67+ if git diff --cached --quiet licenses
6968 then
7069 echo "Licenses are up-to-date."
7170 else
7271 echo "Licenses are not up-to-date, please run './gradlew generateLicenseReport' locally and commit."
7372 echo
74- echo "$( git diff --cached --stat licenses)"
73+ git diff --cached --stat licenses
7574 echo
76- echo "$( git diff --cached licenses)"
75+ git diff --cached licenses
7776 exit 1
7877 fi
7978
Original file line number Diff line number Diff line change 4444 run : |
4545 ./gradlew generateLicenseReport
4646 git add licenses
47- # there's always going to one line difference due to the timestamp included in the report
48- if [[ $(git diff --cached --shortstat licenses) == " 1 file changed, 1 insertion(+), 1 deletion(-)" ]]
49- then
50- git reset HEAD licenses
51- git checkout -- licenses
47+ if git diff --cached --quiet; then
5248 exit 0 # success
5349 fi
5450 git commit -m "./gradlew generateLicenseReport"
Original file line number Diff line number Diff line change 11import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
22import com.github.jk1.license.filter.LicenseBundleNormalizer
33import com.github.jk1.license.render.InventoryMarkdownReportRenderer
4+ import java.nio.charset.StandardCharsets
45
56plugins {
67 id(" com.github.jk1.dependency-license-report" )
@@ -169,6 +170,22 @@ tasks {
169170 named(" generateLicenseReport" ).configure {
170171 dependsOn(cleanLicenses)
171172 finalizedBy(" :spotlessApply" )
173+ doLast {
174+ val reportFile = rootProject.file(" licenses/more-licenses.md" )
175+ if (reportFile.exists()) {
176+ val reportContents = reportFile.readText(StandardCharsets .UTF_8 )
177+ val normalizedReportContents =
178+ reportContents.replace(
179+ Regex (
180+ """ (?m)(^## Dependency License Report\r?\n)_\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}[^\r\n]*_\r?\n"""
181+ ),
182+ " $1" ,
183+ )
184+ if (normalizedReportContents != reportContents) {
185+ reportFile.writeText(normalizedReportContents, StandardCharsets .UTF_8 )
186+ }
187+ }
188+ }
172189 // disable licence report generation unless this task is explicitly run
173190 // the files produced by this task are used by other tasks without declaring them as dependency
174191 // which gradle considers an error
Original file line number Diff line number Diff line change 11
22# agent
33## Dependency License Report
4- _ 2026-07-29 22:55:05 UTC_
54## Apache License, Version 2.0
65
76** 1** ** Group:** ` com.fasterxml.jackson.core ` ** Name:** ` jackson-annotations ` ** Version:** ` 2.22 `
You can’t perform that action at this time.
0 commit comments