Project.ext and ext differ

Hi there,

My understanding was that ‘ext’ is always just another reference to ‘project.ext’ object. But it turns out that it is not always the case. Please, check the following example: The assertions on lines 1, 7 and 16 pass, but the one on line 10 inside a task scope fails.

Is it supposed to work like that? Did I miss something in the documentation?


All DSL objects have an ‘ext’ property.

Your test case fails because you’re comparing the task’s ‘ext’ with the project’s ‘ext’.

Ah, I see.

I suppose I was confused because ‘ext’ does work as I expected inside configuration blocks like ‘buildscript {}’ and ‘dependencies {}’.


That’s a bug in both cases. The bug is that those objects don’t get the runtime enhancement.