From 157b7bb54b5c668ad1e9cea782aab53113264c19 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 22 Apr 2025 10:02:55 +0700 Subject: [PATCH] fix(android): Require RELEASE_OEM env vars to build FirstVoices Android --- android/build.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/android/build.sh b/android/build.sh index e6d9927898..749308f0a7 100755 --- a/android/build.sh +++ b/android/build.sh @@ -2,6 +2,11 @@ # # Build Keyman Engine for Android, Keyman for Android, OEM FirstVoices Android app, # Samples: KMsample1 and KMSample2, Test - KeyboardHarness +# +# OEM FirstVoices Android app requires the following env vars set: +# RELEASE_OEM should be set +# RELEASE_OEM_FIRSTVOICES should be true + ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" @@ -12,6 +17,19 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" ################################ Main script ################################ +# +# Restrict available OEM publish targets to those that can be built on the current system +# + +oemtargets=() +if [ ! -z "${RELEASE_OEM+x}" ]; then + if [ "${RELEASE_OEM_FIRSTVOICES}" = true ]; then + oemtargets+=(":fv=../oem/firstvoices/android OEM FirstVoices for Android app") + fi +fi + +builder_warn "oemtargets: ${oemtargets[@]}" + builder_describe \ "Build Keyman Engine for Android, Keyman for Android, and FirstVoices Android app." \ "@/resources/tools/check-markdown test:help" \ @@ -28,7 +46,7 @@ builder_describe \ ":sample1=Samples/KMSample1 Sample app: KMSample1" \ ":sample2=Samples/KMSample2 Sample app: KMSample2" \ ":keyboardharness=Tests/KeyboardHarness Test app: KeyboardHarness" \ - ":fv=../oem/firstvoices/android OEM FirstVoices for Android app" + "${oemtargets[@]}" \ builder_parse "$@"