Build.gradle: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 21: Line 21:
==Local Variables==
==Local Variables==


Declared with the "def" keyword.
Local variables, which are a feature of the underlying Groovy language, are declared with the "def" keyword. They are only visible in the scope where they have been declared.


<syntaxhighlight lang='groovy'>
<syntaxhighlight lang='groovy'>

Revision as of 00:27, 1 May 2018

External

Internal

Overview

The project-level configuration script that contains task configuration for the current project, written in the Gradle's DSL. The build script can contain any Groovy language element. May contain the following:

Variables

There are two kinds of variables that can be declared in a build script: local variables and extra properties:

Local Variables

Local variables, which are a feature of the underlying Groovy language, are declared with the "def" keyword. They are only visible in the scope where they have been declared.

def myVariable = "something"
...
println myVariable

Extra Properties