https://kotlinlang.org logo
Title
t

tulio

08/21/2019, 7:53 PM
I wanted to do something like
tasks.register(CustomTask)
and just override the name in my CustomTask
g

gildor

08/22/2019, 12:00 AM
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

tulio

08/22/2019, 10:53 AM
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

gildor

08/22/2019, 10:59 AM
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