I wanted to do something like `tasks.register(Cust...
# gradle
t
I wanted to do something like
tasks.register(CustomTask)
and just override the name in my CustomTask
g
CustomTask doesn't have name, it's just task class, so you cannot override name for it
But, if you have some extension that should be configured for every task of this type (you may have multiple tasks of the same type), you can use tasks.withType(CustomTask) {}
t
Indeed, I was trying to override
getName
but it doesn’t work as I expected. I guess defining the name outside of the task makes more sense. Thanks @gildor
g
Yeah, actual task name assigned when you create (aka register) your task in tasks graph, otherwise it wouldn’t be possible to register them multiple times or with different name
👍 1