0Pricing
Kotlin Academy · Lesson

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 consumers
  • api — also exposed to consumers
  • testImplementation — 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

  1. Gradle Kotlin DSL
  2. Dependencies and Plugins
  3. Custom Tasks
  4. Version Catalogs
← Back to Kotlin Academy