Gradle Programming TODEPLETE: Difference between revisions
Jump to navigation
Jump to search
(→Groovy) |
|||
Line 9: | Line 9: | ||
=Inter-Project "Communication"= | =Inter-Project "Communication"= | ||
The Project is the main API to use to interact with Gradle, so a great deal of custom configuration can be achieved getting a hold of a project reference and reading state from it or invoking into it from the build.gradle files. | The [[Gradle Concepts#Project|Project]] is the main API to use to interact with Gradle, so a great deal of custom configuration can be achieved getting a hold of a project reference and reading state from it or invoking into it from the build.gradle files. | ||
The reference to the current project can be obtained by using getProject() in the corresponding build.gradle file, which is equivalent with invoking 'project' | The reference to the current project can be obtained by using getProject() in the corresponding build.gradle file, which is equivalent with invoking 'project' |
Revision as of 06:36, 24 February 2019
Internal
Groovy
Inter-Project "Communication"
The Project is the main API to use to interact with Gradle, so a great deal of custom configuration can be achieved getting a hold of a project reference and reading state from it or invoking into it from the build.gradle files.
The reference to the current project can be obtained by using getProject() in the corresponding build.gradle file, which is equivalent with invoking 'project'
println project
For all projects in the hierarchy, the reference to the root project can be obtained by invoking "project.getRootProject()", or simply 'rootProject'.
println rootProject
For a sub-project, a reference to the parent project can be obtained by invoking "project.getParent()", or simply 'parent'.
println parent