Files
meshcore-open/android/app/build.gradle.kts
T
tthandClaude Opus 5.5 185d2aca53
build / ci-image (push) Successful in 11s
build / build (push) Successful in 26m36s
Merge upstream/dev (22 commits) [upstream-sync]
Conflicts resolved by hand, our fork changes carried over:
- MainActivity.kt: keep the unread widget hooks next to upstream's
  scroll capture (attach and detach both).
- app_settings_screen.dart: upstream wrapped the list in
  MeshSettingsTileTheme; image-message and translation sections stay
  gated on kOnDeviceMl (ML-free build).
- channel_chat_screen.dart: upstream split build() into methods; took
  theirs and re-applied the terminal-theme list padding.
- chat_composer.dart: both imports (terminal_theme, radio_guard).
- mesh_nav_tile.dart: upstream's meshTileTitleStyle, with the smaller
  terminal-theme title kept.

flutter analyze clean, flutter test 1522 passed (CI image, local).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 15:30:43 +01:00

136 lines
4.8 KiB
Kotlin

import java.util.Properties
plugins {
id("com.android.application")
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}
val keystoreProperties = Properties()
val keystorePropertiesFile = rootProject.file("key.properties")
if (keystorePropertiesFile.exists()) {
keystorePropertiesFile.inputStream().use { keystoreProperties.load(it) }
}
android {
namespace = "com.meshcore.meshcore_open"
compileSdk = flutter.compileSdkVersion
ndkVersion = "29.0.14206865"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
// tth fork: abiFilters does not reach prebuilt plugin .so files
// (mlkit barhopper, flserial, ...), so drop the other ABIs at packaging.
packaging {
jniLibs {
excludes += listOf("lib/armeabi-v7a/**", "lib/x86/**", "lib/x86_64/**")
}
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.meshcore.meshcore_open"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
// Codec2 native build removed - no longer needed
// externalNativeBuild {
// cmake {
// arguments += listOf("-DANDROID_STL=c++_shared")
// }
// }
// arm64-v8a only, deliberately.
//
// * ONNX Runtime (flutter_onnxruntime, used by the AEIC-SE image codec)
// ships a per-ABI .so. arm64-v8a alone costs ~18 MB of APK; a
// universal APK carrying armeabi-v7a and x86_64 as well costs ~56 MB.
// * llamadart only declares android-arm64 and android-x64 backends in
// pubspec.yaml's `hooks.user_defines`, so an armeabi-v7a build already
// has no translation backend at all.
// * The image codec needs ~2.7 GiB peak resident, which no 32-bit
// address space can provide regardless of ABI.
//
// Consequence: this APK will not install on 32-bit-only ARM devices or on
// x86_64 emulators. For emulator work, temporarily add "x86_64" here.
ndk {
abiFilters += listOf("arm64-v8a")
}
}
signingConfigs {
create("release") {
val storeFilePath = keystoreProperties["storeFile"] as String?
if (storeFilePath != null) {
storeFile = file(storeFilePath)
storePassword = keystoreProperties["storePassword"] as String?
keyAlias = keystoreProperties["keyAlias"] as String?
keyPassword = keystoreProperties["keyPassword"] as String?
}
}
}
buildTypes {
release {
signingConfig = if (keystorePropertiesFile.exists()) {
signingConfigs.getByName("release")
} else {
signingConfigs.getByName("debug")
}
// ONNX Runtime resolves its Java classes from native code by name.
// Without these rules R8 renames them and the process SIGABRTs with
// "java_class == null" the instant the codec runs a model.
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
// Codec2 native build removed - no longer needed
// externalNativeBuild {
// cmake {
// path = file("src/main/cpp/CMakeLists.txt")
// }
// }
}
// Android Auto (notification read-aloud and voice reply) is opt-in, because
// declaring it puts the app through Play's separate Android Auto review.
// Enable it with `flutter build apk --android-project-arg=androidAuto=true`
// or `./gradlew -PandroidAuto=true ...`.
val androidAutoEnabled = (findProperty("androidAuto") as String?)?.toBoolean() == true
if (androidAutoEnabled) {
android.sourceSets.getByName("main").res.srcDir("src/androidAuto/res")
}
androidComponents {
onVariants { variant ->
if (androidAutoEnabled) {
variant.sources.manifests.addStaticManifestFile("src/androidAuto/AndroidManifest.xml")
}
}
}
flutter {
source = "../.."
}
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
// enableEdgeToEdge() for Android 15+ edge-to-edge enforcement.
implementation("androidx.activity:activity-ktx:1.13.0")
}