-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle.kts
74 lines (63 loc) · 2.55 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
import org.jetbrains.kotlin.gradle.plugin.KaptExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id(PLUGIN_GRADLE_VERSIONS) version Tooling.gradleVersionsPlugin
}
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:${Tooling.gradlePluginVersion}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Tooling.kotlin}")
classpath("com.google.dagger:hilt-android-gradle-plugin:${Hilt.coreHiltVersion}")
classpath("com.google.protobuf:protobuf-gradle-plugin:${Tooling.protobufPluginVersion}")
classpath("com.github.ben-manes:gradle-versions-plugin:${Tooling.gradleVersionsPlugin}")
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { setUrl("https://jitpack.io") }
}
// Without the below block, a build failure was happening when
// running ./gradlew connectedAndroidTest.
// See: https://github.com/mockito/mockito/issues/2007#issuecomment-689365556
configurations.all {
resolutionStrategy.force("org.objenesis:objenesis:2.6")
}
}
subprojects {
tasks.withType<KotlinCompile>().all {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
"-opt-in=androidx.compose.animation.ExperimentalAnimationApi",
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi",
"-opt-in=com.google.accompanist.pager.ExperimentalPagerApi",
)
jvmTarget = Tooling.kotlinCompatibilityVersion.toString()
}
}
plugins.withId(PLUGIN_KOTLIN_KAPT) {
extensions.findByType<KaptExtension>()?.run {
correctErrorTypes = true
}
}
// https://stackoverflow.com/a/70348822/7015881
// https://issuetracker.google.com/issues/238425626
configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "androidx.lifecycle" && requested.name == "lifecycle-viewmodel-ktx") {
useVersion(AndroidX.viewModel)
}
}
}
}