This message was deleted.
# plugin-development
s
This message was deleted.
v
The signature of
doLast
is
doLast(Action<? super Task> action)
, so make your dedicated class implement
Action<? super Task>
and then you can give an instance of it to
doLast
.
m
Yes indeed, sorry but then I got the issue that I wanted to inject an instance of the ObjectFactory. How can I inject dependencies in my class?
The goal was to be able to easily use configuration caching with doLast actions.
After reading your answer I somehow found how to instantiate it 😅
Copy code
project.objects.newInstance
It was my first time 😄
v
If you instantiate your class through Gradle, e. g. with
objects.newInstance
, then you can just inject all available Gradle services, yes.