How to correctly specify Input for a Task?

I’m a newbie at Gradle Plugin / Tasks Development, so… :grinning:
I want to create publishToLocal task that creates some custom distribution of the app in local directory.
Besides everything else, it’s supposed to read jvmArgs of JavaExec process. And the trap here is that there we have another task that re-write jvmArgs of JavaExec during its execution. Exactly replace the whole object:

execTask.setJvmArgs(new ArrayList(…));

So okay, firstly, I need to set in dependsOn task that modifies args:

dependsOn.add("configJavafxRun")

Then, I specify a property as Input:

val execTask = project.tasks.findByName(ApplicationPlugin.TASK_RUN_NAME) as JavaExec

@Input
val jvmArgs = execTask.jvmArgs as List<String>

And now I see how all the properties are initialized before task in dependsOn is executed. Well, this configJavafxRun doesn’t have any input\output annotations in its implementation. But I only need to use its side-effect (changed args) as input for my task. How can I achieve this ? Task input is processed during creation of the task object (as far as I got), but I need it to be processed directly before task execution.
So why do I have to specify input for my task ?

P.S. Of course, if I pick up args during task execution - everything works great and I receive valid jvmArgs object.

    @TaskAction
    fun execute(inputChanges: InputChanges) {
        val execTask = project.tasks.findByName(ApplicationPlugin.TASK_RUN_NAME) as JavaExec
        val jvmArgs = execTask.jvmArgs as List<String>
    }