0

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.

5
  • 1
    from the same recommendation link: htmlOutput = layout.buildDirectory.file("outputs/lint/lint.html").get().asFile Commented Jul 9 at 9:08
  • 1
    tried it in 8.4 and it worked fine. Try removing the leading slash from the file path...
    – injecteer
    Commented Jul 9 at 9:20
  • Yay, that's worked, missed such an obvious thing. Thank you! Commented Jul 9 at 11:18
  • Please someone put it as an answer, so I'll accept it. Btw, any reason behind such a behavior? Commented Jul 9 at 11:18
  • 1
    The leading slash turns the path into an absolute one. Commented Jul 9 at 11:38

1 Answer 1

0

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.