used for a long time • Tons of examples • DSL support Cons • Need to learn new language • Manual version management • No code completion • No type safety
Rename file extensions build.gradle jadi build.gradle.kts • Add = to assignment calls minSdk 24 jadi minSdk = 24 • Prefix boolean properties with is minifyEnabled true jadi isMinifyEnabled = true • Add parentheses to method calls include ':app' jadi include(":app") • Convert strings testImplementation 'junit:junit:4.13.2' jadi testImplementation("junit:junit:4.13.2")
• DSL support • No need to learn new language (one language for all!) • Code completion • Access to documentation • Can be mixed with Groovy DSL Cons • Minim of examples • Tend to be slower
Pros • Code completion • Type safety • IDE Support for navigation Cons • Non trivial setup • Frequent cache loss (version update clear the cache) • No warning for dependency update
• Code completion • Type safety • No cache loss • Best practices and easy to setup • Android Studio support • 1 line implementation via bundles • Auto dependency update • Publish catalog to other project!
centralizing dependency version and avoiding bug 2. Gradle Version Catalog is the future of dependency management for Android 3. We can automate dependency version update using Dependabot easily Summary
catalog and convention plugins - DevFest Triveneto 2022 • Groovy for Java Developers • Android Developers Blog: Kotlin DSL is Now the Default for New Gradle Builds • Migrate your build configuration from Groovy to Kotlin | Android Studio • Dependency Management with buildSrc and Kotlin DSL | Medium • Streamline Android App Dependencies with buildSrc • Efficient Dependency Management in Android with TOML and Kotlin DSL. | by appstronaut | Medium • Migrate your Android Build from Groovy to Version Catalog. | by Harny Otuoniyo | Mobimeo Technology | Medium • Manage Dependencies/Plugins in a Scalable way with Version Catalog - Easy Guide • Configuration options for the dependabot.yml file - GitHub Docs • Automate dependency updates in Gradle projects with Dependabot | by Volodymyr Buberenko | ProAndroidDev • How to use Dependabot with Gradle’s Version Catalog | Medium • Automating dependency updates in a Compose project | by Jose Alcérreca | Android Developers | Medium