Files
artlegend/android/build.gradle.kts
bill ac81ec51f4 Sprint 1 complete: hybrid Compose + LibGDX architecture building
Full AL-001 through AL-008 implementation: shared/ module with ModuleType
enum, GameHost routing, StylusInputBridge, LineCorridorScreen with live
stroke rendering, LineScore (straightness + anglePrecision), score returned
to Compose hub via ActivityResult. Fixes LineScore field mismatch
(pressureConsistency → anglePrecision) caught during AL-009 build check.
Adds .gitignore and handoff notes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 19:21:48 -06:00

103 lines
3.1 KiB
Kotlin

plugins {
kotlin("android")
id("com.android.application")
}
val gdxVersion: String by project
val composeBom: String by project
val composeCompilerExtension: String by project
val natives: Configuration by configurations.creating
android {
namespace = "com.artlegend"
compileSdk = 34
defaultConfig {
applicationId = "com.artlegend"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "0.1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = composeCompilerExtension
}
sourceSets {
getByName("main") {
assets.srcDirs(rootProject.file("assets"))
jniLibs.srcDirs("libs")
}
}
}
dependencies {
implementation(project(":core"))
implementation(project(":shared"))
// LibGDX
implementation("com.badlogicgames.gdx:gdx-backend-android:$gdxVersion")
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a")
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a")
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86")
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64")
// Compose BOM
val composeBomDep = platform("androidx.compose:compose-bom:$composeBom")
implementation(composeBomDep)
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.material:material-icons-core")
// Activity + Navigation + Lifecycle
implementation("androidx.activity:activity-compose:1.9.2")
implementation("androidx.navigation:navigation-compose:2.8.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.4")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.4")
// Material XML themes (for Activity window styling)
implementation("com.google.android.material:material:1.12.0")
}
tasks.register("copyAndroidNatives") {
doFirst {
val validAbis = setOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
natives.files.forEach { jar ->
// Extract ABI from classifier, e.g. "gdx-platform-1.12.1-natives-arm64-v8a.jar" → "arm64-v8a"
val abi = jar.name.substringAfter("natives-").removeSuffix(".jar")
if (abi in validAbis) {
val outputDir = file("libs/$abi")
outputDir.mkdirs()
copy {
from(zipTree(jar))
into(outputDir)
include("*.so")
eachFile { path = name }
includeEmptyDirs = false
}
}
}
}
}
tasks.whenTaskAdded {
if (name.contains("package") || name.contains("assemble") || name.contains("bundle")) {
dependsOn("copyAndroidNatives")
}
}