mirror of
https://github.com/Quad4-Software/MeshChatX.git
synced 2026-08-18 09:49:09 -04:00
refactor(android): simplify Python sync task and remove product flavors from build.gradle
This commit is contained in:
parent
2a4fb9cae4
commit
4f4fbc204a
2 changed files with 18 additions and 48 deletions
|
|
@ -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"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue