This message was deleted.
# community-support
s
This message was deleted.
r
Also, running inotifywait in another tab on the same path, I can see the changes to the classes being picked up
e.g.
Copy code
/home/rfirmin/code/startup/frameworkrnd/backend3/build/classes/kotlin/jvm/main/META-INF/ DELETE backend5.kotlin_module
/home/rfirmin/code/startup/frameworkrnd/backend3/build/classes/kotlin/jvm/main/ah/view/components/ DELETE Card.class
/home/rfirmin/code/startup/frameworkrnd/backend3/build/classes/kotlin/jvm/main/ DELETE,ISDIR META-INF
/home/rfirmin/code/startup/frameworkrnd/backend3/build/classes/kotlin/jvm/main/ah/view/components/ CREATE Card.class
/home/rfirmin/code/startup/frameworkrnd/backend3/build/classes/kotlin/jvm/main/ah/view/components/ MODIFY Card.class
/home/rfirmin/code/startup/frameworkrnd/backend3/build/classes/kotlin/jvm/main/ CREATE,ISDIR META-INF
v
Besides that you should not modify the inputs and outputs of the
run
task like you do, does your
run
task finish, or does it run continuously. I suspect the latter, in which
-t
will not do what you suspect.
-t
when the build finished watches for tasks with file inputs and if the inputs changed rerun the build. But if the
run
task is still running, the
-t
functionality does not kick in as the build is not yet finished.
-t
does not abort a running task.
r
It runs continuously. I started without modifying the inputs, and it wasn't working then. Just confirmed by removing those lines so it is now:
Copy code
tasks.named<JavaExec>("run") {
//        val main by sourceSets.getting
//        println(main.output.asPath)
//        inputs.files(main.allSource, main.output)
        outputs.upToDateWhen { false }
    }
...and still no changes are picked up. Re
-t
are you saying I should not include -t? Without it, no difference it seems
v
Even
outputs.upToDateWhen { false }
is not necessary, the
run
task does not have outputs by default anyway. Regarding
-t
of course it makes not difference. I told you that it does not work for your intended use-case and there is no way to achieve what you want. As long as the
run
task is still running, the build is still running and there is no "automatically abort running task when condition X is fulfilled" functionality.
r
Ah, so if the application exited on change, it would "work"? I have seen gradle -t run used in this manner in for example kvision (a framework) - it works reliably to pick up changes to a running app. I thought the same would be true here
v
I have no idea about kvision, but yes, if the
run
task would end, then
-t
would work in rerunning the build if input files changed.