Should finalizing tasks be executing if the parent task is skipped? (1.9-rc-2)

This is a re-post for the mailing list. Just wanted to make sure it’s on the radar.

We’ve implemented a couple new features in our build using the ‘finalizedBy’ feature but I’m seeing some behavior that I’m not sure is correct.

Assume we have this build

tasks a, b, c, d

a.finalizedBy d

c.dependsOn [a, b]

a.onlyIf { project.hasProperty(‘foo’) }

b.onlyIf { !project.hasProperty(‘foo’) }

when I execute this build without the ‘foo’ property, then I expect only b and c to execute and a and d to be skipped.

However, what I see is that b, c, and d execute and a is skipped.

So it appears that the ‘finalizedBy’ task (d) executes regardless event though the parent task (a) was skipped.

Is this expected behavior or should the finalizing task also skip in this scenario?

This is occuring with 1.9-rc-2 (haven’t tested with 1.8)