Skip to content

Commit

Permalink
Fix Gradle build sometimes gives spurious "unreferenced license file"…
Browse files Browse the repository at this point in the history
… warnings (#13696)

Revert changes by #12150 in jar-checks.gradle, because tasks in this file share internal state between tasks without using files. Because of this all tasks here must always execute together, so they cannot define task outputs.
  • Loading branch information
uschindler authored Aug 28, 2024
1 parent 79fd9fe commit e45b5eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
15 changes: 5 additions & 10 deletions gradle/validation/jar-checks.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
// 2) notice file
// 3) checksum validation/ generation.

// WARNING: The tasks in this file share internal state between tasks without using files.
// Because of this all tasks here must always execute together, so they cannot define task outputs.
// TODO: Rewrite the internal state to use state files containing the ext.jarInfos and its referencedFiles

// This should be false only for debugging.
def failOnError = true

Expand Down Expand Up @@ -194,13 +198,6 @@ subprojects {
description = "Validate license and notice files of dependencies"
dependsOn collectJarInfos

def outputFileName = 'validateJarLicenses'
inputs.dir(file(project.rootDir.path + '/lucene/licenses'))
.withPropertyName('licenses')
.withPathSensitivity(PathSensitivity.RELATIVE)
outputs.file(layout.buildDirectory.file(outputFileName))
.withPropertyName('validateJarLicensesResult')

doLast {
def errors = []
jarInfos.each { dep ->
Expand Down Expand Up @@ -246,9 +243,7 @@ subprojects {
}
}
}
// Required to take advantage of incremental building and the build cache
def f = new File(project.buildDir.path + "/" + outputFileName)
f.write(errors.toString(), "UTF-8")

if (errors) {
def msg = "Certain license/ notice files are missing:\n - " + errors.join("\n - ")
if (failOnError) {
Expand Down
6 changes: 6 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,12 @@ Bug Fixes

* GITHUB#13691: Fix incorrect exponent value in explain of SigmoidFunction. (Owais Kazi)

Build
---------------------

* GITHUB#13695, GITHUB#13696: Fix Gradle build sometimes gives spurious "unreferenced license file" warnings.
(Uwe Schindler)

Other
--------------------
(No changes)
Expand Down

0 comments on commit e45b5eb

Please sign in to comment.