Proposal: Don't show skipped tasks

(Peter Niederwieser) #1

Gradle builds can have quite a number of tasks that are in the task execution graph but aren’t actually executed. Examples:

  • Java-related tasks in a Groovy or Scala project
  • Per-source-set tasks that are only used for a particular source set. For example, a GenerateSources task might be added for each source set, but predominantly used for the 'main' source set.

Such tasks are currently flagged as SKIPPED or UP-TO-DATE. I propose not to show (log) such tasks instead (on the default log level) in order to reduce the noise. Since being skipped or not is a relatively stable property of a task (it typically doesn’t change unless files are added/removed or the build script is edited), I don’t think that the SKIPPED information will be missed all that much.

I haven’t checked if my proposal is technically feasible (whether it’s known early enough if a task will be skipped), but I suppose it can be made to work.


(Hans Dockter) #2

I think this is a good idea. I have a tendency to always prefer the quieter output. Once we continue to work on our dynamic console output, this gives us options to reduce the log even more. It would be also nice to not show tasks of dependent projects which are up to date.

(Adam Murdoch) #3

This would be a good thing to do. Perhaps we should distinguish between tasks which were skipped because they had no inputs, vs those which were skipped because they were up-to-date, on the assumption that I care much, much less about tasks that can never do any work, than I do about those that can sometimes do work.

Regardless, it should be possible to implement. We currently defer logging the name of the task until after the task has completed (so we can include the summary), or the task generates some logging, whichever happens first.

(René Groeschke) #4

I am not sure about this. Maybe it can mislead users. When calling a task, printing the depending tasks which are checked (though not executed) is a very useful information in my opinion. Especially for those builds, that heavily rely on autowiring this information is good to have.

What would be the output when calling a specific task, which is up-to-date. e.g: If I run “gradle compileJaxb” what would be the output? Having written this, a general “build up to date” may be enough here.

(Peter Niederwieser) #5

The proposal is about tasks that are skipped for a reason other than (just) being up-to-date. For example, this could be tasks that have ‘enabled’ set to ‘false’, or tasks skipped due to ‘@SkipWhenEmpty’.

One area where I can see this causing problems is ‘Copy’ tasks. People often get the ‘from’'s wrong, leading to a ‘@SkipWhenEmpty’ situation. Currently Gradle reports ‘up-to-date’ here which is confusing (‘skipped’ would be better). Not showing the ‘Copy’ task at all isn’t exactly an improvement.

Nevertheless I hope we find a way to reduce the number of tasks that do nothing but are reported, in particular to reduce the noise of per-source-set tasks.