From e45b5ebdf88201563753a1a3f45e316a6f9ed1f6 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 28 Aug 2024 20:35:26 +0200 Subject: [PATCH] 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. --- gradle/validation/jar-checks.gradle | 15 +++++---------- lucene/CHANGES.txt | 6 ++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/gradle/validation/jar-checks.gradle b/gradle/validation/jar-checks.gradle index 5fe1bcbb3a6..aacb18c3eff 100644 --- a/gradle/validation/jar-checks.gradle +++ b/gradle/validation/jar-checks.gradle @@ -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 @@ -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 -> @@ -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) { diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index f26b4b30a88..313032edb4d 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -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)