~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/hud

A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts

0
0
73 lines · 2.4 KB Raw History
// The Android app around HUDKit (`:hudkit`). For now its one screen is the
// gallery: every drawing HUD makes as a tile, from the sample answers
// `just gallery-data` writes to target/gallery/gallery.json, which a debug
// build carries as an asset, as the iOS app's Debug builds do.
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.compose)
}

android {
    namespace = "place.hud.app"
    compileSdk = 37

    defaultConfig {
        applicationId = "place.hud.app"
        minSdk = 28
        targetSdk = 36
        versionCode = 1
        versionName = "0.1.0"
    }

    buildTypes {
        debug {
            applicationIdSuffix = ".debug"
            // A server on this machine (`just serve`), as the emulator reaches it.
            buildConfigField("String", "SERVER", "\"http://10.0.2.2:8787/\"")
        }
        release {
            buildConfigField("String", "SERVER", "\"https://hud.place/\"")
            isMinifyEnabled = true
            isShrinkResources = true
            proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
        }
    }

    // The gallery's sample answers, in debug alone; built without them, the
    // gallery says how to make them.
    sourceSets.getByName("debug").assets.directories.add(layout.buildDirectory.dir("generated/gallery").get().asFile.path)

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }

    buildFeatures {
        compose = true
        buildConfig = true
    }
}

kotlin {
    compilerOptions {
        jvmTarget.set(JvmTarget.JVM_17)
    }
}

val galleryData = tasks.register<Copy>("galleryData") {
    description = "Copies target/gallery/gallery.json, from `just gallery-data`, into the debug build's assets."
    from(rootProject.file("../target/gallery")) { include("gallery.json") }
    into(layout.buildDirectory.dir("generated/gallery"))
}
tasks.matching { it.name == "mergeDebugAssets" }.configureEach { dependsOn(galleryData) }

dependencies {
    implementation(project(":hudkit"))
    implementation(libs.androidx.core.ktx)
    implementation(libs.androidx.activity.compose)
    implementation(libs.androidx.lifecycle.runtime.compose)
    implementation(libs.kotlinx.coroutines.android)
    debugImplementation(libs.androidx.ui.tooling)
}