Switch from Asuka to MyGo, keeping the API client and the feature set: - servers: saved servers, passwordless and password login, proxy, self-signed certificates, per-server device tokens (Keystore), connect form, instance list sheet with switch/disconnect - sessions: virtualized list, search, new session, rename/archive/delete, running indicator, event stream keeps it live - chat: pushed window with system back bar, streaming Markdown via ui/markdown, reasoning and tool rows with image previews, footer menu (read aloud via a Kotlin TTS plugin, copy, fork), user message menu (copy, revert, fork), context usage ring and detail sheet, attachments (photos/files via the document picker), permissions - release builds allow plain http:// LAN servers (Go's net/http dials directly, no cleartext manifest needed) - a local fork of MyGo (third_party/mygo) lowers the Android host's minSdk to 24 (Android 7.0); Go 1.27.4 via mise Version 0.3.0.
50 lines
2.3 KiB
Kotlin
50 lines
2.3 KiB
Kotlin
plugins {
|
|
id("com.android.application") version "8.12.0" apply false
|
|
id("com.android.library") version "8.12.0" apply false
|
|
id("org.jetbrains.kotlin.android") version "2.1.20" apply false
|
|
}
|
|
|
|
// The native modules' libraries: their build sets only their namespace and
|
|
// dependencies, and this the rest, as the host's own. They build here, as
|
|
// a module in Go's module cache is read-only.
|
|
val nativeModules = providers.gradleProperty("mygoNativeModules").orNull?.split(',')?.filter { it.isNotEmpty() }?.associate {
|
|
val parts = it.split('|')
|
|
parts[0] to parts.getOrElse(2) { "" }.split(' ').filter { d -> d.isNotEmpty() }
|
|
} ?: emptyMap()
|
|
|
|
subprojects {
|
|
val uses = nativeModules[name] ?: return@subprojects
|
|
layout.buildDirectory.set(rootProject.layout.buildDirectory.dir("native/$name"))
|
|
plugins.withId("com.android.library") {
|
|
extensions.configure<com.android.build.gradle.LibraryExtension> {
|
|
compileSdk = 36
|
|
defaultConfig {
|
|
minSdk = (providers.gradleProperty("mygoMinSdk").orNull ?: "26").toInt()
|
|
// C, which a module builds with externalNativeBuild, builds
|
|
// for the ABIs that Go does, with the NDK that builds Go.
|
|
providers.gradleProperty("mygoAbis").orNull?.let { ndk { abiFilters += it.split(',').filter { a -> a.isNotEmpty() } } }
|
|
}
|
|
providers.gradleProperty("mygoNdk").orNull?.let { dir ->
|
|
ndkPath = dir
|
|
ndkVersion = file("$dir/source.properties").readLines().firstNotNullOfOrNull {
|
|
it.substringAfter("Pkg.Revision", "").trimStart(' ', '=').takeIf { v -> v.isNotEmpty() }
|
|
} ?: ndkVersion
|
|
}
|
|
externalNativeBuild {
|
|
cmake { buildStagingDirectory = rootProject.layout.buildDirectory.dir("native/$name/cxx").get().asFile }
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
}
|
|
dependencies {
|
|
add("implementation", project(":mygo"))
|
|
uses.forEach { add("implementation", project(":$it")) }
|
|
}
|
|
}
|
|
plugins.withId("org.jetbrains.kotlin.android") {
|
|
extensions.configure<org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension> { jvmToolchain(17) }
|
|
}
|
|
}
|