gkd/app/build.gradle.kts

206 lines
7.1 KiB
Plaintext
Raw Normal View History

2021-11-19 14:08:52 +08:00
plugins {
id("com.android.application")
id("kotlin-android")
2022-10-09 10:51:27 +08:00
id("kotlin-parcelize")
2021-12-14 11:34:20 +08:00
id("kotlin-kapt")
2022-10-09 10:51:27 +08:00
id("org.jetbrains.kotlin.plugin.serialization")
2023-04-28 18:21:28 +08:00
id("com.google.devtools.ksp") version "1.8.10-1.0.9"
2021-11-19 14:08:52 +08:00
}
2023-04-28 18:21:28 +08:00
//val composeVersion = "1.3.3"
@Suppress("UnstableApiUsage")
2021-11-19 14:08:52 +08:00
android {
2022-10-09 10:51:27 +08:00
compileSdk = 33
buildToolsVersion = "33.0.0"
2021-11-19 14:08:52 +08:00
defaultConfig {
2021-12-14 11:34:20 +08:00
applicationId = "li.songe.gkd"
2021-11-19 14:28:49 +08:00
minSdk = 26
2022-10-09 10:51:27 +08:00
targetSdk = 33
2021-11-19 14:08:52 +08:00
versionCode = 1
2022-10-09 10:51:27 +08:00
versionName = "1.0.0"
2021-11-19 14:08:52 +08:00
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
2022-10-09 10:51:27 +08:00
kapt {
arguments {
// room 依赖每次构建的产物来执行自动迁移
arg("room.schemaLocation", "$projectDir/schemas")
}
}
2021-11-19 14:08:52 +08:00
}
2021-11-19 14:28:49 +08:00
signingConfigs {
create("release") {
storeFile = file("./android.jks")
storePassword = "KdMQ6pqiNSJ6Sype"
keyAlias = "key0"
keyPassword = "KdMQ6pqiNSJ6Sype"
}
}
2021-11-19 14:08:52 +08:00
2022-10-09 10:51:27 +08:00
kotlin {
sourceSets.debug {
kotlin.srcDir("build/generated/ksp/debug/kotlin")
}
sourceSets.release {
kotlin.srcDir("build/generated/ksp/release/kotlin")
}
}
2021-11-19 14:08:52 +08:00
buildTypes {
2021-11-19 14:28:49 +08:00
release {
2022-10-09 10:51:27 +08:00
manifestPlaceholders += mapOf()
2021-11-19 14:28:49 +08:00
isMinifyEnabled = false
setProguardFiles(
listOf(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
)
signingConfig = signingConfigs.getByName("release")
2021-12-14 11:34:20 +08:00
manifestPlaceholders["appName"] = "搞快点"
2021-11-19 14:28:49 +08:00
}
debug {
applicationIdSuffix = ".debug"
2023-04-28 18:21:28 +08:00
signingConfig = signingConfigs.getByName("release")
2021-12-14 11:34:20 +08:00
manifestPlaceholders["appName"] = "搞快点-dev"
2021-11-19 14:08:52 +08:00
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
2022-10-09 10:51:27 +08:00
// isCoreLibraryDesugaringEnabled = true
2021-11-19 14:08:52 +08:00
}
kotlinOptions {
jvmTarget = "1.8"
2022-10-09 10:51:27 +08:00
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
// 忽略 compose 对 kotlin 版本的限制
// freeCompilerArgs = freeCompilerArgs + listOf(
// "-P",
// "plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"
// )
2021-11-19 14:08:52 +08:00
}
buildFeatures {
2021-11-19 14:28:49 +08:00
compose = true
2021-11-19 14:08:52 +08:00
}
composeOptions {
2022-12-09 22:39:24 +08:00
// compose 编译器的版本, 需要注意它与 compose 的版本不一致
// https://mvnrepository.com/artifact/androidx.compose.compiler/compiler
2023-04-28 18:21:28 +08:00
kotlinCompilerExtensionVersion = "1.4.4"
2021-11-19 14:08:52 +08:00
}
packagingOptions {
resources {
2022-10-09 10:51:27 +08:00
// Due to https://github.com/Kotlin/kotlinx.coroutines/issues/2023
2023-04-28 18:21:28 +08:00
excludes += "META-INF/INDEX.LIST"
2022-10-09 10:51:27 +08:00
excludes += "META-INF/licenses/*"
excludes += "**/attach_hotspot_windows.dll"
2023-04-28 18:21:28 +08:00
excludes += "META-INF/io.netty.*"
}
}
configurations.all {
resolutionStrategy{
// https://github.com/Kotlin/kotlinx.coroutines/issues/2023
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-debug")
2021-11-19 14:08:52 +08:00
}
}
}
dependencies {
2022-10-09 10:51:27 +08:00
2021-12-14 11:34:20 +08:00
// normal
2023-04-28 18:21:28 +08:00
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.8.0")
2021-12-14 11:34:20 +08:00
// ktx
2022-10-09 10:51:27 +08:00
implementation("androidx.core:core-ktx:1.9.0")
2023-04-28 18:21:28 +08:00
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
2021-12-14 11:34:20 +08:00
// compose
2023-04-28 18:21:28 +08:00
implementation("androidx.compose.ui:ui:1.4.0")
implementation("androidx.compose.material:material:1.4.0")
implementation("androidx.compose.ui:ui-tooling-preview:1.4.0")
debugImplementation("androidx.compose.ui:ui-tooling:1.4.0")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.4.0")
implementation("androidx.activity:activity-compose:1.7.0")
2021-12-14 11:34:20 +08:00
// test
2021-11-19 14:08:52 +08:00
testImplementation("junit:junit:4.13.2")
2023-04-28 18:21:28 +08:00
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
2021-11-19 14:08:52 +08:00
// https://github.com/RikkaApps/Shizuku-API
2023-04-28 18:21:28 +08:00
// val shizukuVersion = "12.1.0"
implementation("dev.rikka.shizuku:api:12.1.0")
implementation("dev.rikka.shizuku:provider:12.1.0")
2021-11-19 14:08:52 +08:00
// 工具集合类
// https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/README-CN.md
2022-10-09 10:51:27 +08:00
implementation("com.blankj:utilcodex:1.31.0")
2021-11-19 14:08:52 +08:00
2021-12-14 11:34:20 +08:00
// https://developer.android.com/jetpack/compose/navigation
2022-10-09 10:51:27 +08:00
// implementation("androidx.navigation:navigation-compose:2.4.2")
// 2.4.0/2.4.1/2.4.2 在 红米k40 android 12 需要 向左滑动 才会渲染, 在 android studio 自带 preview 也不渲染
// implementation("com.google.accompanist:accompanist-navigation-animation:0.23.1")
2021-12-14 11:34:20 +08:00
// https://bugly.qq.com/docs/user-guide/instruction-manual-android/
2022-10-09 10:51:27 +08:00
implementation("com.tencent.bugly:crashreport:4.0.4")
2021-12-14 11:34:20 +08:00
// https://developer.android.google.cn/training/data-storage/room?hl=zh-cn
2023-04-28 18:21:28 +08:00
// val roomVersion = "2.4.3"
implementation("androidx.room:room-runtime:2.5.1")
kapt("androidx.room:room-compiler:2.5.1")
implementation("androidx.room:room-ktx:2.5.1")
2021-12-14 11:34:20 +08:00
2022-10-09 10:51:27 +08:00
// implementation("com.squareup.retrofit2:retrofit:2.9.0")
// implementation ("com.google.code.gson:gson:2.8.9")
// https://github.com/Tencent/MMKV/blob/master/README_CN.md
implementation("com.tencent:mmkv:1.2.13")
// ktor
2023-04-28 18:21:28 +08:00
implementation("io.ktor:ktor-server-core:2.2.3")
implementation("io.ktor:ktor-server-netty:2.2.3")
2022-10-09 10:51:27 +08:00
// https://ktor.io/docs/cors.html#install_plugin
2023-04-28 18:21:28 +08:00
implementation("io.ktor:ktor-server-cors:2.2.3")
implementation("io.ktor:ktor-server-content-negotiation:2.2.3")
2022-10-09 10:51:27 +08:00
// 请注意,当 client 和 server 版本不一致时, 会报错 socket hang up
2023-04-28 18:21:28 +08:00
implementation("io.ktor:ktor-client-core:2.2.3")
implementation("io.ktor:ktor-client-cio:2.2.3")
implementation("io.ktor:ktor-client-content-negotiation:2.2.3")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.2.3")
2022-10-09 10:51:27 +08:00
// https://github.com/Kotlin/kotlinx.serialization/blob/master/docs
2023-04-28 18:21:28 +08:00
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
2022-10-09 10:51:27 +08:00
// https://dylancaicoding.github.io/ActivityResultLauncher/#/
implementation("com.github.DylanCaiCoding:ActivityResultLauncher:1.1.2")
// https://github.com/journeyapps/zxing-android-embedded
implementation("com.journeyapps:zxing-android-embedded:4.3.0")
// implementation("androidx.startup:startup-runtime:1.1.1")
implementation("com.google.accompanist:accompanist-drawablepainter:0.23.1")
implementation("com.google.accompanist:accompanist-placeholder-material:0.23.1")
ksp(project(":room_processor"))
2022-12-09 22:39:24 +08:00
implementation(project(mapOf("path" to ":selector")))
2023-04-28 18:21:28 +08:00
implementation(project(mapOf("path" to ":router")))
2022-12-09 22:39:24 +08:00
// https://github.com/falkreon/Jankson
implementation("blue.endless:jankson:1.2.1")
// https://github.com/Kotlin/kotlinx.collections.immutable
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5")
2021-12-14 11:34:20 +08:00
2023-04-28 18:21:28 +08:00
implementation("io.github.torrydo:floating-bubble-view:0.5.2")
2021-11-19 14:08:52 +08:00
}