How to configure Gradle: the Ultimate guide
['Serhii Hryshyn']
ProAndroidDev - Medium
How to configure Gradle: the Ultimate guide 🚀 Serhii Hryshyn 12 min read · 3 days ago 3 days ago -- Listen ShareI recently finished migrating my Gradle scripts from Groovy to Kotlin DSL on my current project.
In this article, I will consider my case — migrating an existing project from Gradle 7+ to a newer version with Gradle Kotlin DSL, Android Kotlin Plugin, Version Catalog, and KSP.
The next step is, in fact, the Gradle version.
So, we have the versions of all the necessary components: Android Studio, AGP, Gradle, Kotlin.
Here is an example of my build.gradle.kts :import org.jetbrains.kotlin.gradle.tasks.KotlinCompileplugins {alias(libs.plugins.android.application.gradle.plugin) apply falsealias(libs.plugins.android.library.gradle.plugin) apply falsealias(libs.plugins.kotlin.android.gradle.plugin) apply falsealias(libs.plugins.kotlin.parcelize.gradle.plugin) apply falsealias(libs.plugins.crashlytics.gradle.plugin) apply falsealias(libs.plugins.google.gms.services.gradle.plugin) apply falsealias(libs.plugins.ksp.devtools.gradle.plugin) apply falsealias(libs.plugins.compose.compiler.gradle.plugin) apply falsealias(libs.plugins.dagger.hilt.gradle.plugin) apply false}buildscript {repositories {maven("https://aws-mobile-sdk.s3.amazonaws.com/android")}dependencies {classpath("com.amazonaws:aws-android-sdk-appsync-gradle-plugin:3.4.0")}}subprojects {tasks.withType<KotlinCompile>().configureEach {kotlinOptions {jvmTarget = JavaVersion.VERSION_17.toString()/// this is just an example of compiler args.