This message was deleted.
# plugin-development
s
This message was deleted.
v
Maybe in Gradle 9. Currently, you would do
layout.dir(provider { temporaryDir })
k
I wonder if you can make a good Kotlin extension function that gives something similar. The closest I got is
Copy code
val Task.temporaryDirectory
  get() = project.objects.directoryProperty().fileValue(temporaryDir).apply {
    disallowChanges()
    finalizeValueOnRead()
  }
I just need to figure out how to get rid of that first part where I use
project
.
v
Why that complex and not what I wrote?
Copy code
val Task.temporaryDirectory
  get() = project.layout.dir(project.provider { temporaryDir })
k
No reason. Still trying to find a solution that does not involve using
project
.
v
There is probably no way without a possibilty to inject any thing like
ObjectFactory
or
ProjectLayout
or whatever