Is it possible to register a tasks that takes a ta...
# community-support
s
Is it possible to register a tasks that takes a task argument directly from Kotlin DSL without creating a plugin / deriving from
DefaultTask
?
t
What do you mean by "task argument"? Anyway, you can create a task class right in your build script if you need to declare properties and set appropriate annotations on them.
s
I mean a task that can take a task-specific argument on the CLI, like in this example: https://docs.gradle.org/current/samples/sample_task_with_arguments.html
Found it, it's not possible:
Command line options can only be declared for custom tasks via annotation. There’s no programmatic equivalent for defining options.
j
You can create a task in a build script with a class and annotations as @Thomas Broyer said
v
What you want to thumb-up and follow is https://github.com/gradle/gradle/issues/11117
👍 1