forked from UseHover/Stax
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
71 lines (66 loc) · 2.53 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@file:Suppress("DSL_SCOPE_VIOLATION")
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "7.3.1" apply false
id("com.android.library") version "7.3.1" apply false
id("org.jetbrains.kotlin.android") version "1.7.10" apply false
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"
id("io.gitlab.arturbosch.detekt") version "1.22.0"
id("com.diffplug.spotless") version "6.11.0"
id("org.jetbrains.dokka") version "1.7.20"
kotlin("plugin.serialization") version "1.6.21"
alias(libs.plugins.hilt) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.org.jetbrains.kotlin.jvm) apply false
}
buildscript {
dependencies {
classpath("com.google.gms:google-services:4.3.14")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
classpath("com.google.firebase:perf-plugin:1.4.2")
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.4.2")
}
}
allprojects {
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
ktlint {
android.set(true)
verbose.set(true)
filter {
exclude { element -> element.file.path.contains("generated/") }
}
}
}
subprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
detekt {
config = files("${project.rootDir}/detekt.yml")
parallel = true
buildUponDefaultConfig = true
}
apply(plugin = "com.diffplug.spotless")
spotless {
kotlin {
target("**/*.kt")
targetExclude("${project.rootDir}/build-logic/**/*.kt")
licenseHeaderFile(
rootProject.file("${project.rootDir}/spotless/copyright.kt"),
"^(package|object|import|interface)"
)
}
format("kts") {
target("**/*.kts")
targetExclude("**/build/**/*.kts")
// Look for the first line that doesn't have a block comment (assumed to be the license)
licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
}
format("xml") {
target("**/*.xml")
targetExclude("**/build/**/*.xml")
// Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml)
licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])")
}
}
}