From 8bd3cce29428e0d6147f70c957fad277d341d753 Mon Sep 17 00:00:00 2001 From: minseonglove Date: Tue, 8 Nov 2022 19:30:10 +0900 Subject: [PATCH] =?UTF-8?q?build=20:=20ktlint=20=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EB=B8=8C=EB=9F=AC=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 39f39ef0..a3e02d90 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,6 +4,10 @@ plugins { id 'com.google.gms.google-services' } +configurations { + ktlint +} + android { namespace 'com.gta.ucmc' compileSdk 33 @@ -34,6 +38,7 @@ android { } dependencies { + ktlint 'com.pinterest:ktlint:0.47.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'com.google.android.material:material:1.7.0' @@ -45,3 +50,18 @@ dependencies { implementation platform('com.google.firebase:firebase-bom:31.0.2') implementation 'com.google.firebase:firebase-analytics-ktx' } + +task ktlint(type: JavaExec, group: "verification") { + description = "Check Kotlin code style." + mainClass.set("com.pinterest.ktlint.Main") + classpath = configurations.ktlint + args "src/**/*.kt" +} +check.dependsOn ktlint + +task ktlintFormat(type: JavaExec, group: "formatting") { + description = "Fix Kotlin code style deviations." + mainClass.set("com.pinterest.ktlint.Main") + classpath = configurations.ktlint + args "-F", "src/**/*.kt" +}