anchor.diff:  
   The https://github.com/gradle/gradle-profiler#gradle-profiler[Gradle Profiler] is a tool to measure build times for Gradle builds in a predictable and reproducible manner. The tool automates collecting profiling and benchmark information from a Gradle build and mitigates environmental impacts to measuring build time (like JIT warmups and cached dependencies). Clone and build `gradle-profiler` locally.
   
  -To measure the impact of the new API on your build, we've included a sample scenario file you can use. This scenario runs `gradle help` on your build with a special flag to enable/disable the new API to make it easier to measure improvements.
  +To measure the impact of the new API on your build, we've included a sample scenario file you can use. This scenario runs `gradle help` on your build with a special flag to enable/disable the new API to make it easier to measure improvements. `gradle help` approximates the time it takes Gradle to configure your build by running only a single, simple task.
   
   .Save as help.scenario
   [source,json]
  
positive.code: 
  [cols="a,a", options="header"]
  |===
  | Old API | New API
  
  | *Groovy DSL* `task myTask(type: MyTask) {}`
  | `tasks.register("myTask", MyTask) {}`
  2+| There is not a shorthand DSL for using the new API.
  
  | api:org.gradle.api.tasks.TaskContainer#create(java.util.Map)[]
  | No direct equivalent.
  2+| Use one of the alternatives below.
  
  | api:org.gradle.api.tasks.TaskContainer#create(java.util.Map,groovy.lang.Closure)[]
  | No direct equivalent.
  2+| Use one of the alternatives below.
  
  | api:org.gradle.api.tasks.TaskContainer#create(java.lang.String)[]
  | api:org.gradle.api.tasks.TaskContainer#register(java.lang.String)[]
  2+| This returns a `TaskProvider` instead of a `Task`.
  
  | api:org.gradle.api.tasks.TaskContainer#create(java.lang.String,groovy.lang.Closure)[]
  | api:org.gradle.api.tasks.TaskContainer#register(java.lang.String,org.gradle.api.Action)[]
  2+| This returns a `TaskProvider` instead of a `Task`.
  
  | api:org.gradle.api.tasks.TaskContainer#create(java.lang.String,java.lang.Class)[]
  | api:org.gradle.api.tasks.TaskContainer#register(java.lang.String,java.lang.Class)[]
  2+| This returns a `TaskProvider` instead of a `Task`.
  
  | api:org.gradle.api.tasks.TaskContainer#create(java.lang.String,java.lang.Class,org.gradle.api.Action)[]
  | api:org.gradle.api.tasks.TaskContainer#register(java.lang.String,java.lang.Class,org.gradle.api.Action)[]
  2+| This returns a `TaskProvider` instead of a `Task`.
  
  | api:org.gradle.api.tasks.TaskContainer#create(java.lang.String,java.lang.Class,java.lang.Object...)[]
  | api:org.gradle.api.tasks.TaskContainer#register(java.lang.String,java.lang.Class,java.lang.Object...)[]
  2+| This returns a `TaskProvider` instead of a `Task`.
  
  | api:org.gradle.api.tasks.TaskCollection#getByName(java.lang.String)[]
  | api:org.gradle.api.tasks.TaskCollection#named(java.lang.String)[]
  2+| This returns a `TaskProvider` instead of a `Task`.
  
  | api:org.gradle.api.tasks.TaskCollection#getByName(java.lang.String,groovy.lang.Closure)[]
  | `named(java.lang.String).configure(Action)`
  2+| This returns `void`, so it cannot be chained.
  
  | api:org.gradle.api.tasks.TaskContainer#getByPath(java.lang.String)[]
  | No direct equivalent.
  2+| Accessing tasks from another project requires a specific ordering of project evaluation. 
  
  | api:org.gradle.api.NamedDomainObjectCollection#findByName(java.lang.String)[]
  | No direct equivalent.
  2+| `named(String)` is the closest equivalent, but will fail if the task does not exist. Using `findByName(String)` will cause tasks registered with the new API to be created/configured.
  
  | api:org.gradle.api.tasks.TaskContainer#findByPath(java.lang.String)[]
  | No direct equivalent.
  2+| See `getByPath(String)` above.
  
  | api:org.gradle.api.tasks.TaskCollection#withType(java.lang.Class)[]
  | _OK_
  2+| This is OK to use because it does not require tasks to be created immediately.
  
  | `withType(java.lang.Class).getByName(java.lang.String)`
  | `withType(java.lang.Class).named(java.lang.String)`
  2+| This returns a `TaskProvider` instead of a `Task`.
  
  | api:org.gradle.api.DomainObjectCollection#withType(java.lang.Class,org.gradle.api.Action)[]
  | `withType(java.lang.Class).configureEach(org.gradle.api.Action)`
  2+| This returns `void`, so it cannot be chained.
  
  | api:org.gradle.api.DomainObjectCollection#all(org.gradle.api.Action)[]
  | api:org.gradle.api.DomainObjectCollection#configureEach(org.gradle.api.Action)[]
  2+| This returns `void`, so it cannot be chained.
  
  | api:org.gradle.api.NamedDomainObjectSet#findAll(groovy.lang.Closure)[]
  | _OK_, with issues.
  2+| Avoid calling this method. `matching(Spec)` and `configureEach(Action)` are more appropriate in most cases.
  
  | api:org.gradle.api.tasks.TaskCollection#matching(groovy.lang.Closure)[]
  | _OK_
  2+| This is OK to use because it does not require tasks to be created immediately.
  
  | api:org.gradle.api.tasks.TaskCollection#getAt(java.lang.String)[]
  | api:org.gradle.api.tasks.TaskCollection#named(java.lang.String)[]
  2+| Avoid calling this directly as it's a Groovy convenience method. The alternative returns a `TaskProvider` instead of a `Task`.
  
  | `iterator()` or implicit iteration over the `Task` collection
  | _OK_, with issues.
  2+| Avoid doing this as it requires creating and configuring all tasks. See `findAll(Closure)` above.
  
  | `remove(org.gradle.api.Task)`
  | _OK_, with issues.
  2+| Avoid calling this. The behavior of `remove` with the new API may change in the future.
  
  | api:org.gradle.api.tasks.TaskContainer#replace(java.lang.String)[]
  | _OK_, with issues.
  2+| Avoid calling this. The behavior of `replace` with the new API may change in the future.
  
  | api:org.gradle.api.tasks.TaskContainer#replace(java.lang.String,java.lang.Class)[]
  | _OK_, with issues.
  2+| Avoid calling this. The behavior of `replace` with the new API may change in the future.
  
  |===
  
  
negative.code: [[sec:what_do_we_want]]
  === What do we want you to do?
  
  We've been using this feature in many of the built-in Gradle plugins, internal Gradle projects and the Gradle build itself. Now we would appreciate your help in evaluating it with your builds as well.
  
  We'd like for you to take a few steps:
  
  - Try your build with the latest nightly (see the version number at the top of this page).
  - How many tasks do you see registered with the new API?  See <<sec:how_do_i_know_its_working>> for how to find this.
  - Which task types are most numerous? Which ones are created with the old API? Which ones are registered with the new API, but have been created/configured anyways?
  - Following <<sec:task_configuration_avoidance_pitfalls>>, change your build scripts to use the new API to avoid creating/configuring tasks that are from the built-in Gradle plugins. Is there an impact to the number of tasks that are created?
  - Convert some of your custom plugins/tasks to use the new API.  Is there an impact to the number of tasks using the new API and the number of new API tasks that are created?
  - Run the https://github.com/gradle/gradle-profiler[gradle-profiler] to measure the difference between a build with less task configuration and a build where all tasks are configured. What do you see? Use <<sec:new_task_gradle_profiler_scenario,the scenario file below>>.
  