forked from wangerekaharun/GradleBuildPlugins
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
59 lines (50 loc) · 1.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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id(BuildPlugins.ktlintPlugin) version Versions.ktlint
id(BuildPlugins.detektPlugin) version Versions.detekt
id(BuildPlugins.spotlessPlugin) version Versions.spotless
id(BuildPlugins.androidLibrary) apply false
id(BuildPlugins.androidApplication) apply false
id(BuildPlugins.kotlinAndroid) apply false
id(BuildPlugins.dokkaPlugin) version Versions.dokka
id(BuildPlugins.gradleVersionsPlugin) version Versions.gradleVersionsPlugin
}
allprojects {
repositories {
google()
mavenCentral()
maven(url = "https://jitpack.io")
}
apply(plugin = BuildPlugins.dokkaPlugin)
apply(plugin = BuildPlugins.ktlintPlugin)
ktlint {
android.set(true)
verbose.set(true)
filter {
exclude { element -> element.file.path.contains("generated/") }
}
}
}
buildscript {
val jacocoVersion by extra("0.2")
dependencies {
classpath("com.hiya:jacoco-android:$jacocoVersion")
}
}
subprojects {
apply(plugin = BuildPlugins.detektPlugin)
detekt {
config = files("${project.rootDir}/detekt.yml")
parallel = true
}
apply(plugin = BuildPlugins.spotlessPlugin)
spotless {
kotlin {
target("**/*.kt")
licenseHeaderFile(
rootProject.file("${project.rootDir}/spotless/copyright.kt"),
"^(package|object|import|interface)"
)
}
}
}