hello! Is there a way to get a `RegularFile` objec...
# plugin-development
f
hello! Is there a way to get a
RegularFile
object within a
Settings
object? I’m writing a settings plugin and I was hoping to use the configuration cache friendly providers i.e.
ProviderFactory#fileContents
. These take in a
RegularFile
or a
Provider<RegularFile>
, and I can’t seem to find a way to get an instance of one of those within the
Settings
context. I resorted to just calling
ProviderFactory#of
and passing in the
ValueSourceProvider
that
fileContents
used, and then passed the file in that way as the parameter is just a
FileSystemProperty
. That said, I’m not actually sure whether the configuration cache works at the
Settings
level, but I’ve been trying to have good
Provider
hygiene where possible to ease our configuration cache slog of a migration.
v
configuration cache skips all phases up to execution, including settings script and init scripts. How about
layout.settingsDirectory.file("asdf")
resp
layout.rootDirectory.file("asdf")
?
f
ahh, that’s on a newer version of Gradle that we don’t support yet 😢 but good to know for future, that’s exactly what I want
thanks!