Multiple custom tasks to be registered

I have a class with several custom tasks in it. There are about 30 of them. I was building these using the standard guidelines, which suggest that in my build where I want to use them I have to register them using the syntax

tasks.register('greeting', test.mygradletasks.GreetingTask) {
    greeting = 'howdy!'

But I dont want to have to register all 30 of them this way. Is there a shortcut to being able to register all tasks in a class ?

Can you elaborate a bit more what you mean?
A task is a class, so it is unclear to me what you mean when you say, that there are multiple tasks in one class.

Apologies, I misstated my requirement. I mean I have about 30 different custom tasks. So I would have 30 different classes. I don’t want to have to register each one individually. Is there some shortcut for doing that ? Or at least register them in one place and reuse it in every project ? Otherwise, I would be replicating these 30 lines of register steps in every build file for every project.

There is not really a shortcut, as you also have to specify the task name.
But for preventing the duplication, the idiomatic solution is to use convention plugins, for example implemented as precompiled script plugins.
Then you code it in one place and just apply that convention plugin to your projects.

Thanks. That seems to be similar to what I want. Is there a sample available ?

Every other non-trivial build out there. :smiley:
Or for example Sharing convention plugins with build logic build Sample.
Or for a quite complex example the probably has way more than you need: GitHub - jjohannes/idiomatic-gradle: How do I idiomatically structure a large build with Gradle 7.2+?