build.gradle.kts, Android Studio에서 기본으로 채택

Android/팁 · 2023. 4. 25. 04:32
반응형

https://blog.gradle.org/kotlin-dsl-is-now-the-default-for-new-gradle-builds

 

Kotlin DSL is Now the Default for New Gradle Builds

Kotlin DSL is Now the Default for New Gradle Builds Calendar April 13, 2023 Kotlin DSL for Gradle was introduced in version 3.0 of the Gradle Build Tool in August 2016 and released as 1.0 in Gradle 5.0. Since then, it’s been growing in popularity and has

blog.gradle.org

 

며칠 전, Gradle이 기본 언어로 Kotlin DSL을 채택했다. 물론 기존 Groovy 사용자를 위해 강제하지는 않겠다고 한다. 

 

이에 따라 Android Studio도 프로젝트를 생성할 때 Build Config Language를 Kotlin DSL로 선택할 수 있는 항목이 나타난다.

(Flamingo로 업데이트해야 됨)

 

Android Studio에서 Kotlin DSL 선택

 

 

Kotlin DSL을 사용하면 확실히 장점이 있다.

 

1. 문법 오류 체크

2. Kotlin을 활용하여 라이브러리 버전 관리 (특히 멀티 모듈 => toml 대신 Kotlin DSL 사용)

3. Kotlin 내장 함수를 사용하여 더욱 자연스러운 코드 작성 가능

 

그러나 기존 Groovy에 비해 속도가 좀 느리긴 하지만, Kotlin 언어로 통합되어 하나의 언어로만 개발할 수 있게 된다.

 

개인적으로 Kotlin DSL은 잘 사용하고 있는 부분이었기에 적극 환영하는 바이다.

 

더욱 자세한 내용은 아래 링크를 확인

 

https://android-developers.googleblog.com/2023/04/kotlin-dsl-is-now-default-for-new-gradle-builds.html

 

Kotlin DSL is Now the Default for New Gradle Builds

Today we're excited to announce that we're switching the default language for build scripts to Kotlin! We've been working with the Gradle and JetBrain

android-developers.googleblog.com

 
 
 
 
반응형

 

반응형