Skip to content

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

Description

@goldentrash

Summary

When I changed the build directory, Spotless doesn't seem to recognize the changed build directory.

Detail

image

Changed the Gradle build directory from default (rootDir/build) to custom (rootDir/bug-test).

All other build output is generated from the changed build directory, but build/tmp/spotless-register-dependencies is still there.

Yes. It's not a serious error, but it's annoying, right?

Expected Behavior

A tmp/spotless-register-dependencies file should be created under the changed build directory (in this case rootDir/bug-test).

Configuration (build.gradle)

spotless {
    java {
    }
}

// It is not part of the spotless configuration, but is directly related to this issue.
layout.buildDirectory = "bug-test"

Gradle or Maven version

------------------------------------------------------------
Gradle 8.5
------------------------------------------------------------

Build time:   2023-11-29 14:08:57 UTC
Revision:     28aca86a7180baa17117e0e5ba01d8ea9feca598

Kotlin:       1.9.20
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          17.0.10 (Amazon.com Inc. 17.0.10+7-LTS)
OS:           Windows 11 10.0 amd64

Spotless version

plugins {
    id 'java'
    id "com.diffplug.spotless" version "6.25.0"
}

Related Issue

Maybe it's related to this issue. #2019

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions