Gradle Project Coordinates, State and Configured Properties: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:
The project name can be obtained programmatically with [https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#getName-- Project.getName()] or with the <code>name</code> DSL variable:
The project name can be obtained programmatically with [https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#getName-- Project.getName()] or with the <code>name</code> DSL variable:
<syntaxhighlight lang='groovy'>
<syntaxhighlight lang='groovy'>
println "${name}"
println project.name
println project.name
</syntaxhighlight>
</syntaxhighlight>

Revision as of 01:14, 4 October 2020

Internal

Overview

The project coordinates such as name, group, version, description and path can be read from build.gradle as values of DSL variables. Some of the coordinates, such as group, version and description can also be set. The coordinates are also available programmatically via the Project API.

Coordinates

Name

The project name can be obtained programmatically with Project.getName() or with the name DSL variable:

println "${name}"
println project.name

Group

Version

Description

Path

Project Directory