Initial commit: LCK Control Android app
Multi-module Android app (app/shared/sdk) with backend-driven auth, Quest Platform SDK login, YouTube/Twitch OAuth linking, stream management via AIDL service. Compose UI with Hilt DI.
This commit is contained in:
158
app/build.gradle.kts
Normal file
158
app/build.gradle.kts
Normal file
@@ -0,0 +1,158 @@
|
||||
import java.io.ByteArrayOutputStream
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
alias(libs.plugins.kotlin.parcelize)
|
||||
alias(libs.plugins.hilt)
|
||||
alias(libs.plugins.ksp)
|
||||
}
|
||||
|
||||
// ── Git-based versioning ────────────────────────────────────
|
||||
fun gitVersionName(): String = runGit("describe", "--tags", "--abbrev=0")
|
||||
.removePrefix("v")
|
||||
.ifEmpty { "0.1.0" }
|
||||
|
||||
fun gitCommitCount(): Int = runGit("rev-list", "--count", "HEAD")
|
||||
.toIntOrNull() ?: 1
|
||||
|
||||
fun gitShortHash(): String = runGit("rev-parse", "--short", "HEAD")
|
||||
.ifEmpty { "unknown" }
|
||||
|
||||
fun gitDisplayVersion(): String {
|
||||
val base = gitVersionName()
|
||||
val count = gitCommitCount()
|
||||
val hash = gitShortHash()
|
||||
return "$base+$count.$hash"
|
||||
}
|
||||
|
||||
fun runGit(vararg args: String): String = try {
|
||||
val out = ByteArrayOutputStream()
|
||||
project.exec {
|
||||
commandLine("git", *args)
|
||||
standardOutput = out
|
||||
isIgnoreExitValue = true
|
||||
}
|
||||
out.toString().trim()
|
||||
} catch (_: Exception) { "" }
|
||||
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
|
||||
android {
|
||||
namespace = "com.omixlab.lckcontrol"
|
||||
compileSdk {
|
||||
version = release(36) {
|
||||
minorApiLevel = 1
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
storeFile = rootProject.file("lck-control.keystore")
|
||||
storePassword = "4gx%wx4NOhS6"
|
||||
keyAlias = "lck-control"
|
||||
keyPassword = "4gx%wx4NOhS6"
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.omixlab.lckcontrol"
|
||||
minSdk = 32
|
||||
targetSdk = 34
|
||||
versionCode = gitCommitCount()
|
||||
versionName = gitVersionName()
|
||||
|
||||
buildConfigField("String", "DISPLAY_VERSION", "\"${gitDisplayVersion()}\"")
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
buildFeatures {
|
||||
compose = true
|
||||
buildConfig = true
|
||||
}
|
||||
packaging {
|
||||
resources {
|
||||
excludes += setOf(
|
||||
"META-INF/DEPENDENCIES",
|
||||
"META-INF/LICENSE",
|
||||
"META-INF/LICENSE.txt",
|
||||
"META-INF/NOTICE",
|
||||
"META-INF/NOTICE.txt",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":shared"))
|
||||
|
||||
// Core
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||||
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
||||
implementation(libs.androidx.lifecycle.runtime.compose)
|
||||
implementation(libs.kotlinx.coroutines.android)
|
||||
|
||||
// Compose
|
||||
implementation(libs.androidx.activity.compose)
|
||||
implementation(platform(libs.androidx.compose.bom))
|
||||
implementation(libs.androidx.compose.ui)
|
||||
implementation(libs.androidx.compose.ui.graphics)
|
||||
implementation(libs.androidx.compose.ui.tooling.preview)
|
||||
implementation(libs.androidx.compose.material3)
|
||||
implementation(libs.androidx.compose.material.icons.extended)
|
||||
implementation(libs.androidx.navigation.compose)
|
||||
|
||||
// Hilt
|
||||
implementation(libs.hilt.android)
|
||||
ksp(libs.hilt.compiler)
|
||||
implementation(libs.androidx.hilt.navigation.compose)
|
||||
|
||||
// Room
|
||||
implementation(libs.room.runtime)
|
||||
implementation(libs.room.ktx)
|
||||
ksp(libs.room.compiler)
|
||||
|
||||
// Networking
|
||||
implementation(libs.retrofit)
|
||||
implementation(libs.retrofit.converter.moshi)
|
||||
implementation(libs.moshi.kotlin)
|
||||
implementation(libs.okhttp)
|
||||
implementation(libs.okhttp.logging)
|
||||
|
||||
// Security
|
||||
implementation(libs.androidx.security.crypto)
|
||||
|
||||
// Meta Quest Platform SDK
|
||||
implementation("com.meta.horizon.platform.ovr:android-platform-sdk:77.0.1")
|
||||
|
||||
// Browser (Custom Tabs for OAuth flows)
|
||||
implementation(libs.androidx.browser)
|
||||
|
||||
// Test
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
androidTestImplementation(platform(libs.androidx.compose.bom))
|
||||
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
|
||||
debugImplementation(libs.androidx.compose.ui.tooling)
|
||||
debugImplementation(libs.androidx.compose.ui.test.manifest)
|
||||
}
|
||||
Reference in New Issue
Block a user