Junior — Middle
What commands or instructions in Gradle can be used to set dependencies between different modules of a project?
sobes.tech AI
Answer from AI
In Gradle, the following constructs are used to define relationships between project modules:
- In the
settings.gradlefile, project modules are specified usinginclude:
include ':app', ':library'
- In the
build.gradleof a module that depends on another, a dependency is added viaimplementation project(':library'):
dependencies {
implementation project(':library')
}
This allows the app module to use code from the library module. Thus, the relationship between modules is established through specifying dependencies in dependencies and registering modules in settings.gradle.