# Project.ext and ext differ

**URL:** <https://discuss.gradle.org/t/project-ext-and-ext-differ/1684>\
**Category:** Old Forum Archive\
**Created:** [April 24, 2013, 2:49pm UTC](https://discuss.gradle.org/t/project-ext-and-ext-differ/1684 "2013-04-24T14:49:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![esycat](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/esycat/32/436_2.png) [@esycat](https://discuss.gradle.org/u/esycat)\
**Post date:** [April 24, 2013, 2:49pm UTC](https://discuss.gradle.org/t/project-ext-and-ext-differ/1684/1 "2013-04-24T14:49:00Z")

</div>

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: [https://gist.github.com/esycat/5452669](https://gist.github.com/esycat/5452669) 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?

Thanks.

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [April 24, 2013, 2:57pm UTC](https://discuss.gradle.org/t/project-ext-and-ext-differ/1684/2 "2013-04-24T14:57:00Z")

</div>

All DSL objects have an ‘ext’ property.

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

---

<div class="post-metadata">

**Author:** ![esycat](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/esycat/32/436_2.png) [@esycat](https://discuss.gradle.org/u/esycat)\
**Post date:** [April 24, 2013, 3:34pm UTC](https://discuss.gradle.org/t/project-ext-and-ext-differ/1684/3 "2013-04-24T15:34:00Z")

</div>

Ah, I see.

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

Thanks.

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [April 24, 2013, 3:39pm UTC](https://discuss.gradle.org/t/project-ext-and-ext-differ/1684/4 "2013-04-24T15:39:00Z")

</div>

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