Differenciate Clean vs Incremental Build

Is there any way to differenciate clean vs incremental Gradle build programmatically?

Can you elaborate on what you mean or need exactly?
“Clean” build just means that none of the tasks has outputs present already.
A build is practically always incremental, unless you do a --rerun-tasks which will rerun all tasks independent of whether they would usually be up-to-date or cached or only some of the incremental inputs changed.