-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
101 lines (87 loc) Β· 2.88 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* DevEvent-Android Β© 2022 Ji Sungbin. all rights reserved.
* DevEvent-Android license is under the MIT.
*
* [build.gradle.kts] created by Ji Sungbin on 22. 12. 7. μ€ν 9:33
*
* Please see: https://github.com/brave-people/Dev-Event-Android/blob/master/LICENSE
*/
@file:Suppress("DSL_SCOPE_VIOLATION")
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.KtlintExtension
plugins {
alias(libs.plugins.code.ktlint)
alias(libs.plugins.code.detekt)
alias(libs.plugins.util.dependency.handler.extensions)
}
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath(libs.kotlin.core)
classpath(libs.build.gradle.agp)
classpath(libs.build.google.service)
classpath(libs.build.firebase.crashlytics)
classpath(libs.build.firebase.performance)
classpath(libs.build.ui.oss.license)
classpath(libs.build.di.hilt)
}
}
allprojects {
apply {
plugin(rootProject.libs.plugins.code.ktlint.get().pluginId)
plugin(rootProject.libs.plugins.code.detekt.get().pluginId)
plugin(rootProject.libs.plugins.util.dependency.handler.extensions.get().pluginId)
}
repositories {
google()
mavenCentral()
}
afterEvaluate {
detekt {
parallel = true
buildUponDefaultConfig = true
toolVersion = libs.versions.plugin.code.detekt.get()
config.setFrom(files("$rootDir/detekt-config.yml"))
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlin.OptIn",
"-opt-in=kotlin.RequiresOptIn",
"-Xcontext-receivers",
)
}
}
tasks.withType<Detekt>().configureEach {
exclude(project.buildDir.absolutePath)
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
exclude(project.buildDir.absolutePath)
}
}
}
subprojects {
configure<KtlintExtension> {
version.set(rootProject.libs.versions.plugin.code.ktlint.source.get())
android.set(true)
outputToConsole.set(true)
additionalEditorconfigFile.set(file("$rootDir/.editorconfig"))
}
}
tasks.register(name = "cleanAll", type = Delete::class) {
allprojects.map(Project::getBuildDir).forEach(::delete)
}
// TODO: GitHub Actions μ yml λ‘ λ³κ²½
tasks.create("moveGoogleServiceFile") {
val file = File("$rootDir/public-build-resource/google-services.json")
val target = File("$rootDir/app/google-services.json")
if (target.exists()) return@create
file.copyTo(target)
}