Hello,
Here is a use case to illustrate my problem:
-> I have a task that creates a file : build/result/toto.txt
-> The output of this task is the directory build/result
When I run the task, the file toto.txt is created.
When I run the task again, the task is UpToDate => OK
If I create a file build/result/titi.txt and re-run the task, the task is UpToDate because titi.txt is not considered as an output of the task because it has not been generated by the first run of the task.
Question 1: Is there a way to force gradle to automatically re-execute the task in this condition (i.e when output.dir changes even if the change affects something that has not been generated by the task) ?
I know the --rerun-tasks option but this is not really what I want. I want gradle to decide on its own.
Now let’s say that I modify the task to generate both toto.txt and titi.txt.
When I run the task, both files are overwritten
When I run the task again, the task is UpToDate => OK
If I modify titi.txt, the task is UpToDate because the file has never been generated by the task (It was existing before the first task run).
Question 2: Is there a way to force gradle re-evaluating task outputs without taking into account already existing files ? In other words, is there a way to make gradle understand that tasks outputs are really toto.txt & titi.txt without removing and re-generating them ?
Thanks for your help,