Search code examples
gradlebuild.gradlelint

Gradle layout.buildDirectory Read-only file system issue


So I'm following Gradle's recommendation to remove the deprecated $project.buildDir property for the lint settings.

It was: htmlOutput file("$project.buildDir/outputs/lint/lint.html")
It became: htmlOutput layout.buildDirectory.file("/outputs/lint/lint.html").get().asFile

Now when running lint I receive the next error: java.nio.file.FileSystemException: /outputs: Read-only file system.

I'm wondering if I'm missing something, or if something should be done additionally.


Solution

  • As per the same recommendation link, it should be: htmlOutput = layout.buildDirectory.file("outputs/lint/lint.html").get().asFile

    Moved to the answers from comments.