From a6d92d30f406a3f913cca18b1f76bec419dba0c1 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Fri, 20 Feb 2026 10:34:55 +0700 Subject: [PATCH] chore(ios): Cleanup `RELEASE_OEM_FIRSTVOICES` var in build.sh scripts Fixes #9051 * Fixes unbound variable in tools/prepRelease.sh * Checks `RELEASE_OEM_FIRSTVOICES` env var for build targets --- ios/build.sh | 21 ++++++++++++++++++++- ios/tools/prepRelease.sh | 4 ++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ios/build.sh b/ios/build.sh index fb4df58ed84..81b477932cf 100755 --- a/ios/build.sh +++ b/ios/build.sh @@ -1,4 +1,12 @@ #!/usr/bin/env bash +# +# Build Keyman Engine for iPhone and iPad, Keyman for iPhone and iPad, OEM FirstVoices iOS app, +# Samples: KMSample1 and KMSample2 +# +# OEM FirstVoices iOS 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]}")" @@ -7,6 +15,17 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" . "$KEYMAN_ROOT/resources/build/utils.inc.sh" +# +# 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-false}" = true ]]; then + oemtargets+=(":fv=../oem/firstvoices/ios Builds OEM FirstVoices for iOS platforms") + fi +fi + builder_describe "Builds Keyman Engine and the Keyman app for use on iOS devices - iPhone and iPad." \ "@/resources/tools/check-markdown test:help" \ "clean" \ @@ -18,7 +37,7 @@ builder_describe "Builds Keyman Engine and the Keyman app for use on iOS devices ":help Online documentation" \ ":sample1=samples/KMSample1 Builds the first KeymanEngine sample app" \ ":sample2=samples/KMSample2 Builds the second KeymanEngine sample app" \ - ":fv=../oem/firstvoices/ios Builds OEM FirstVoices for iOS platforms" \ + "${oemtargets[@]}" \ "--sim-artifact+ Also outputs a simulator-friendly test artifact corresponding to the build" builder_parse "$@" diff --git a/ios/tools/prepRelease.sh b/ios/tools/prepRelease.sh index 8065aad2f8c..c54748b548f 100755 --- a/ios/tools/prepRelease.sh +++ b/ios/tools/prepRelease.sh @@ -105,7 +105,7 @@ cd "$WORK_DIR" # FirstVoices app # -if [ "${RELEASE_OEM_FIRSTVOICES}" = true ]; then +if [[ "${RELEASE_OEM_FIRSTVOICES-false}" = true ]]; then FIRSTVOICESAPP_IPA="../oem/firstvoices/ios/build/Build/Products/Release-iphoneos/FirstVoices.ipa" FIRSTVOICESAPP_IPA_DST="firstvoices-ios-${KEYMAN_VERSION_FOR_FILENAME}.ipa" @@ -129,6 +129,6 @@ fi write_download_info "${UPLOAD_DIR}" "${KMEI_DST_NAME}" "Keyman Engine for iOS" zip ios write_download_info "${UPLOAD_DIR}" "${KEYMANAPP_IPA_DST}" "Keyman for iPhone and iPad" ipa ios -if [[ ${RELEASE_OEM_FIRSTVOICES} = true ]]; then +if [[ ${RELEASE_OEM_FIRSTVOICES-false} = true ]]; then write_download_info "${UPLOAD_DIR}" "${FIRSTVOICESAPP_IPA_DST}" "FirstVoices Keyboards" ipa ios fi