-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
94 lines (80 loc) · 2.62 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
val kotlin_version by extra("1.5.10")
repositories {
google()
mavenCentral()
gradleM2()
kotlinx()
jitpack()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${CommonVersions.kotlin}")
android {
classpath(navigationSafeArgs)
}
google {
classpath(hiltPlugin)
}
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
gradleM2()
kotlinx()
jitpack()
}
}
subprojects {
afterEvaluate {
if (isAndroidLibrary || isAndroidApplication) {
extensions.getByType<com.android.build.gradle.BaseExtension>().apply {
compileSdkVersion(CommonVersions.targetsdk)
buildToolsVersion = CommonVersions.buildTools
defaultConfig {
minSdkVersion(CommonVersions.minsdk)
targetSdkVersion(CommonVersions.targetsdk)
vectorDrawables {
setGeneratedDensities(emptyList())
}
}
enableViewBinding()
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
dependencies {
"coreLibraryDesugaring"("com.android.tools:desugar_jdk_libs:1.1.1")
}
sourceSets {
val main by getting {
java.srcDirs(projectDir.resolve("src/main/kotlin"))
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
if (isAndroidLibrary) {
extensions.getByType<com.android.build.gradle.BaseExtension>().apply {
defaultConfig {
versionCode = 1
versionName = "1.0"
if (project.file("proguard-rules.pro").exists()) {
consumerProguardFiles("proguard-rules.pro")
}
}
}
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
}