gkd/app/build.gradle.kts

176 lines
5.4 KiB
Plaintext
Raw Normal View History

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 {
id("com.android.application")
2022-10-09 10:51:27 +08:00
id("kotlin-parcelize")
2023-07-10 11:25:17 +08:00
kotlin("android")
kotlin("plugin.serialization")
id("com.google.devtools.ksp")
id("dev.rikka.tools.refine")
2021-11-19 14:08:52 +08:00
}
2023-07-10 11:25:17 +08:00
2023-04-28 18:21:28 +08:00
@Suppress("UnstableApiUsage")
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"
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
2023-07-10 11:25:17 +08:00
javaCompileOptions {
annotationProcessorOptions {
arguments += mapOf(
"room.schemaLocation" to "$projectDir/schemas",
"room.incremental" to "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")
buildConfigField("String", "BUILD_DATE", jsonStringOf(SimpleDateFormat("yyyy-MM-dd HH:mm:ss ZZ", Locale.SIMPLIFIED_CHINESE).format(nowTime)))
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(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
)
signingConfig = signingConfigs.getByName("release")
2023-07-10 11:25:17 +08:00
manifestPlaceholders["appName"] = "GKD"
2021-11-19 14:28:49 +08:00
}
debug {
applicationIdSuffix = ".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"
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"
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
}
2023-07-10 11:25:17 +08:00
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)
implementation(libs.compose.material)
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)
2023-04-30 17:58:05 +08:00
implementation(libs.ktor.server.cors)
2023-04-30 17:50:55 +08:00
implementation(libs.ktor.server.content.negotiation)
implementation(libs.ktor.client.core)
2023-07-10 11:25:17 +08:00
implementation(libs.ktor.client.android)
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.google.accompanist.placeholder.material)
2023-07-10 11:25:17 +08:00
implementation(libs.google.accompanist.systemuicontroller)
2023-04-30 17:50:55 +08:00
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.zxing.android.embedded)
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)
implementation(libs.destinations.animations)
ksp(libs.destinations.ksp)
2021-11-19 14:08:52 +08:00
}