This message was deleted.
# plugin-development
s
This message was deleted.
m
Usually, you'd use annotated properties with
@Input
I'd recommend reading the Gradle doc if you haven't already. This blog post is also pretty good: https://dev.to/autonomousapps/gradle-plugins-and-extensions-a-primer-for-the-bemused-51lp
If the input is the output of another task you'll have to use the
Provider
API to carry task dependencies automatically
j
it depends on the property
if the property can be built easily with objects.property because it is used a default value, it is easier to inject objectFactory. If the task needs things from the project, you can pass them when you are registering them
m
Could you have a quick look to this and tell how you would pass
magicOutputProvider
to my PrintInputAction?
j
when your task has only one output and the other task has only one input, you can see use from to set it
printTask.configure { from(otherTask) }
so you shouldn't need the objects and the input should be a normal abstract property outside constructor
m
Yes, but the point is I need to access the output in the action class which is added dynamically (to customize the output of an existing task which I don't want to/can't modify).
So I need to pass the 'dynamic' output to the my action class also.
j
not sure what you mean with dynamic
m
You have an existing task and you want to add an action to it.
This action should use the same input directory as the task.