I managed to get some more work done on implementation of task finalisers: see the last 3 commits at https://github.com/erdi/gradle/tree/finaliser-tasks.

I applied all the suggestions from the latest review (renamed finaliser to finalizer and added finalizer edges to task graph to resolve finaliser task dependencies only once) and rebased the branch to the latest master so that it's easier when you decide to merge it. I also implemented integration test scenarios for finalisers added to the design spec some time ago by Adam. Currently the following scenarios are failing and are marked with @Ignore (Given |a.finalizedBy b| and |a.dependsOn c| and |b.dependsOn d|): - |gradle a| run |c| only when |a| is disabled and all tasks are added to the task graph - |gradle a| run |c| only when |a.onlyIf { false }|. All tasks are added to the task graph.

If I understand it correctly ("We want to run the finalisers if the task was started, regardless of what it did. (...) Of course, this means that we'll run the finalizer more often than we need to (including when the finalized task is disabled). This is fine for now, and we'll make this better as a later step. The contract for a finalizer is 'should not run' not 'must not run' when the finalized task is not executed.") we want to leave it as is for now.

- |gradle b a| fails with a circular dependency failure. I think that this is not right as currently the contract seems to be that order specified on the command line is a should and not must ordering.

Please note that I changed the regexp for extracting executed tasks in OutputScrapingExecutionResult to also include failing tasks to be able to implement some of the scenarios. I noticed that failed tasks are included in executed tasks for InProcessExecutionResult and also asked Luke if that is the right thing to do.

Please let me know what are your current plans for this piece of work.

Marcin

Reply via email to