anchor.diff:  
   Gradle scales in how you can organize your build logic. The first level of organizing your build logic for the example above, is extracting a method.
   
  -=== Example: Using methods to organize your build logic
  -
  -[source.multi-language-sample,groovy]
  -.build.gradle
  -----
  -include::{samplesPath}/userguide/tutorial/antLoadfileWithMethod/build.gradle[]
  -----
  +.Using methods to organize your build logic
  +====
  +include::sample[dir="userguide/tutorial/antLoadfileWithMethod", files="build.gradle[]"]
   
   .Output of **`gradle -q loadfile`**
   ----
   > gradle -q loadfile
   include::{samplesPath}/userguide/tutorial/antLoadfileWithMethod/antLoadfileWithMethod.out[]
   ----
  +====
   
   Later you will see that such methods can be shared among subprojects in multi-project builds. If your build logic becomes more complex, Gradle offers you other very convenient ways to organize it. We have devoted a whole chapter to this. See <<organizing_gradle_projects.adoc#organizing_gradle_projects,Organizing Gradle Projects>>.
   
  
positive.code: 
  The power of Groovy can be used for more than defining what a task does. For example, you can also use it to dynamically create tasks.
  
  === Example: Dynamic creation of a task
  
  [source.multi-language-sample,groovy]
  .build.gradle
  ----
  include::{samplesPath}/userguide/tutorial/dynamic/build.gradle[]
  ----
  
  .Output of **`gradle -q task1`**
  ----
  > gradle -q task1
  include::{samplesPath}/userguide/tutorial/dynamic/dynamic.out[]
  ----
  
  
  [[sec:manipulating_existing_tasks]]
  
negative.code: 
  Ant tasks are first-class citizens in Gradle. Gradle provides excellent integration for Ant tasks by simply relying on Groovy. Groovy is shipped with the fantastic `AntBuilder`. Using Ant tasks from Gradle is as convenient and more powerful than using Ant tasks from a `build.xml` file. From the example below, you can learn how to execute Ant tasks and how to access Ant properties:
  
  .Using AntBuilder to execute ant.loadfile target
  ====
  include::sample[dir="userguide/tutorial/antLoadfile", files="build.gradle[]"]
  
  .Output of **`gradle -q loadfile`**
  ----
  > gradle -q loadfile
  include::{samplesPath}/userguide/tutorial/antLoadfile/antLoadfile.out[]
  ----
  ====
  
  There is lots more you can do with Ant in your build scripts. You can find out more in <<ant.adoc#ant,Ant>>.
  
  