-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
86 lines (69 loc) · 2.47 KB
/
build.gradle.kts
File metadata and controls
86 lines (69 loc) · 2.47 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
val kotlinVersion = "1.5.10"
classpath("com.android.tools.build:gradle:7.4.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.40.1")
val navVersion = "2.4.1"
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$navVersion")
classpath(kotlin("gradle-plugin", version = kotlinVersion))
classpath(kotlin("serialization", version = kotlinVersion))
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle.kts files
}
}
task<Delete>("clean") {
delete(rootProject.buildDir)
}
subprojects {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
}
}
allprojects {
repositories {
google()
mavenCentral()
maven("https://androidx.dev/snapshots/builds/7957905/artifacts/repository")
}
val ktlint by configurations.creating
dependencies {
ktlint("com.pinterest:ktlint:0.44.0") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
}
}
val outputDir = "${buildDir}/reports/ktlint/"
val inputFiles = project.fileTree(mapOf("dir" to "src", "include" to "**/*.kt"))
val ktlintCheck by tasks.creating(JavaExec::class) {
inputs.files(inputFiles)
outputs.dir(outputDir)
description = "Check Kotlin code style."
classpath = ktlint
main = "com.pinterest.ktlint.Main"
args = listOf("src/**/*.kt")
}
val ktlintFormat by tasks.creating(JavaExec::class) {
inputs.files(inputFiles)
outputs.dir(outputDir)
description = "Fix Kotlin code style deviations."
classpath = ktlint
main = "com.pinterest.ktlint.Main"
args = listOf("-F", "src/**/*.kt")
}
}
val projectDependencyGraph by tasks.registering(ProjectDependencyGraphTask::class) {
doLast {
copy {
from(rootProject.buildDir.resolve("reports/dependency-graph/project.dot.png"))
into(rootProject.projectDir)
}
}
}