Gradle Object Instance: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 19: Line 19:
<syntaxhighlight lang='groovy'>
<syntaxhighlight lang='groovy'>
println "contains someTask? " + gradle.startParameter.taskNames.contains('someTask')
println "contains someTask? " + gradle.startParameter.taskNames.contains('someTask')
</syntaxhighlight>
=Gradle Version=
The version of the Gradle runtime executing the build can be obtained from the Gradle object:
<syntaxhighlight lang='groovy'>
gradle.gradleVersion
</syntaxhighlight>
</syntaxhighlight>

Revision as of 13:02, 6 January 2019

External

Internal

Overview

TaskExecutionGraph

StartParameter

https://docs.gradle.org/current/javadoc/org/gradle/StartParameter.html

The StartParameter instance provides access to parsed command line arguments:

println "contains someTask? " + gradle.startParameter.taskNames.contains('someTask')

Gradle Version

The version of the Gradle runtime executing the build can be obtained from the Gradle object:

gradle.gradleVersion