I look at it from a macro/micro perspective: the build tool has a macro view, it can detect if something changed in the input or the output. If it did, then we switch to micro, the task runs and the logic to do as little as possible belongs in business logic, not the build tool any more