2023-07-10 11:25:17 +08:00
|
|
|
import com.android.build.gradle.internal.cxx.json.jsonStringOf
|
|
|
|
import java.text.SimpleDateFormat
|
|
|
|
import java.util.Locale
|
|
|
|
|
2021-11-19 14:08:52 +08:00
|
|
|
plugins {
|
2023-08-31 22:22:03 +08:00
|
|
|
alias(libs.plugins.android.application)
|
|
|
|
alias(libs.plugins.kotlin.android)
|
|
|
|
alias(libs.plugins.kotlin.parcelize)
|
|
|
|
alias(libs.plugins.kotlin.serialization)
|
|
|
|
alias(libs.plugins.kotlin.kapt)
|
|
|
|
alias(libs.plugins.google.ksp)
|
|
|
|
alias(libs.plugins.google.hilt)
|
|
|
|
alias(libs.plugins.rikka.refine)
|
2021-11-19 14:08:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
2023-05-18 15:34:49 +08:00
|
|
|
namespace = "li.songe.gkd"
|
2023-04-30 17:50:55 +08:00
|
|
|
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
|
|
|
buildToolsVersion = libs.versions.android.buildToolsVersion.get()
|
2021-11-19 14:08:52 +08:00
|
|
|
|
|
|
|
defaultConfig {
|
2023-04-30 17:50:55 +08:00
|
|
|
minSdk = libs.versions.android.minSdk.get().toInt()
|
|
|
|
targetSdk = libs.versions.android.targetSdk.get().toInt()
|
|
|
|
|
2021-12-14 11:34:20 +08:00
|
|
|
applicationId = "li.songe.gkd"
|
2023-11-18 15:20:54 +08:00
|
|
|
versionCode = 11
|
|
|
|
versionName = "1.5.1"
|
2021-11-19 14:08:52 +08:00
|
|
|
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
vectorDrawables {
|
|
|
|
useSupportLibrary = true
|
|
|
|
}
|
2022-10-09 10:51:27 +08:00
|
|
|
|
2023-10-08 14:39:06 +08:00
|
|
|
ksp {
|
|
|
|
arg("room.schemaLocation", "$projectDir/schemas")
|
|
|
|
arg("room.incremental", "true")
|
2022-10-09 10:51:27 +08:00
|
|
|
}
|
2023-07-10 11:25:17 +08:00
|
|
|
val nowTime = System.currentTimeMillis()
|
|
|
|
buildConfigField("Long", "BUILD_TIME", jsonStringOf(nowTime) + "L")
|
2023-09-02 21:36:09 +08:00
|
|
|
buildConfigField(
|
|
|
|
"String", "BUILD_DATE", jsonStringOf(
|
|
|
|
SimpleDateFormat(
|
|
|
|
"yyyy-MM-dd HH:mm:ss ZZ", Locale.SIMPLIFIED_CHINESE
|
|
|
|
).format(nowTime)
|
|
|
|
)
|
|
|
|
)
|
2023-11-07 14:02:05 +08:00
|
|
|
buildConfigField(
|
|
|
|
"String", "BUGLY_TOKEN", jsonStringOf(System.getenv("BUGLY_TOKEN"))
|
|
|
|
)
|
2023-10-31 17:41:42 +08:00
|
|
|
|
|
|
|
resourceConfigurations.addAll(listOf("zh", "en"))
|
|
|
|
ndk {
|
|
|
|
// noinspection ChromeOsAbiSupport
|
|
|
|
abiFilters += listOf("arm64-v8a", "x86_64")
|
|
|
|
}
|
2021-11-19 14:08:52 +08:00
|
|
|
}
|
2021-11-19 14:28:49 +08:00
|
|
|
|
2023-04-30 19:15:26 +08:00
|
|
|
lint {
|
|
|
|
disable.add("ModifierFactoryUnreferencedReceiver")
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
|
|
buildTypes {
|
2021-11-19 14:28:49 +08:00
|
|
|
release {
|
|
|
|
isMinifyEnabled = false
|
|
|
|
setProguardFiles(
|
|
|
|
listOf(
|
2023-09-02 21:36:09 +08:00
|
|
|
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
2021-11-19 14:28:49 +08:00
|
|
|
)
|
|
|
|
)
|
|
|
|
signingConfig = signingConfigs.getByName("release")
|
2023-07-10 11:25:17 +08:00
|
|
|
manifestPlaceholders["appName"] = "GKD"
|
2021-11-19 14:28:49 +08:00
|
|
|
}
|
|
|
|
debug {
|
2023-04-28 18:21:28 +08:00
|
|
|
signingConfig = signingConfigs.getByName("release")
|
2023-07-10 11:25:17 +08:00
|
|
|
manifestPlaceholders["appName"] = "GKD-debug"
|
2023-09-02 21:36:09 +08:00
|
|
|
applicationIdSuffix = ".debug"
|
2021-11-19 14:08:52 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
compileOptions {
|
2023-07-10 11:25:17 +08:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
2022-10-09 10:51:27 +08:00
|
|
|
|
2021-11-19 14:08:52 +08:00
|
|
|
}
|
|
|
|
kotlinOptions {
|
2023-07-10 11:25:17 +08:00
|
|
|
jvmTarget = JavaVersion.VERSION_17.majorVersion
|
|
|
|
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
|
2023-10-24 17:26:07 +08:00
|
|
|
freeCompilerArgs += "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api"
|
|
|
|
freeCompilerArgs += "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi"
|
2021-11-19 14:08:52 +08:00
|
|
|
}
|
|
|
|
buildFeatures {
|
2023-05-18 15:34:49 +08:00
|
|
|
buildConfig = true
|
2021-11-19 14:28:49 +08:00
|
|
|
compose = true
|
2021-11-19 14:08:52 +08:00
|
|
|
}
|
|
|
|
composeOptions {
|
2023-07-10 11:25:17 +08:00
|
|
|
kotlinCompilerExtensionVersion = libs.versions.compose.compilerVersion.get()
|
2021-11-19 14:08:52 +08:00
|
|
|
}
|
2023-07-10 11:25:17 +08:00
|
|
|
packaging {
|
2021-11-19 14:08:52 +08:00
|
|
|
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 {
|
2023-04-30 19:15:26 +08:00
|
|
|
resolutionStrategy {
|
2023-04-28 18:21:28 +08:00
|
|
|
// https://github.com/Kotlin/kotlinx.coroutines/issues/2023
|
|
|
|
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-debug")
|
2021-11-19 14:08:52 +08:00
|
|
|
}
|
|
|
|
}
|
2023-07-10 11:25:17 +08:00
|
|
|
|
|
|
|
// ksp
|
|
|
|
sourceSets.configureEach {
|
|
|
|
kotlin.srcDir("$buildDir/generated/ksp/$name/kotlin/")
|
|
|
|
}
|
2021-11-19 14:08:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-12-09 22:39:24 +08:00
|
|
|
|
2023-07-10 11:25:17 +08:00
|
|
|
implementation(project(mapOf("path" to ":selector")))
|
2023-04-30 17:50:55 +08:00
|
|
|
implementation(libs.androidx.appcompat)
|
|
|
|
implementation(libs.androidx.core.ktx)
|
|
|
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
|
|
|
|
|
|
|
implementation(libs.compose.ui)
|
2023-10-19 16:17:59 +08:00
|
|
|
implementation(libs.compose.material3)
|
2023-04-30 17:50:55 +08:00
|
|
|
implementation(libs.compose.preview)
|
|
|
|
debugImplementation(libs.compose.tooling)
|
|
|
|
androidTestImplementation(libs.compose.junit4)
|
|
|
|
implementation(libs.compose.activity)
|
|
|
|
|
|
|
|
testImplementation(libs.junit)
|
|
|
|
androidTestImplementation(libs.androidx.junit)
|
|
|
|
androidTestImplementation(libs.androidx.espresso)
|
|
|
|
|
2023-07-10 11:25:17 +08:00
|
|
|
compileOnly(project(mapOf("path" to ":hidden_api")))
|
2023-04-30 17:50:55 +08:00
|
|
|
implementation(libs.rikka.shizuku.api)
|
|
|
|
implementation(libs.rikka.shizuku.provider)
|
2023-07-10 11:25:17 +08:00
|
|
|
implementation(libs.lsposed.hiddenapibypass)
|
2023-04-30 17:50:55 +08:00
|
|
|
|
|
|
|
implementation(libs.tencent.bugly)
|
|
|
|
implementation(libs.tencent.mmkv)
|
|
|
|
|
|
|
|
implementation(libs.androidx.room.runtime)
|
|
|
|
implementation(libs.androidx.room.ktx)
|
2023-07-10 11:25:17 +08:00
|
|
|
ksp(libs.androidx.room.compiler)
|
2023-04-30 17:50:55 +08:00
|
|
|
|
|
|
|
implementation(libs.ktor.server.core)
|
|
|
|
implementation(libs.ktor.server.netty)
|
|
|
|
implementation(libs.ktor.server.content.negotiation)
|
|
|
|
|
|
|
|
implementation(libs.ktor.client.core)
|
2023-08-31 22:22:03 +08:00
|
|
|
implementation(libs.ktor.client.okhttp)
|
2023-04-30 17:50:55 +08:00
|
|
|
implementation(libs.ktor.client.content.negotiation)
|
|
|
|
implementation(libs.ktor.serialization.kotlinx.json)
|
|
|
|
|
|
|
|
implementation(libs.google.accompanist.drawablepainter)
|
|
|
|
|
|
|
|
implementation(libs.kotlinx.serialization.json)
|
|
|
|
implementation(libs.kotlinx.collections.immutable)
|
|
|
|
|
|
|
|
implementation(libs.others.jankson)
|
|
|
|
implementation(libs.others.utilcodex)
|
|
|
|
implementation(libs.others.activityResultLauncher)
|
|
|
|
implementation(libs.others.floating.bubble.view)
|
2023-04-28 18:21:28 +08:00
|
|
|
|
2023-07-10 11:25:17 +08:00
|
|
|
implementation(libs.destinations.core)
|
|
|
|
ksp(libs.destinations.ksp)
|
|
|
|
|
2023-08-10 22:02:12 +08:00
|
|
|
implementation(libs.google.hilt.android)
|
|
|
|
kapt(libs.google.hilt.android.compiler)
|
|
|
|
implementation(libs.androidx.hilt.navigation.compose)
|
2023-08-31 22:22:03 +08:00
|
|
|
|
|
|
|
implementation(libs.others.reorderable)
|
|
|
|
|
|
|
|
implementation(libs.androidx.splashscreen)
|
2023-11-08 21:46:31 +08:00
|
|
|
|
|
|
|
implementation(libs.coil.compose)
|
|
|
|
implementation(libs.coil.gif)
|
2021-11-19 14:08:52 +08:00
|
|
|
}
|