-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
101 lines (90 loc) · 3.14 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
plugins {
id("io.gitlab.arturbosch.detekt") version "1.19.0"
id("com.diffplug.spotless") version "6.3.0"
// id("nl.neotech.plugin.rootcoverage") version "1.6.0" // TODO: Fix coverage / Wait for Gradle 8 compatibility
id("org.sonarqube") version "3.5.0.2730"
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
val kotlinVersion: String by project
val daggerVersion: String by project
repositories {
google()
mavenCentral()
maven(url = "https://plugins.gradle.org/m2/")
}
dependencies {
// -- Core plugins
classpath("com.android.tools.build:gradle:8.5.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
// -- Application plugins
classpath("com.google.dagger:hilt-android-gradle-plugin:$daggerVersion")
// -- Services & Monitoring
classpath("com.google.gms:google-services:4.4.2")
classpath("com.google.firebase:firebase-crashlytics-gradle:3.0.2")
classpath("com.google.firebase:perf-plugin:1.4.2")
}
}
sonarqube {
properties {
property("sonar.projectKey", "boitakub_Bogadex")
property("sonar.organization", "boitakub")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.coverage.jacoco.xmlReportPaths", "$buildDir/reports/jacoco.xml")
}
}
// rootCoverage {
// // Class & package exclude patterns
// excludes = listOf("**/*Hilt*.**", "**/*Generated*.**")
//
// // Since 1.1 generateHtml is by default true
// generateCsv = true
// generateHtml = true
// generateXml = true
//
// // Since 1.2: Same as executeTests except that this only affects the instrumented Android tests
// executeAndroidTests = true
//
// // Since 1.2: Same as executeTests except that this only affects the unit tests
// executeUnitTests = true
//
// // Since 1.2: When true include results from instrumented Android tests into the coverage report
// includeAndroidTestResults = true
//
// // Since 1.2: When true include results from unit tests into the coverage report
// includeUnitTestResults = true
// }
allprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
apply(plugin = "com.diffplug.spotless")
detekt {
config = files("$rootDir/detekt.yml")
parallel = true
buildUponDefaultConfig = true
// By default detekt does not check test source set and gradle specific files, so hey have to be added manually
input = files(
"$rootDir/build.gradle.kts",
"$rootDir/settings.gradle.kts",
"src/build.gradle.kts",
"src/main"
)
}
spotless {
ratchetFrom = "origin/main"
format("misc") {
target("*.gradle", ".gitignore")
trimTrailingWhitespace()
indentWithTabs()
endWithNewline()
}
kotlin {
target("**/*.kt")
ktlint()
licenseHeaderFile(file("${project.rootDir}/copyright.txt"))
}
kotlinGradle {
target("*.gradle.kts")
ktlint()
}
}
}