I have a custom task that compiles “hello.c” file into “hello.o” file and also creates “hello.d” file, both in “build/obj”. I defined the inputs and outputs of my task so it can be cached and up-to-date handled. As outputs I defined the whole dir “build/obj”.
Now, when I change certain compile parameters to not create the “hello.d” file anymore and I DO NOT CLEAN before executing my task, the build cache for the new inputs gets filled with both the “hello.o” and the “hello.d” file, allthough the .d file is outdated and should be ignored now. Thus, my build cache is broken now and I didnt even notice
What is the recommended way to deal with such situations?
Note: I cannot list the files created by the compile tasks explicitly, because it depends on the parameters, which files are created in the end.