This message was deleted.
# community-support
s
This message was deleted.
m
This always confused me - somehow there's a magical
Project
object injected into settings files, meaning you can call
Project.files(...)
e
no, Settings isn't Project. it is Script though
👍 1
m
Well there we go
s
So this means, in case I use a custom Settings plugin, I could cast it to an Script, right? 🤔
v
No, if you are not writing a script, you are not writing a script. Except if you write a precompiled script plugin, but then it also would just work without cast.
You could for example inject an
ObjectFactory
and use its methods to create a file collection.
s
How can I inject an ObjectFactory into an Settings plugin? 🤔 Isn't this already too late? I tried it with
Copy code
@Inject
lateinit var objectFactory: ObjectFactory
but this crashed as objectFactory wasn't working (if I did it right 🤔 )
v
Why too late? Crashed in what way? I think it should be
Copy code
@get:Inject
abstract val objectFactory: ObjectFactory
🐛 1
s
That should be it. Thanks! Will try it
👌 1