- benchmarkMacro 1.3.4 → 1.4.1 - BaselineProfileGenerator: 使用 Direction 枚举替代坐标 swipe; 用 executeShellCommand 绕过 startActivityAndWait(模拟器 software renderer 不支持 gfxinfo framestats,会导致 amStartAndWait 超时) - updateBaselineProfile task: 适配 1.4+ 的 startup-prof.txt 文件名格式, 使用 layout.buildDirectory 预先计算路径(configuration cache 兼容) - 重新生成 baseline-prof.txt(全量 AOT 覆盖) - benchmark build type 设为 isDebuggable=true(配合模拟器运行) - 将 Baseline Profile 使用文档从 README 迁移至 DEVELOPMENT.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
100 lines
2.7 KiB
Plaintext
100 lines
2.7 KiB
Plaintext
import java.time.LocalDateTime
|
|
import java.time.format.DateTimeFormatter
|
|
|
|
plugins {
|
|
alias(libs.plugins.androidApplication)
|
|
alias(libs.plugins.composeCompiler)
|
|
}
|
|
|
|
val baseVersion = findProperty("app.version.base") as? String ?: "1.0.0"
|
|
|
|
val gitHash = try {
|
|
providers.exec {
|
|
commandLine("git", "rev-parse", "--short=5", "HEAD")
|
|
}.standardOutput.asText.get().trim()
|
|
} catch (_: Exception) {
|
|
"unknown"
|
|
}
|
|
|
|
val buildDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("ddMMyy"))
|
|
val appVersionName = "${baseVersion}_${gitHash}_${buildDate}"
|
|
|
|
android {
|
|
namespace = "plus.rua.project"
|
|
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
|
|
|
defaultConfig {
|
|
applicationId = "plus.rua.project"
|
|
minSdk = libs.versions.android.minSdk.get().toInt()
|
|
targetSdk = libs.versions.android.targetSdk.get().toInt()
|
|
versionCode = 1
|
|
versionName = appVersionName
|
|
|
|
ndk {
|
|
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
}
|
|
// benchmark 构建类型供 macrobenchmark 模块使用
|
|
create("benchmark") {
|
|
initWith(buildTypes.getByName("release"))
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
matchingFallbacks += listOf("release")
|
|
isDebuggable = true
|
|
}
|
|
}
|
|
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
buildConfig = false
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
packaging {
|
|
resources {
|
|
excludes += listOf(
|
|
"/META-INF/{AL2.0,LGPL2.1}",
|
|
"/META-INF/LICENSE*",
|
|
"/META-INF/NOTICE*",
|
|
"META-INF/DEPENDENCIES",
|
|
"**/*.kotlin_metadata",
|
|
"**/*.kotlin_module",
|
|
)
|
|
pickFirsts += listOf(
|
|
"META-INF/INDEX.LIST",
|
|
"META-INF/io.netty.versions.properties",
|
|
)
|
|
}
|
|
}
|
|
|
|
bundle {
|
|
language { enableSplit = true }
|
|
density { enableSplit = true }
|
|
abi { enableSplit = true }
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(project(":core"))
|
|
|
|
implementation(platform(libs.compose.bom))
|
|
implementation(libs.androidx.activity.compose)
|
|
implementation(libs.compose.uiToolingPreview)
|
|
implementation(libs.compose.uiTooling)
|
|
}
|