anchor.diff:  ====
   
   [[sec:optional_parentheses_on_method_calls]]
  -=== Optional parentheses on method calls
  -
  -Parentheses are optional for method calls.
  +=== Optional Parentheses on Method Calls
  +
  +Groovy doesn't require parentheses for method calls:
   
   .Method call without parentheses
   ====
  
positive.code: | An `AntBuilder` instance
  |===
  
  [IMPORTANT]
  .Script with other targets
  ====
  The _build scripts_ described here target `Project` objects.
  There are also <<build_lifecycle.adoc#sec:settings_file,settings scripts>> and <<init_scripts.adoc#init_scripts,init scripts>> that respectively target link:{groovyDslPath}/org.gradle.api.initialization.Settings.html[Settings] and link:{groovyDslPath}/org.gradle.api.invocation.Gradle.html[Gradle] objects.
  ====
  
  [[sec:the_script_api]]
  == The script API
  
  When Gradle executes a Groovy build script (`.gradle`), it compiles the script into a class which implements link:{groovyDslPath}/org.gradle.api.Script.html[Script]. This means that all of the properties and methods declared by the `Script` interface are available in your script.
  
  When Gradle executes a Kotlin build script (`.gradle.kts`), it compiles the script into a subclass of link:https://gradle.github.io/kotlin-dsl-docs/api/org.gradle.kotlin.dsl/-kotlin-build-script/index.html[KotlinBuildScript]. This means that all of the visible properties and functions declared by the `KotlinBuildScript` type are available in your script. Also see the  link:https://gradle.github.io/kotlin-dsl-docs/api/org.gradle.kotlin.dsl/-kotlin-settings-script/index.html[KotlinSettingsScript] and link:https://gradle.github.io/kotlin-dsl-docs/api/org.gradle.kotlin.dsl/-kotlin-init-script/index.html[KotlinInitScript] types respectively for settings scripts and init scripts.
  
  [[sec:declaring_variables]]
  == Declaring variables
  
  There are two kinds of variables that can be declared in a build script: local variables and extra properties.
  
  [[sec:local_variables]]
  === Local variables
  
  [.multi-language-text.lang-groovy]
  Local variables are declared with the `def` keyword. They are only visible in the scope where they have been declared. Local variables are a feature of the underlying Groovy language.
  
  [.multi-language-text.lang-kotlin]
  Local variables are declared with the `val` keyword. They are only visible in the scope where they have been declared. Local variables are a feature of the underlying Kotlin language.
  
  .Using local variables
  ====
  include::sample[dir="snippets/tutorial/localVariables/groovy",files="build.gradle[]"]
  include::sample[dir="snippets/tutorial/localVariables/kotlin",files="build.gradle.kts[]"]
  ====
  
  [[sec:extra_properties]]
  === Extra properties
  
  All enhanced objects in Gradle's domain model can hold extra user-defined properties. This includes, but is not limited to, projects, tasks, and source sets.
  
  [.multi-language-text.lang-groovy]
  Extra properties can be added, read and set via the owning object's `ext` property. Alternatively, an `ext` block can be used to add multiple properties at once.
  
  [.multi-language-text.lang-kotlin]
  Extra properties can be added, read and set via the owning object's `extra` property. Alternatively, they can be addressed via Kotlin delegated properties using `by extra`.
  
  .Using extra properties
  ====
  include::sample[dir="snippets/tutorial/extraProperties/groovy",files="build.gradle[tags=extraProperties]"]
  include::sample[dir="snippets/tutorial/extraProperties/kotlin",files="build.gradle.kts[tags=extraProperties]"]
  
negative.code: ====
  
  [.multi-language-text.lang-groovy]
  This example adds two extra properties to the `project` object via an `ext` block. Additionally, this example adds a property named `purpose` to each source set by setting `ext.purpose` to `null`. Once added, you can read and set all of these properties just like predefined properties.
  
  [.multi-language-text.lang-kotlin]
  This example adds two extra properties to the `project` object via `by extra`. Additionally, this example adds a property named `purpose` to each source set by setting `extra["purpose"]` to `null`. Once added, you can read and set all of these properties via `extra`.
  
  Gradle requires special syntax for adding a property so it can fail fast. For example, this allows Gradle to recognize
  when a script attempts to set a property that does not exist. You can access extra properties anywhere where you can
  access their owning object. This gives extra properties a wider scope than local variables.
  Subprojects can access extra properties on their parent projects.
  
  For more information about extra properties, see
  link:{groovyDslPath}/org.gradle.api.plugins.ExtraPropertiesExtension.html[ExtraPropertiesExtension] in the API documentation.
  
  [[sec:configuring_arbitrary_objects]]
  == Configure Arbitrary Objects
  
  Configure arbitrary objects with `configure()`:
  
  .Configure arbitrary objects
  ====
  include::sample[dir="snippets/tutorial/configureObject/groovy",files="build.gradle[]"]
  include::sample[dir="snippets/tutorial/configureObject/kotlin",files="build.gradle.kts[]"]
  