From 6b88318bcdbdb78427499ae36f984872059e11da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Fri, 11 Apr 2025 11:44:35 +0200 Subject: [PATCH] Fix regression of Java sources not being processed before compiling --- build.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 63d5400e..25eef9d1 100644 --- a/build.gradle +++ b/build.gradle @@ -147,9 +147,11 @@ installDist { dependsOn build } -tasks.register('processSource', Sync) { +def processSource = tasks.register('processSource', Sync) { def gitOutput = new ByteArrayOutputStream() + outputs.dir "${project.buildDir}/src" + exec { commandLine 'git', 'rev-parse', '--short', 'HEAD' standardOutput = gitOutput @@ -164,9 +166,11 @@ tasks.register('processSource', Sync) { .replaceAll('__builddate__', new Date().format("d MMM yyyy")) .replaceAll('__commithash__', gitOutput.toString().trim()) .replaceAll('__version__', version) - } into "${project.buildDir}/src" + } into outputs.files.singleFile } +tasks.compileJava.source = processSource.map { it.outputs.files } + tasks.register('update') { dependsOn installDist