Publish current app and server
This commit is contained in:
+42
-2
@@ -5,6 +5,7 @@ plugins {
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("org.jetbrains.kotlin.plugin.compose")
|
||||
id("org.jetbrains.kotlin.plugin.serialization")
|
||||
id("androidx.baselineprofile")
|
||||
}
|
||||
|
||||
// Set in gradle.properties (or ~/.gradle/gradle.properties, or -Pmemby.serverUrl=...).
|
||||
@@ -15,9 +16,30 @@ val embyServerUrl: String = (project.findProperty("memby.serverUrl") as String?)
|
||||
// becomes a thin renderer; blank keeps the direct-to-Emby path above.
|
||||
val membyGatewayUrl: String = (project.findProperty("memby.gatewayUrl") as String?).orEmpty().trim()
|
||||
|
||||
// Kept in BuildConfig so the TV can show the exact corresponding-source location and
|
||||
// the complete legal documents offline. Deployments can override the public source URL
|
||||
// without changing application code.
|
||||
val membySourceUrl: String =
|
||||
(project.findProperty("memby.sourceUrl") as String?)
|
||||
?.trim()
|
||||
?.takeIf(String::isNotEmpty)
|
||||
?: "https://g.sublogue.com/admin/memby"
|
||||
|
||||
fun buildConfigString(value: String): String =
|
||||
"\"" + value
|
||||
.replace("\\", "\\\\")
|
||||
.replace("\"", "\\\"")
|
||||
.replace("\r\n", "\\n")
|
||||
.replace("\n", "\\n") + "\""
|
||||
|
||||
val gplLicenseText = rootProject.file("LICENSE").readText()
|
||||
val projectNoticeText =
|
||||
rootProject.file("NOTICE").readText()
|
||||
.replace("https://g.sublogue.com/admin/memby", membySourceUrl)
|
||||
|
||||
// A release workflow can derive the app version from its Git tag without editing the
|
||||
// source tree. Local builds keep using the checked-in default.
|
||||
val defaultVersionName = "0.1.69"
|
||||
val defaultVersionName = "0.2.9"
|
||||
val membyVersionName: String =
|
||||
(project.findProperty("memby.versionName") as String?)
|
||||
?.trim()
|
||||
@@ -56,6 +78,9 @@ android {
|
||||
|
||||
buildConfigField("String", "EMBY_SERVER_URL", "\"${embyServerUrl.replace("\"", "\\\"")}\"")
|
||||
buildConfigField("String", "MEMBY_GATEWAY_URL", "\"${membyGatewayUrl.replace("\"", "\\\"")}\"")
|
||||
buildConfigField("String", "SOURCE_CODE_URL", buildConfigString(membySourceUrl))
|
||||
buildConfigField("String", "GPL_LICENSE_TEXT", buildConfigString(gplLicenseText))
|
||||
buildConfigField("String", "PROJECT_NOTICE_TEXT", buildConfigString(projectNoticeText))
|
||||
}
|
||||
|
||||
// Release signing. Android identifies an app by (applicationId, signing key), so
|
||||
@@ -79,7 +104,13 @@ android {
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
// R8 is the single biggest cold-start lever on the weak TV boxes this ships
|
||||
// to: a smaller dex is less to load and verify before the first frame. The
|
||||
// keep rules in proguard-rules.pro are what stop it stripping the
|
||||
// kotlinx.serialization models the gateway contract depends on — if you add a
|
||||
// @Serializable package, add it there too.
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
@@ -155,6 +186,9 @@ dependencies {
|
||||
implementation("androidx.savedstate:savedstate-ktx:1.2.1")
|
||||
// Measurement only: JankStats is enabled by PerformanceMonitor for debug builds.
|
||||
implementation("androidx.metrics:metrics-performance:1.0.0")
|
||||
// Installs the baseline profile below. Without it the profile is only honoured on
|
||||
// API 31+; a TV box on Android 9-11 — most of the installed base — would get nothing.
|
||||
implementation("androidx.profileinstaller:profileinstaller:1.4.1")
|
||||
|
||||
// Compose (versions from BOM)
|
||||
implementation("androidx.compose.ui:ui")
|
||||
@@ -185,6 +219,12 @@ dependencies {
|
||||
|
||||
debugImplementation("androidx.compose.ui:ui-tooling")
|
||||
|
||||
// Ahead-of-time compiles the startup + first-scroll path. Regenerate against a real
|
||||
// TV with `.\gradlew.bat :app:generateReleaseBaselineProfile`; the result is checked
|
||||
// in under app/src/release/generated/baselineProfiles so ordinary release builds
|
||||
// don't need a device.
|
||||
baselineProfile(project(":benchmark"))
|
||||
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
|
||||
// Screenshot rendering only. Everything else under app/src/test stays plain JUnit
|
||||
|
||||
Reference in New Issue
Block a user