-
Notifications
You must be signed in to change notification settings - Fork 226
/
build.gradle.kts
93 lines (77 loc) · 2.8 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
plugins {
id("com.android.application")
id("kotlin-android")
id("com.google.devtools.ksp")
id("dagger.hilt.android.plugin")
}
android {
namespace = "com.zj.play"
val sdkVersion = rootProject.extra["sdkVersion"] as Int?
val minSdkVersion = rootProject.extra["minSdkVersion"] as Int?
compileSdk = sdkVersion
defaultConfig {
minSdk = minSdkVersion
targetSdk = sdkVersion
versionCode = rootProject.extra["versionCode"] as Int?
versionName = rootProject.extra["versionName"] as String?
testInstrumentationRunner = rootProject.extra["testInstrumentationRunner"] as String?
vectorDrawables {
useSupportLibrary = true
}
resourceConfigurations += listOf("en", "zh", "zh-rCN", "zh-rHK", "zh-rTW")
}
buildTypes {
release {
// 开启混淆
isMinifyEnabled = true
// 去除无用资源 与lint不同
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
val javaVersion = rootProject.extra["javaVersion"] as JavaVersion
val javaVersionName = javaVersion.toString()
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersionName))
}
}
compileOptions {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
buildFeatures {
viewBinding = true
}
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
}
dependencies {
implementation(fileTree("libs") { include("*.jar", "*.aar") })
implementation("${rootProject.extra["kotlinVersion"] as String?}")
implementation("${rootProject.extra["coreKtx"] as String?}")
implementation("${rootProject.extra["appcompat"] as String?}")
implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0")
implementation("io.github.youth5201314:banner:2.2.2")
implementation(project(":model"))
implementation(project(":core"))
implementation(project(":network"))
// 内存泄漏检测
//implementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
// hilt
val hiltVersion = rootProject.extra["hiltVersion"] as String?
implementation("com.google.dagger:hilt-android:$hiltVersion")
ksp("com.google.dagger:hilt-android-compiler:$hiltVersion")
ksp("androidx.hilt:hilt-compiler:1.2.0")
// 异常上报
implementation("com.tencent.bugly:crashreport:4.1.9")
testImplementation("${rootProject.extra["junit"] as String?}")
androidTestImplementation("${rootProject.extra["extJunit"] as String?}")
androidTestImplementation("${rootProject.extra["espressoCore"] as String?}")
}