- Release build 启用 R8/ProGuard + 新建 proguard-rules.pro - MediaDetailScreen: MainScope → rememberCoroutineScope - AppNavHost: openDetail/openHome lambda 记忆化 - VideoPlayerScreen: 提取 PlayerStatusBar 独立 Composable - LibraryScreen: nowMillis 下沉到 ServerStatusLine 内部 - 8个核心数据类添加 @Immutable 注解 - TmdbCalendar: coroutineScope+async 并行化 season 请求 - SearchScreen: derivedStateOf 正确观察 SnapshotStateList - HomeScreen: MediaPoster/ContinueWatchingPoster ImageRequest remember - MediaDetailScreen: cast/recommendations/resources LazyRow 添加 key - RecordsScreen: LaunchedEffect key 用 hashCode 替代 joinToString
89 lines
3.0 KiB
Kotlin
89 lines
3.0 KiB
Kotlin
import java.util.Properties
|
|
|
|
plugins {
|
|
id("com.android.application") version "9.0.1"
|
|
id("org.jetbrains.kotlin.plugin.compose")
|
|
}
|
|
|
|
val localProperties = Properties().apply {
|
|
val file = rootProject.file("local.properties")
|
|
if (file.exists()) file.inputStream().use(::load)
|
|
}
|
|
val tmdbAccessToken = localProperties.getProperty("TMDB_ACCESS_TOKEN", "")
|
|
|
|
android {
|
|
namespace = "com.example.myapplication"
|
|
compileSdk = 35
|
|
|
|
buildFeatures {
|
|
buildConfig = true
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = "com.example.myapplication"
|
|
minSdk = 24
|
|
targetSdk = 35
|
|
versionCode = 1
|
|
versionName = "1.0.0"
|
|
buildConfigField("String", "TMDB_ACCESS_TOKEN", "\"${tmdbAccessToken.replace("\\", "\\\\").replace("\"", "\\\"")}\"")
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_21
|
|
targetCompatibility = JavaVersion.VERSION_21
|
|
}
|
|
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
annotationProcessor("androidx.room:room-compiler:2.8.4")
|
|
val composeBom = platform("androidx.compose:compose-bom:2024.10.01")
|
|
implementation(composeBom)
|
|
implementation("androidx.compose.ui:ui")
|
|
implementation("androidx.compose.ui:ui-graphics")
|
|
implementation("androidx.compose.ui:ui-tooling-preview")
|
|
implementation("androidx.compose.material3:material3")
|
|
implementation("io.coil-kt:coil-compose:2.7.0")
|
|
implementation("androidx.palette:palette-ktx:1.0.0")
|
|
implementation("androidx.activity:activity-compose:1.13.0")
|
|
implementation("androidx.navigation:navigation-compose:2.10.0")
|
|
implementation("androidx.core:core-splashscreen:1.0.1")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.9.1")
|
|
implementation("top.yukonga.miuix.kmp:miuix-ui:0.9.4-rc01")
|
|
implementation("io.github.kyant0:backdrop:2.0.1")
|
|
implementation("io.github.kyant0:shapes:1.2.1")
|
|
implementation("androidx.room:room-runtime:2.8.4")
|
|
implementation("androidx.room:room-ktx:2.8.4")
|
|
implementation("androidx.media3:media3-exoplayer:1.5.1")
|
|
implementation("androidx.media3:media3-exoplayer-hls:1.5.1")
|
|
implementation("androidx.media3:media3-ui:1.5.1")
|
|
implementation("com.squareup.retrofit2:retrofit:2.11.0")
|
|
implementation("com.squareup.retrofit2:converter-gson:2.11.0")
|
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
|
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
|
|
testImplementation("junit:junit:4.13.2")
|
|
debugImplementation("androidx.compose.ui:ui-tooling")
|
|
}
|
|
|
|
tasks.whenTaskAdded {
|
|
if (name.contains("check") && name.contains("AarMetadata")) {
|
|
enabled = false
|
|
}
|
|
}
|