expand

abstract fun expand(properties: Map<String, out Any>): ContentFilterable(source)

Expands property references in each file as it is copied. More specifically, each file is transformed using Groovy's groovy.text.SimpleTemplateEngine. This means you can use simple property references, such as $property or ${property} in the file. You can also include arbitrary Groovy code in the file, such as ${version ?: 'unknown'} or ${classpath*.name.join(' ')}

Note that all escape sequences (\n, \t, \\, etc) are converted to the symbols they represent, so, for example, \n becomes newline. If this is undesirable then expand should be used to disable this behavior.

Return

this

Parameters

properties

reference-to-value map for substitution


abstract fun expand(properties: Map<String, out Any>, action: Action<in ExpandDetails>): ContentFilterable(source)

Expands property references in each file as it is copied. More specifically, each file is transformed using Groovy's groovy.text.SimpleTemplateEngine. This means you can use simple property references, such as $property or ${property} in the file. You can also include arbitrary Groovy code in the file, such as ${version ?: 'unknown'} or ${classpath*.name.join(' ')}. The template engine can be configured with the provided action.

Note that by default all escape sequences (\n, \t, \\, etc) are converted to the symbols they represent, so, for example, \n becomes newline. This behavior is controlled by getEscapeBackslash property. It should be set to true to disable escape sequences conversion:

 expand(one: '1', two: 2) {
     escapeBackslash = true
 }

Return

this

Since

7.2

Parameters

properties

reference-to-value map for substitution

action

action to perform additional configuration of the underlying template engine