Dependencies and Plugins
Configure the build.
Dependency Configurations
Gradle groups dependencies by configuration, which controls when and where they are available:
implementation— compile and runtime, not exposed to consumersapi— also exposed to consumerstestImplementation— only for tests
implementation vs api
implementation hides a dependency from modules that depend on yours, improving build performance and encapsulation. Use api only when the dependency appears in your public types.
dependencies {
api("com.squareup.okio:okio:3.9.0") // leaks into public API
implementation("com.google.code.gson:gson:2.11.0") // internal only
}All lessons in this course
- Gradle Kotlin DSL
- Dependencies and Plugins
- Custom Tasks
- Version Catalogs