Skip to content

Commit e45b5eb

Browse files
authored
Fix Gradle build sometimes gives spurious "unreferenced license file" 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.
1 parent 79fd9fe commit e45b5eb

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

gradle/validation/jar-checks.gradle

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
// 2) notice file
2121
// 3) checksum validation/ generation.
2222

23+
// WARNING: The tasks in this file share internal state between tasks without using files.
24+
// Because of this all tasks here must always execute together, so they cannot define task outputs.
25+
// TODO: Rewrite the internal state to use state files containing the ext.jarInfos and its referencedFiles
26+
2327
// This should be false only for debugging.
2428
def failOnError = true
2529

@@ -194,13 +198,6 @@ subprojects {
194198
description = "Validate license and notice files of dependencies"
195199
dependsOn collectJarInfos
196200

197-
def outputFileName = 'validateJarLicenses'
198-
inputs.dir(file(project.rootDir.path + '/lucene/licenses'))
199-
.withPropertyName('licenses')
200-
.withPathSensitivity(PathSensitivity.RELATIVE)
201-
outputs.file(layout.buildDirectory.file(outputFileName))
202-
.withPropertyName('validateJarLicensesResult')
203-
204201
doLast {
205202
def errors = []
206203
jarInfos.each { dep ->
@@ -246,9 +243,7 @@ subprojects {
246243
}
247244
}
248245
}
249-
// Required to take advantage of incremental building and the build cache
250-
def f = new File(project.buildDir.path + "/" + outputFileName)
251-
f.write(errors.toString(), "UTF-8")
246+
252247
if (errors) {
253248
def msg = "Certain license/ notice files are missing:\n - " + errors.join("\n - ")
254249
if (failOnError) {

lucene/CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,12 @@ Bug Fixes
405405

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

408+
Build
409+
---------------------
410+
411+
* GITHUB#13695, GITHUB#13696: Fix Gradle build sometimes gives spurious "unreferenced license file" warnings.
412+
(Uwe Schindler)
413+
408414
Other
409415
--------------------
410416
(No changes)

0 commit comments

Comments
 (0)