diff --git a/build.gradle.kts b/build.gradle.kts index 6a61282..ad8b05e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,4 +4,21 @@ plugins { alias(libs.plugins.androidApplication) apply false alias(libs.plugins.androidLibrary) apply false alias(libs.plugins.composeCompiler) apply false -} \ No newline at end of file + alias(libs.plugins.spotless) +} + +spotless { + kotlin { + target("src/**/*.kt") + targetExclude("${layout.buildDirectory}/**/*.kt") + ktlint() + trimTrailingWhitespace() + endWithNewline() + } + kotlinGradle { + target("*.gradle.kts") + ktlint() + trimTrailingWhitespace() + endWithNewline() + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1b8183c..270d9a3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,6 @@ [versions] agp = "9.2.1" +spotless = "8.5.1" android-compileSdk = "37" android-minSdk = "24" android-targetSdk = "37" @@ -47,3 +48,4 @@ androidLibrary = { id = "com.android.library", version.ref = "agp" } composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } androidTest = { id = "com.android.test", version.ref = "agp" } kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } diff --git a/settings.gradle.kts b/settings.gradle.kts index a0677c0..dac493e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -30,4 +30,4 @@ dependencyResolutionManagement { include(":core") include(":app") -include(":macrobenchmark") \ No newline at end of file +include(":macrobenchmark")