-
Notifications
You must be signed in to change notification settings - Fork 51
/
build.gradle
109 lines (100 loc) · 3.33 KB
/
build.gradle
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
102
103
104
105
106
107
108
109
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kspVersion = '1.8.0-1.0.8'
}
repositories {
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath(libs.google.services.gradle)
}
}
plugins {
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.kotlin.android).apply(false)
alias(libs.plugins.hilt.gradle.plugin).apply(false)
alias(libs.plugins.spotless).apply(false)
alias(libs.plugins.kotlin.plugin.serialization).apply(false)
alias(libs.plugins.version.check).apply(false)
}
apply from: "gradle/project-dependency-graph.gradle"
task clean(type: Delete) {
delete rootProject.buildDir
}
def provideAndroidXWorkerDeps(project) {
project.dependencies {
implementation libs.androidx.work.runtime.ktx
implementation libs.hilt.work
kapt libs.hilt.compiler
}
}
def provideHiltDeps(project) {
project.dependencies {
// Hilt
implementation libs.hilt.android
kapt libs.hilt.compiler
}
}
def provideUnitTestDeps(project) {
project.dependencies {
testImplementation libs.kotlinx.coroutines.test
testImplementation libs.google.truth
testImplementation libs.junit
testImplementation libs.turbine
testImplementation libs.mockk
}
}
def provideUiTestDeps(project) {
project.dependencies {
androidTestImplementation libs.androidx.compose.ui.test.junit4
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso.core
androidTestImplementation libs.google.truth
debugImplementation libs.androidx.compose.ui.test.manifest
}
}
subprojects {
apply plugin: 'com.diffplug.spotless'
apply plugin: 'com.github.ben-manes.versions'
spotless {
kotlin {
licenseHeaderFile project.rootProject.file('spotless/copyright.kt')
target "**/*.kt"
ktlint().userData(['android': 'true', 'max_line_length': '200'])
}
format 'misc', {
target '**/*.gradle', '**/*.md', '**/.gitignore'
trimTrailingWhitespace()
indentWithTabs()
}
}
// https://chris.banes.dev/composable-metrics/ for more information
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
if (project.findProperty("enableComposeCompilerReports") == "true") {
freeCompilerArgs += [
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.buildDir.absolutePath + "/compose_metrics"
]
freeCompilerArgs += [
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
project.buildDir.absolutePath + "/compose_metrics"
]
}
}
}
}
if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}