# Build.gradle groovy technicals

**URL:** <https://discuss.gradle.org/t/build-gradle-groovy-technicals/40092>\
**Category:** Help/Discuss\
**Created:** [May 30, 2021, 12:04pm UTC](https://discuss.gradle.org/t/build-gradle-groovy-technicals/40092 "2021-05-30T12:04:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marek-jasovsky](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@marek-jasovsky](https://discuss.gradle.org/u/marek-jasovsky)\
**Post date:** [May 30, 2021, 12:04pm UTC](https://discuss.gradle.org/t/build-gradle-groovy-technicals/40092/1 "2021-05-30T12:04:36Z")

</div>

good afternoon

if I have e.g. java plugin applied in my build.gradle and then later in the code I have

test {  
// just example  
enabled = false  
outDir = …  
}

what exactly is it related to groovy language? and how does the configuration gets applied? I suppose this test {} block relates to test task from java plugin, and it get’s somehow parsed, then applied to the code of test task… where in gradle source code can I find exactly, how this is being implemented?

thx a lot

---

<div class="post-metadata">

**Author:** ![Pierre1](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Pierre1](https://discuss.gradle.org/u/Pierre1)\
**Post date:** [May 31, 2021, 10:21am UTC](https://discuss.gradle.org/t/build-gradle-groovy-technicals/40092/2 "2021-05-31T10:21:01Z")

</div>

Hello,

The [official apidoc of Project](https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html) mentions dynamic methods:

> _Dynamic Methods_  
> A project has 5 method ‘scopes’, which it searches for methods:
> 
> - […]
> - The tasks of the project. A method is added for each task, using the name of the task as the method name and taking a single closure or [`Action`](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html) parameter. The method calls the [`Task.configure(groovy.lang.Closure)`](https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html#configure-groovy.lang.Closure-) method for the associated task with the provided closure. For example, if the project has a task called `compile` , then a method is added with the following signature: `void compile(Closure configureClosure)` .

I could not find the exact location in the Gradle source code, but I assume that the binding to the `configure` method is done with some Groovy metaprogramming probably by adding some method on the project’s meta class.
