{"id":45140,"date":"2021-06-02T20:35:15","date_gmt":"2021-06-02T11:35:15","guid":{"rendered":"https:\/\/www.charlezz.com\/?p=45140"},"modified":"2021-06-02T20:35:15","modified_gmt":"2021-06-02T11:35:15","slug":"gradle-%ec%8a%a4%ed%81%ac%eb%a6%bd%ed%8a%b8-%ec%96%b8%ec%96%b4%eb%a5%bc-groovy-dsl%ec%97%90%ec%84%9c-kotlin-dsl%eb%a1%9c-%eb%b3%80%ea%b2%bd-%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/charlezz.com\/?p=45140","title":{"rendered":"Gradle \uc2a4\ud06c\ub9bd\ud2b8 \uc5b8\uc5b4\ub97c Groovy DSL\uc5d0\uc11c Kotlin DSL\ub85c \ubcc0\uacbd \ud558\uae30"},"content":{"rendered":"<h1>Migrating Groovy DSL to Kotlin DSL<\/h1>\n<h2>Kotlin DSL \uc774\ub780?<\/h2>\n<p>DSL\uc774\ub780 Domain Specific Language\uc758 \uc57d\uc5b4\ub85c \ud2b9\uc815 \ubd84\uc57c\uc5d0 \ucd5c\uc801\ud654\ub41c \ud504\ub85c\uadf8\ub798\ubc0d \uc5b8\uc5b4\ub97c \ub73b\ud55c\ub2e4. \uc0c1\uc6a9\uad6c \ucf54\ub4dc\ub97c \ucd5c\uc18c\ud654 \ud558\uae30 \uc704\ud574 \uba85\ub839\ud615 \ucf54\ub4dc \ub300\uc2e0 \uc120\uc5b8\uc801 \ucf54\ub4dc \ud615\uc2dd\uc744 \ub530\ub978\ub2e4.<br \/>\nKotlin DSL\uc740 \ucf54\ud2c0\ub9b0\uc758 \uc5b8\uc5b4\uc801\uc778 \ud2b9\uc9d5\uc73c\ub85c \uac00\ub3c5\uc131\uc774 \uc88b\uace0 \uac04\ub7b5\ud55c \ucf54\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec Gradle \uc2a4\ud06c\ub9bd\ud305\uc744 \ud558\ub294 \uac83\uc744 \ubaa9\uc801\uc73c\ub85c \ud558\ub294 DSL\uc774\ub2e4.<\/p>\n<p>\ube4c\ub4dc \uc2a4\ud06c\ub9bd\ud2b8\uc5d0\uc11c \uc0ac\uc6a9\ud558\ub294 \uac1d\uccb4, \ud568\uc218, \uc18d\uc131\ub4e4\uc740 Gradle API\uc640 \uc801\uc6a9\ud55c plugin API\uc5d0\uc11c \uac00\uc838\uc628\ub2e4.<\/p>\n<h2>\uc65c Kotlin DSL\uc744 \uc0ac\uc6a9\ud574\uc57c \ud558\uc9c0?<\/h2>\n<p>\uc65c \uad73\uc774 Groovy DSL \uc5d0\uc11c Kotlin DSL\ub85c \ubcc0\uacbd\ud574\uc57c \ud558\ub294\uc9c0 \uc758\ubb38\uc774 \uc0dd\uae38 \uc218 \uc788\ub2e4. Kotlin DSL\ub85c \ubcc0\uacbd\ud558\uba74 \ub2e4\uc74c\uacfc \uac19\uc740 \uc7a5\uc810\uc774 \uc0dd\uae34\ub2e4.<\/p>\n<ul>\n<li><strong>\ucef4\ud30c\uc77c \ud0c0\uc784\uc5d0 \uc5d0\ub7ec \ud655\uc778<\/strong><\/li>\n<li><strong>\ucf54\ub4dc \ud0d0\uc0c9<\/strong><\/li>\n<li><strong>\uc790\ub3d9 \uc644\uc131<\/strong><\/li>\n<li><strong>\uad6c\ubb38 \uac15\uc870<\/strong><\/li>\n<li><strong>IDE\uc758 \uc9c0\uc6d0\uc73c\ub85c \ud5a5\uc0c1\ub41c \ud3b8\uc9d1\ud658\uacbd<\/strong><\/li>\n<li><strong>\uc18c\uc2a4\ucf54\ub4dc\uc640 \ub3d9\uc77c\ud55c \uc5b8\uc5b4\uc758 \uc0ac\uc6a9<\/strong><\/li>\n<\/ul>\n<p>\ubc18\uba74 \ub2e8\uc810\ub3c4 \uc874\uc7ac\ud55c\ub2e4.\u00a0<\/p>\n<ul>\n<li>\ube4c\ub4dc \uce90\uc2dc\uac00 Invalidation \ub418\uac70\ub098 \ud074\ub9b0 \ube4c\ub4dc\uc2dc\uc5d0 Groovy DSL\ubcf4\ub2e4 \ub290\ub9ac\ub2e4.<\/li>\n<li>Java8\uc774\uc0c1\uc5d0\uc11c \ub3d9\uc791<\/li>\n<li>\uc0c8\ub85c\uc6b4 \ub77c\uc774\ube0c\ub7ec\ub9ac \ubc84\uc804 Inspection \uae30\ub2a5 \ubbf8\uc9c0\uc6d0<\/li>\n<\/ul>\n<p>\ub290\ub824\uc9c0\ub294 \ubd80\ubd84\uc774 \uac00\uc7a5 \ubf08 \uc544\ud508 \ubd80\ubd84\uc774\uc9c0\ub9cc, Kotlin DSL\uc774 \uac00\uc9c0\ub294 \uc7a5\uc810\uc744 \ubb34\uc2dc\ud558\uae34 \uc5b4\ub835\ub2e4. \uc544\ub798\uc758 <a href=\"https:\/\/github.com\/gradle\/gradle\/issues\/15886\">\ud45c<\/a>\ub97c \ucc38\uace0\ud558\uc5ec, \uac01\uc790\uc758 \uc0c1\ud669\uacfc \uc911\uc694\uc2dc \ud558\ub294 \ubd80\ubd84\uc5d0 \ub300\ud55c \uac00\uce58\ub97c \uace0\ubbfc\ud558\uace0 \ub9c8\uc774\uadf8\ub808\uc774\uc158 \ud558\ub294 \uac83\uc744 \ucd94\ucc9c\ud55c\ub2e4.<\/p>\n<p><a href=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-5.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-5-1024x317.png\" alt=\"\" width=\"750\" height=\"232\" class=\"alignnone size-large wp-image-45141\" srcset=\"https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-5-1024x317.png 1024w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-5-300x93.png 300w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-5-768x238.png 768w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-5.png 1136w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/p>\n<h2>Kotlin DSL \uc0ac\uc6a9\ud558\uae30<\/h2>\n<p>Gradle \uc2a4\ud06c\ub9bd\ud2b8\ub97c Kotlin DSL\uc744 \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc740 \uac04\ub2e8\ud558\ub2e4. \uae30\uc874 *.gradle \ud30c\uc77c\uc744 *.gradle<strong>.kts <\/strong>\ub85c \ubcc0\uacbd\ud558\uba74 \ub41c\ub2e4.<\/p>\n<pre class=\"\">\uc608) build.gradle -&gt; build.gradle.kts<\/pre>\n<pre class=\"\"><em>Note:Kotlin DSL\uc5d0\uc11c\ub294 \ub2f9\uc5f0\ud788 \ucf54\ud2c0\ub9b0 \ubb38\ubc95\uc744 \ub530\ub974\ubbc0\ub85c \uae30\ubcf8\uc801\uc73c\ub85c \ubb38\uc790\uc5f4\uc740 \ubaa8\ub450 \ub530\uc634\ud45c (\" \") \ub85c \ubb36\uc5b4 \ud45c\ud604\ud55c\ub2e4.<\/em><\/pre>\n<p>\uc790\uc138\ud55c \ub0b4\uc6a9\uc740 \ub2e4\uc74c\uc758 \ubb38\uc11c\ub97c \ucc38\uace0\ud558\uc790.<\/p>\n<ul style=\"list-style-type: square;\">\n<li>\uad6c\uae00\uc758 <a href=\"https:\/\/developer.android.com\/studio\/build\/gradle-tips\">\uac00\uc774\ub4dc \ubb38\uc11c<\/a><\/li>\n<li>Gradle\uc758 <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/kotlin_dsl.html\">\uacf5\uc2dd \ubb38\uc11c<\/a><\/li>\n<\/ul>\n<p>\uae30\ubcf8\uc801\uc73c\ub85c \uc790\uc8fc \ubcc0\uacbd\ud558\ub294 \ubd80\ubd84\uc5d0 \ub300\ud55c \uc608\uc81c\ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><strong>\ud50c\ub7ec\uadf8\uc778 \ube14\ub7ed<\/strong><\/p>\n<pre class=\"lang: decode:true\">\/\/ Groovy DSL \r\nplugins {\r\n    id 'com.android.application'\r\n    id 'kotlin-android'\r\n    id 'kotlin-kapt'\r\n}<\/pre>\n<pre class=\"lang:null decode:true lang:\">plugins {\r\n    id(\"com.android.application\")\r\n    kotlin(\"android\")\r\n    kotlin(\"kapt\")\r\n\/\/    id (\"kotlin-android\") \uc704\uc758 \ucf54\ub4dc\uc640 \ub3d9\uc77c\ud55c \ub0b4\uc6a9\r\n\/\/    id (\"kotlin-kapt\") \uc704\uc758 \ucf54\ub4dc\uc640 \ub3d9\uc77c\ud55c \ub0b4\uc6a9\r\n}<\/pre>\n<pre class=\"\"><em>Note : Gradle \uacf5\uc2dd \ubb38\uc11c\ub97c \ubcf4\uba74 \ud50c\ub7ec\uadf8\uc778 {} \ube14\ub85d\uc744 \uc0ac\uc6a9\ud558\uc5ec Gradle \ud50c\ub7ec\uadf8\uc778\uc744 \uc120\uc5b8\ud558\uba74 \ud3b8\uc9d1 \ud658\uacbd\uc774 \ud06c\uac8c \ud5a5\uc0c1 \ub418\uae30 \ub584\ubb38\uc5d0 \uc801\uadf9 \uad8c\uc7a5\ud558\uace0 \uc788\ub2e4.<\/em><\/pre>\n<p><strong>android \ube14\ub7ed<\/strong><\/p>\n<pre class=\"lang: decode:true\">\/\/Groovy DSL\r\nandroid {\r\n    compileSdkVersion 30\r\n    buildToolsVersion \"30.0.2\"\r\n\r\n    defaultConfig {\r\n        applicationId \"com.charlezz.test\"\r\n        minSdkVersion 22\r\n        targetSdkVersion 30\r\n        versionCode 1\r\n        versionName \"1.0\"\r\n\r\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\r\n    }\r\n\r\n    buildTypes {\r\n        release {\r\n            minifyEnabled false\r\n            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'\r\n        }\r\n    }\r\n\r\n    buildFeatures{\r\n        dataBinding = true\r\n    }\r\n\r\n    compileOptions {\r\n        sourceCompatibility JavaVersion.VERSION_1_8\r\n        targetCompatibility JavaVersion.VERSION_1_8\r\n    }\r\n\r\n    kotlinOptions {\r\n        jvmTarget = '1.8'\r\n    }\r\n}<\/pre>\n<pre class=\"lang: decode:true\">android {\r\n    compileSdkVersion(30)\r\n    buildToolsVersion(\"30.0.2\")\r\n\r\n    defaultConfig {\r\n        applicationId(\"com.charlezz.test\")\r\n        minSdkVersion(22)\r\n        targetSdkVersion(30)\r\n        versionCode(1)\r\n        versionName(\"1.0\")\r\n\r\n        testInstrumentationRunner(\"androidx.test.runner.AndroidJUnitRunner\")\r\n    }\r\n\r\n    buildTypes {\r\n        getByName(\"release\") {\r\n            minifyEnabled(false)\r\n            proguardFiles(\r\n                getDefaultProguardFile(\"proguard-android-optimize.txt\"),\r\n                \"proguard-rules.pro\"\r\n            )\r\n        }\r\n    }\r\n   \r\n    buildFeatures.dataBinding = true\r\n\r\n    compileOptions {\r\n        sourceCompatibility(JavaVersion.VERSION_1_8)\r\n        targetCompatibility(JavaVersion.VERSION_1_8)\r\n    }\r\n\r\n    kotlinOptions {\r\n        jvmTarget = JavaVersion.VERSION_1_8.toString()\r\n    }\r\n}<\/pre>\n<p><strong>dependencis \ube14\ub85d<\/strong><\/p>\n<pre class=\"lang: decode:true \">dependencies {\r\n    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'\r\n    testImplementation 'junit:junit:4.+'\r\n    androidTestImplementation 'androidx.test.ext:junit:1.1.2'\r\n    kapt 'com.google.dagger:dagger-compiler:2.34.1'\r\n}<\/pre>\n<pre class=\"lang: decode:true \">dependencies {\r\n    implementation(\"androidx.constraintlayout:constraintlayout:2.0.4\")\r\n    testImplementation(\"junit:junit:4.+\")\r\n    androidTestImplementation(\"androidx.test.ext:junit:1.1.2\")\r\n    kapt(\"com.google.dagger:dagger-compiler:2.34.1\")\r\n}<\/pre>\n<h2>buildSrc\ub85c \ubc84\uc804\uad00\ub9ac \ud558\uae30<\/h2>\n<p>buildSrc\ub294 \ube4c\ub4dc \ub85c\uc9c1\uc744 \ud3ec\ud568\ud560 \uc218 \uc788\ub294 Gradle \ud504\ub85c\uc81d\ud2b8 \ub8e8\ud2b8 \ub514\ub809\ud1a0\ub9ac\ub2e4. buildSrc\uacfc Kotlin DSL\uc744 \uc0ac\uc6a9\ud574\uc11c \ub9e4\uc6b0 \uc801\uc740 \uad6c\uc131\uc73c\ub85c \ucee4\uc2a4\ud140 \ube4c\ub4dc \ucf54\ub4dc\ub97c \uc791\uc131\ud558\uace0 \uc804\uccb4 \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c \uc774 \ub85c\uc9c1\uc744 \uacf5\uc720 \ud560 \uc218 \uc788\ub2e4. buildSrc\ub97c \ubcc0\uacbd\ud558\uba74 \uc804\uccb4 \ud504\ub85c\uc81d\ud2b8\uc758 \ube4c\ub4dc\uce90\uc2dc\uac00 \ubb34\ud6a8\ud654\ub418\uae30 \ub54c\ubb38\uc5d0 \uc7a6\uc740 \uc218\uc815\uc744 \ud53c\ud574\uc57c \ud55c\ub2e4.<\/p>\n<p>\ud504\ub85c\uc81d\ud2b8 \uc815\ubcf4 \ub610\ub294 \ub77c\uc774\ube0c\ub7ec\ub9ac\uc758 \ubc84\uc804 \ub4f1\uc744 \uad00\ub9ac\ud574\ubcf4\ub294 \uc608\uc81c\ub97c \uc54c\uc544\ubcf4\uc790.<\/p>\n<p>\uba3c\uc800 buildSrc \ub514\ub809\ud1a0\ub9ac\ub97c \ub9cc\ub4e0\ub2e4.<\/p>\n<p><a href=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-8.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-8.png\" alt=\"\" width=\"470\" height=\"362\" class=\"alignnone size-full wp-image-45143\" srcset=\"https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-8.png 470w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-8-300x231.png 300w\" sizes=\"(max-width: 470px) 100vw, 470px\" \/><\/a><\/p>\n<p>\ub514\ub809\ud1a0\ub9ac\ub97c \ub9cc\ub4e4\uace0 \ub8e8\ud2b8\uc5d0\ub294 build.gradle.kts\uc640 \ucd94\uac00\ud558\uace0, \ud558\uc704 \ub514\ub809\ud1a0\ub9ac src\/main\/kotlin \uc5d0\ub294 Versions\ub77c\ub294 \ud074\ub798\uc2a4\ub97c \ucd94\uac00\ud55c\ub2e4.<\/p>\n<p><a href=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-9.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-9.png\" alt=\"\" width=\"428\" height=\"128\" class=\"alignnone size-full wp-image-45144\" srcset=\"https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-9.png 428w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2021\/05\/www.charlezz.com-gradle-groovy-dsl-kotlin-dsl-screenshot-9-300x90.png 300w\" sizes=\"(max-width: 428px) 100vw, 428px\" \/><\/a><\/p>\n<p>\uc774\uc81c sync Project with Gradle Files \ub97c \ub20c\ub7ec \uc124\uc815\uc744 \ub9c8\uce58\ub3c4\ub85d \ud55c\ub2e4.<\/p>\n<p>\uc704\uc758 \uc2a4\ud06c\ub9b0\uc0f7 \ucc98\ub7fc \ud504\ub85c\uc81d\ud2b8 \uacc4\uce35\uc5d0 buildSrc\uac00 \ucd94\uac00 \ub41c \uac83\uc744 \ud655\uc778\ud55c\ub2e4.<\/p>\n<p>build \uce90\uc2dc\ub294 git\uc5d0\uc11c \uad00\ub9ac\ud558\uc9c0 \uc54a\ub3c4\ub85d \ub2e4\uc74c\uc758 \ub0b4\uc6a9\uc744 .ignore\uc5d0 \ucd94\uac00\ud558\uc790.<\/p>\n<pre class=\"\">buildSrc\/build<\/pre>\n<p>\uc774\uc81c Versions\uc5d0 \ubc84\uc804\uc744 \uc815\uc758\ud558\uace0 \uc774\ub97c \ucc38\uc870\ud558\ub294 \uc608\uc81c\ub97c \uc0b4\ud3b4\ubcf4\uc790.<\/p>\n<p>\ub2e4\uc74c\uacfc \uac19\uc774 \ubc84\uc804\uba85\uc744 \uba85\uc2dc \ud55c\ub2e4.<\/p>\n<pre class=\"lang: decode:true\">object Versions {\r\n    const val kotlin = \"1.4.31\"\r\n}<\/pre>\n<p>\ubaa8\ub4c8\ub808\ubca8\uc758 build.gradle.kts\uc5d0\uc11c\ub294 \ud574\ub2f9 \ubc84\uc804\uc744 \ucc38\uc870 \ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre class=\"lang: decode:true\">dependencies {\r\n    implementation(\"org.jetbrains.kotlin:kotlin-stdlib:$kotlin\")\r\n}<\/pre>\n<p>\ub9cc\uc57d \uc758\uc874\uc131 \uc544\ud2f0\ud329\ud2b8 \ub2e8\uc704\ub85c \ubc84\uc804\uad00\ub9ac\ub97c \ud558\uace0 \uc2f6\ub2e4\uba74 \ubcc4\ub3c4\uc758 \ud074\ub798\uc2a4(\uc608: Dependencies.kt)\ub97c \ud558\ub098 \ub354 \uc0dd\uc131\ud558\uc790.<\/p>\n<pre class=\"lang: decode:true\">object Dependencies {\r\n    const val kotlinStdLib = \"org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}\"\r\n}<\/pre>\n<p>\uc774\uc81c Dependencies \uc758 \uba64\ubc84 \ucc38\uc870\ub97c \ud1b5\ud574 \uc758\uc874\uc131\uc744 \uad00\ub9ac \ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre class=\"lang: decode:true\">dependencies {\r\n    \/\/ implementation(\"org.jetbrains.kotlin:kotlin-stdlib:$kotlin\")\r\n    implementation(Dependencies.kotlinStdLib)\r\n}<\/pre>\n<h2>\ud604\uc7ac\uae4c\uc9c0\uc758 \ud2b8\ub7ec\ube14 \uc288\ud305..<\/h2>\n<h3>1.Hilt\uc774\uc288<\/h3>\n<p>\ud604\uc7ac Hilt\uac00 \ud2b9\uc815 \ud658\uacbd\uc5d0\uc11c Kotlin DSL\uacfc \ud568\uaed8 \uc0ac\uc6a9\uc2dc \ube4c\ub4dc\uac00 \uc548\ub418\ub294 \ud604\uc0c1\uc774 \uc788\ub2e4. \ucd5c\uc2e0 Gradle \ubc84\uc804\uacfc \ucd5c\uc2e0 Hilt \uc2a4\ub0c5\uc0f7\uc744 \uc0ac\uc6a9\ud558\uba74 \ube4c\ub4dc\uac00 \ub41c\ub2e4. <a href=\"https:\/\/github.com\/google\/dagger\/issues\/2634\">https:\/\/github.com\/google\/dagger\/issues\/2634<\/a><\/p>\n<h3>2. DFM\uc5d0\uc11c buildFeatures.dataBinding \uc774\uc288<\/h3>\n<p>\uc608\ub97c \ub4e4\uc5b4 dataBinding\uc744 \ud65c\uc131\ud654 \ud560 \ub54c \ub2e4\uc74c\uacfc \uac19\uc740 \ucf54\ub4dc\ub97c \uc0ac\uc6a9\ud55c\ub2e4.<\/p>\n<pre class=\"lang: decode:true\">buildFeatures.dataBinding = true<\/pre>\n<p>\ud558\uc9c0\ub9cc DFM\uc758 build.gradle.kts \uc5d0\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \uc774\uc804 \ubc29\uc2dd\uc73c\ub85c \ucf54\ub4dc\ub97c \uc791\uc131\ud574\uc57c \ud55c\ub2e4.<\/p>\n<pre class=\"lang: decode:true\">dataBinding.isEnabled = true<\/pre>\n<p>app\ubaa8\ub4c8\uc5d0\uc11c \ucc38\uc870\ud558\ub294 buildFeatures\ub294 BuildFeatures \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc0c1\uc18d\ud55c ApplicationBuildFeatures\uc774\uc9c0\ub9cc DFM\uc5d0\uc11c\ub294 \uadf8\ub0e5 BuildFeature\ub97c \ucc38\uc870\ud558\uae30 \ub54c\ubb38\uc778 \uac83\uc73c\ub85c \ubcf4\uc774\ub294\ub370, \uc774\ub97c \ud574\uacb0 \ud560 \uc218 \uc788\ub294 \ubc29\ubc95\uc744 \uc544\uc9c1 \ubabb\ucc3e\uc740 \uc0c1\ud0dc&#8230; \ucd94\ud6c4 AGP \uc5c5\ub370\uc774\ud2b8\uc5d0\uc11c \uc9c0\uc6d0\ud560 \uac83\uc73c\ub85c \uae30\ub300\ud55c\ub2e4. (\uc544\uc2dc\ub294\ubd84 \uacc4\uc2dc\uba74 \ub313\uae00\ub85c \ubd80\ud0c1\ub4dc\ub9bd\ub2c8\ub2e4)<\/p>\n<p>\uac15\uc81c\ub85c DynamicFeatureBuildFeatures\ub85c \uce90\uc2a4\ud305\ud574\uc11c \ub370\uc774\ud130\ubc14\uc778\ub529\uc744 \ud65c\uc131\ud654 \uc2dc\ud0ac\uc218\ub3c4 \uc788\uaca0\uc9c0\ub9cc, \ucd94\ucc9c\ud558\uc9c4 \uc54a\ub294\ub2e4.<\/p>\n<pre class=\"lang:null decode:true\">android {\r\n    if(buildFeatures is DynamicFeatureBuildFeatures){\r\n        (buildFeatures as DynamicFeatureBuildFeatures).dataBinding = true\r\n    }\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Migrating Groovy DSL to Kotlin DSL Kotlin DSL \uc774\ub780? DSL\uc774\ub780 Domain Specific Language\uc758 \uc57d\uc5b4\ub85c \ud2b9\uc815 \ubd84\uc57c\uc5d0 \ucd5c\uc801\ud654\ub41c \ud504\ub85c\uadf8\ub798\ubc0d \uc5b8\uc5b4\ub97c \ub73b\ud55c\ub2e4. \uc0c1\uc6a9\uad6c \ucf54\ub4dc\ub97c \ucd5c\uc18c\ud654 \ud558\uae30 \uc704\ud574 \uba85\ub839\ud615 \ucf54\ub4dc \ub300\uc2e0 \uc120\uc5b8\uc801 \ucf54\ub4dc \ud615\uc2dd\uc744 \ub530\ub978\ub2e4. Kotlin DSL\uc740 \ucf54\ud2c0\ub9b0\uc758 \uc5b8\uc5b4\uc801\uc778 \ud2b9\uc9d5\uc73c\ub85c \uac00\ub3c5\uc131\uc774 \uc88b\uace0 \uac04\ub7b5\ud55c \ucf54\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec Gradle \uc2a4\ud06c\ub9bd\ud305\uc744 \ud558\ub294 \uac83\uc744 \ubaa9\uc801\uc73c\ub85c \ud558\ub294 DSL\uc774\ub2e4. \ube4c\ub4dc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[16],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/45140"}],"collection":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=45140"}],"version-history":[{"count":4,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/45140\/revisions"}],"predecessor-version":[{"id":45147,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/45140\/revisions\/45147"}],"wp:attachment":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=45140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=45140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=45140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}