Qiitaã«æ¸ãã»ã©ã¡ããã¨ããç¥è¦ã«åºæ¥ãªãã£ãã®ã§ãã£ã¡ã«æ¸ãã
ä»äºã§ãã£ã¦ãããã¸ã§ã¯ããgradle.ktsåããã¦ã¦ããããããã¯ã·ã§ã³ã¬ãã£ãªã®ãã¼ã¨æã£ã¦æå ã§ã試ãã¦ã¿ããã¨ããããããããã£ãã
build.gradle.ktsへの書き換えとハマリポイント part 1 - Qiita
ãã¡ãã®ã¨ã³ããªãªã©ãè¦ãã¨ä»¥åã¯settings.gradleã«pluginManagementãæ¸ãããããå¿ è¦ããã£ãã¿ããã ãã©ãæè¿ã®æ å ±ãè¦ãã¨åç´ã«build.gradleãã¡ã¤ã«ãktsã«ãªãã¬ã¼ã¹ããã ãã§å®äºããã£ã½ãäºãæ¸ããã¦ããã
Migrating Android App to Gradle Kotlin DSL 1.0 – ProAndroidDev
Multi-flavoured Kotlin DSL build script for Android App
ããã§å®éã«æå
ã®ããã¸ã§ã¯ãã§è©¦ãã¦ã¿ãããã©ãããã¾ããããªãã£ãã
app/build.gradle.ktsã§pluginsãèªã¿è¾¼ã¾ããã«android {}é
ä¸ãªã©ããã¹ã¦ã¨ã©ã¼ã«ãªã£ãããããã¸ã§ã¯ããèªã¿è¾¼ã¿ç´ãããããããgradleããã¸ã§ã¯ãã¨ãã¦èªã¿è¾¼ã¾ããªããªã£ãã...ã
ãããã試è¡é¯èª¤ãã¦åå ãæ¢ã£ããã©åãããªãã£ãã®ã§ãã¨ããããGitHubããgradle/kotlin-dslãcloneãã¦ãã¦ãã®ä¸ã«ããhello-androidã¨ããæå°ãµã³ãã«ã£ã½ããã®ãAndroid Studioã§éãã¦ã¿ããããããgradleããã¸ã§ã¯ãã¨ãã¦èªèãããªãã¦ã¨ã©ã¼ã«ãªã£ã¦ãã¾ã£ãã
kotlin-dsl/samples/hello-android at master · gradle/kotlin-dsl · GitHub
ããã¯æå ã®ç°å¢ã«ãªã«ãåé¡ãããã«éããªãã¨æãè²ã 試è¡é¯èª¤ããçµæããã·ã³ã«å¤ããã¼ã¸ã§ã³ã®Gradleãã¤ã³ã¹ãã¼ã«ããã¦ãããã¨ã«æ°ãä»ãããããgradlewã®ä»£ããã«èªã¿è¾¼ã¾ãããªã©ã®æªãããã¦ãããããããªãã¨æããã¢ã³ã¤ã³ã¹ãã¼ã«ãã¦ã¿ãã
ããã¦.gradleã¨.ideaãåé¤ãããã¸ã§ã¯ããéãç´ãã¨ãä¸è¨ã®ãµã³ãã«ããã¸ã§ã¯ãã¯ç¡äºã«èªã¿è¾¼ã¿ã«æåããã«ããããã¨ãåºæ¥ãããã«ãªã£ãã
ããã§ä¸ä»¶è½çï¼ãã¨æããæå ã®èªåã®ããã¸ã§ã¯ããèªã¿è¾¼ããã¨ãããããã¯ãgradleããã¸ã§ã¯ãã¨ãã¦èªèãããã¨ã©ã¼ãåºã¦ãã¾ã£ãã
ããã¦åå ãå ¨ç¶åãããªãã¾ã¾ä½åº¦ãä½åº¦ã.ideaã.gradleãåé¤ãã¦ããã¸ã§ã¯ããéãç´ããããã¦ããããçªå¦èªã¿è¾¼ã¿ã«æåãããã«ãã§ããããã«ãªã£ãã
çµå±ã®ã¨ããä½ãåå ã ã£ãã®ãã¯ããåããããããã¨ãã£ãç¥è¦ãæ®ããã¨ãåºæ¥ãã«å¤§éã®æéã溶ããã¦çµãã£ãã®ã ã£ã...ã
ã¨ãã話ãæããã®ã§æ¸ããªãã£ã次第ã§ãã
ä½ãã®åèã«ãªããããããªãã®ã§ããªãã¬ã¼ã¹ããæã®ã³ããããã°ãç½®ãã¦ããã¾ããã
replace gradle files to kts · kirimin/WhoOnGitHub@e3e7154 · GitHub