Skip to content

Resolve registerDependencies output lazily so a custom build directory applies - #3022

Merged
nedtwigg merged 2 commits into
diffplug:mainfrom
jjh75607:fix/register-dependencies-build-dir
Aug 18, 2026
Merged

Resolve registerDependencies output lazily so a custom build directory applies#3022
nedtwigg merged 2 commits into
diffplug:mainfrom
jjh75607:fix/register-dependencies-build-dir

Conversation

@jjh75607

Copy link
Copy Markdown
Contributor

Fixes #2114

setup() resolved the build directory eagerly and stored a plain File behind @OutputFile.
A layout.buildDirectory set later in the build script was therefore ignored. The marker file
stayed under the default build/.

getUnitOutput() is now a RegularFileProperty fed from getBuildDirectory().file(...), so
it resolves at execution time. The field was only read inside this task, so nothing else
changes.

One note on the reproduction. On current main this task is only registered by
SpotlessExtensionPredeclare. The test therefore drives it through spotlessPredeclare, not
the plain spotless { java {} } from the original report. I could not reproduce it without
predeclare.

@nedtwigg
nedtwigg merged commit 98547dc into diffplug:main Aug 18, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gradle: Unable to recognize layout.buildDirectory in build.gradle.

2 participants