How can I know that a build was incremental or not...
# general
a
How can I know that a build was incremental or not? I think of considering a build without tasks as UP-TO-DATE as an incremental build, what do you think? 🤔
v
I probably misunderstood what you mean. But having tasks that are UP-TO-DATE does not mean it is not incremental. Quite contrary. Incremental build means that the up-to-date checks find out which tasks actually need to run and which are already up-to-date and do not need to run. But having no UP-TO-DATE task still does not mean it is not an incremental build, but it could also just mean that all tasks are out-of-date.
a
Oh okay, do you know if there is a way to be sure that a build is incremental or not? Would a task without any tasks FROM-CACHE be better as a criteria?
v
No, that just means that no task was found in the cache, or that the tasks were already up-to-date, or that the cache is disabled.
What do you actually want to achieve? Your question more seems like you imagine a solution already, maybe there is a better way.
a
I'm trying to find a way to mark a build as incremental or not
We collect data from our builds, about the build itself and all its tasks, and I'm analysing this data with Redash
So I wonder, what in that data could tell me it is an incremental build or not
v
I'd say every build is incremental. Well maybe unless you specify
--rerun-tasks
. The question is, what does that info tell you? Maybe you also mean something different with "incremental".
a
By incremental I mean based on the previous build. Did I understand that wrong? I think you're right and at the end we're always building on top of something, would it be up to date tasks, or cached tasks... even after a clean, because of caching the next build is still kind of incremental. The only way to really be not incremental is to clean, then delete the Gradle cache, but there's no point in measuring that.