-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
49 lines (40 loc) · 1.35 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import com.nkuppan.weatherapp.buildsrc.Libs
buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21")
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.4.2")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.41")
}
}
val kotlinLint: Configuration by configurations.creating
dependencies {
kotlinLint(Libs.ktlint) {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
}
}
val outputDir = "${project.buildDir}/reports/ktlint/"
val inputFiles = project.fileTree(mapOf("dir" to "src", "include" to "**/*.kt"))
val kotlinLintCheck by tasks.creating(JavaExec::class) {
inputs.files(inputFiles)
outputs.dir(outputDir)
description = "Check Kotlin code style."
classpath = kotlinLint
mainClass.set("com.pinterest.ktlint.Main")
args = listOf("src/**/*.kt")
}
val kotlinLintFormat by tasks.creating(JavaExec::class) {
inputs.files(inputFiles)
outputs.dir(outputDir)
description = "Fix Kotlin code style deviations."
classpath = kotlinLint
mainClass.set("com.pinterest.ktlint.Main")
args = listOf("-F", "src/**/*.kt")
}