I am working on a couple of tasks that help generate double clickable applications (".app" bundles on MacOSX and using launch4j for windows). The task obviously “depends” on the list of runtime jars and other things like name and version in the project.
I was thinking of just adding the project.buildFile to my task’s inputs, but this seemed wrong.
Is there a way to say that a task “depends” on a value in the build file, like the version? I am guessing not as then gradle would have to save the old build file to determine what the values used to be.
Is there a better way to do this? In particular, in a multiproject some things might be set in the super project’s build file, and so the dependency on just the build file would not catch it.
Similarly, is there a way for a task to know that it needs to run again if the actual task itself has been updated. I have been bitten several times by making changes to my task’s source, recompiling it (as a separate project) and then running the task on the test project and nothing happens because gradle thinks the task is up to date. Can I “depend” on the jarfile that declares the task? Should gradle do this automatically?