From 4f4fbc204a88afe6e90be3aba3bdb611c9e8d9b7 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 24 Apr 2026 15:02:01 -0500 Subject: [PATCH] refactor(android): simplify Python sync task and remove product flavors from build.gradle --- android/app/build.gradle | 64 ++++++++++-------------------------- scripts/sign-android-apks.sh | 2 +- 2 files changed, 18 insertions(+), 48 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index a83001d..dbc78ba 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -42,17 +42,6 @@ android { namespace 'com.meshchatx' compileSdk 34 - flavorDimensions "pythonBundle" - productFlavors { - slim { - dimension "pythonBundle" - isDefault true - } - full { - dimension "pythonBundle" - } - } - defaultConfig { applicationId "com.meshchatx" minSdk 24 @@ -114,47 +103,28 @@ tasks.register("fetchRepositoryBundledWheels", Exec) { } } -def registerMeshchatPythonSync = { String bundle -> - def cap = bundle.capitalize() - tasks.register("syncMeshchatPython${cap}", Sync) { - if (bundle == "full") { - dependsOn("fetchRepositoryBundledWheels") - } - if (!meshchatSourceDir.exists()) { - throw new org.gradle.api.GradleException("Missing meshchatx source directory at ${meshchatSourceDir}") - } - doFirst { - delete( - file("$projectDir/src/main/python/meshchatx"), - file("$projectDir/src/main/python/LXST"), - file("$projectDir/src/main/python/LXMF"), - file("$projectDir/src/main/python/RNS") - ) - } - from(meshchatSourceDir) { - if (bundle == "slim") { - exclude("src/frontend/**") - exclude("public/reticulum-docs-bundled/**") - exclude("public/rnode-flasher/**") - exclude("public/repository-server-bundled/**") - } - } - includeEmptyDirs = false - from(new File(repoRoot, "CHANGELOG.md")) - into(file("$projectDir/src/${bundle}/python/meshchatx")) +tasks.register("syncMeshchatPython", Sync) { + dependsOn("fetchRepositoryBundledWheels") + if (!meshchatSourceDir.exists()) { + throw new org.gradle.api.GradleException("Missing meshchatx source directory at ${meshchatSourceDir}") } + doFirst { + delete( + file("$projectDir/src/main/python/meshchatx"), + file("$projectDir/src/main/python/LXST"), + file("$projectDir/src/main/python/LXMF"), + file("$projectDir/src/main/python/RNS") + ) + } + from(meshchatSourceDir) + includeEmptyDirs = false + from(new File(repoRoot, "CHANGELOG.md")) + into(file("$projectDir/src/main/python/meshchatx")) } -registerMeshchatPythonSync("slim") -registerMeshchatPythonSync("full") - tasks.configureEach { task -> if (task.name.toLowerCase().contains("merge") && task.name.toLowerCase().contains("pythonsources")) { - if (task.name.contains("Slim")) { - task.dependsOn(tasks.named("syncMeshchatPythonSlim")) - } else if (task.name.contains("Full")) { - task.dependsOn(tasks.named("syncMeshchatPythonFull")) - } + task.dependsOn(tasks.named("syncMeshchatPython")) } } diff --git a/scripts/sign-android-apks.sh b/scripts/sign-android-apks.sh index eae29d2..485a620 100755 --- a/scripts/sign-android-apks.sh +++ b/scripts/sign-android-apks.sh @@ -80,7 +80,7 @@ if [[ ! -x "${BT_DIR}/zipalign" || ! -x "${BT_DIR}/apksigner" ]]; then exit 1 fi -APK_GLOB="${APK_GLOB:-android/app/build/outputs/apk/*/release/*-unsigned.apk}" +APK_GLOB="${APK_GLOB:-android/app/build/outputs/apk/release/*-unsigned.apk}" shopt -s nullglob APKS=( ${APK_GLOB} ) shopt -u nullglob