an officially supported language on Android (2017) • Android development is Kotlin-first (2019) Kotlin in Android 3 https://android-developers.googleblog.com/2022/08/celebrating-5-years-of-kotlin-on-android.html $FMFCSBUJOHZFBSTPG,PUMJOPO"OESPJE
default language for build scripts has been switch to Kotlin!! Kotlin is the single default language used for all project code Switch the default language 8 ,PUMJO%4-JT/PXUIF%FGBVMUGPS/FX(SBEMF#VJMET IUUQTBOESPJEEFWFMPQFSTHPPHMFCMPHDPNLPUMJOETMJTOPXEFGBVMUGPSOFXHSBEMFCVJMETIUNM
2. Better IDE experience 3. Simplified, declarative plugin syntax 4. A growing community of Kotlin developers Benefits of choosing the Kotlin DLS over Groovy DSL 9
a dynamic language while Kotlin is a statically typed • Build script errors might occur at compile time rather than at runtime • With dynamic type checking, errors are not detected until the build script is executed • Working in an IDE, an editor can highlight the errors Compile-time checking 10
apply Gradle plugins to a project, you need to specify only the plugin ID • If you try to apply a plugin that doesnʼt exist, the IDE will show you a syntax error Simplified, declarative plugin syntax 12 (SPPWZ%4- ,PUMJO%4-
in one central location and share dependencies across modules or projects • While using Version Catalogs is optional, they pair great with the Kotlin DSL by providing ore type safety in your build definitions Gradle Version Catalogs 15
compiler • Switch the default language for build scripts to Kotlin • Benefits of choosing the Kotlin DSL over Groovy DSL • Gradle Version Catalogs • KSP Summary 19