Merge pull request #14334 from keymanapp/maint/developer/usezipfunc

This makes use of `add_zip_files` where possible.

Fixes: #14332
Follow-up-of: #14093
This commit is contained in:
Eberhard Beilharz 2025-07-15 16:43:08 +02:00 committed by GitHub
commit d9810df377
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 48 deletions

View file

@ -20,9 +20,10 @@ builder_describe_outputs \
builder_parse "$@"
. "$KEYMAN_ROOT/resources/build/win/environment.inc.sh"
. "$KEYMAN_ROOT/resources/build/win/wix.inc.sh"
. "$KEYMAN_ROOT/resources/build/win/zip.inc.sh"
. "${KEYMAN_ROOT}/resources/build/win/environment.inc.sh"
. "${KEYMAN_ROOT}/resources/build/win/wix.inc.sh"
. "${KEYMAN_ROOT}/resources/build/win/zip.inc.sh"
. "${KEYMAN_ROOT}/resources/build/zip.inc.sh"
# In dev environments, we'll hack the tier to alpha; CI sets this for us in real builds.
if [[ -z ${KEYMAN_TIER+x} ]]; then
@ -246,22 +247,20 @@ function make-kmc-install-zip() {
builder_heading make-kmc-install-zip
copy-schemas
cd "${DEVELOPER_ROOT}/bin"
(
# shellcheck disable=2164
cd "${DEVELOPER_ROOT}/bin"
# TODO: rename this to keyman-developer-cli-$Version.zip
local KMCOMP_ZIP="${DEVELOPER_ROOT}/release/${KEYMAN_VERSION}/kmcomp-${KEYMAN_VERSION}.zip"
# TODO: rename this to keyman-developer-cli-$Version.zip
local KMCOMP_ZIP="${DEVELOPER_ROOT}/release/${KEYMAN_VERSION}/kmcomp-${KEYMAN_VERSION}.zip"
# shellcheck disable=SC2154
local COMPRESS_CMD="${SEVENZ_HOME}/7z"
"${COMPRESS_CMD}" a -bd -bb0 "${KMCOMP_ZIP}" \
kmconvert.exe \
keyboard_info.schema.json \
xml/layoutbuilder/*.keyman-touch-layout \
projects/ \
server/
cd "$THIS_SCRIPT_PATH"
add_zip_files "${KMCOMP_ZIP}" -q -r \
kmconvert.exe \
keyboard_info.schema.json \
xml/layoutbuilder/*.keyman-touch-layout \
projects/ \
server/
)
}
# TODO: are these required?

View file

@ -14,6 +14,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
# shellcheck disable=SC2154
. "${KEYMAN_ROOT}/resources/shellHelperFunctions.sh"
. "${KEYMAN_ROOT}/resources/zip.inc.sh"
. "${KEYMAN_ROOT}/resources/teamcity/includes/tc-helpers.inc.sh"
. "${KEYMAN_ROOT}/resources/teamcity/android/android-actions.inc.sh"
@ -45,7 +46,6 @@ function _publish_to_downloads_keyman_com() {
builder_echo start "publish to downloads.keyman.com" "Publishing release to downloads.keyman.com"
local UPLOAD_PATH KEYMAN_ENGINE_ANDROID_ZIP KEYMAN_APK FIRSTVOICES_APK
local COMPRESS_CMD
# shellcheck disable=SC2154
UPLOAD_PATH="${KEYMAN_ROOT}/android/upload/${KEYMAN_VERSION}"
@ -53,15 +53,12 @@ function _publish_to_downloads_keyman_com() {
KEYMAN_APK="keyman-${KEYMAN_VERSION}.apk"
FIRSTVOICES_APK="firstvoices-${KEYMAN_VERSION}.apk"
# shellcheck disable=SC2154
COMPRESS_CMD="${SEVENZ_HOME}/7z"
rm -rf "${UPLOAD_PATH}"
mkdir -p "${UPLOAD_PATH}"
(
cd "${KEYMAN_ROOT}/android/KMAPro/kMAPro/libs"
"${COMPRESS_CMD}" a -bd -bb0 "${UPLOAD_PATH}/${KEYMAN_ENGINE_ANDROID_ZIP}" keyman-engine.aar "${KEYMAN_ROOT}/android/Samples" '-xr!build.sh'
add_zip_files -q -xr!build.sh "${UPLOAD_PATH}/${KEYMAN_ENGINE_ANDROID_ZIP}" keyman-engine.aar "${KEYMAN_ROOT}/android/Samples"
)
cp "${KEYMAN_ROOT}/android/KMAPro/kMAPro/build/outputs/apk/release/${KEYMAN_APK}" "${UPLOAD_PATH}"

View file

@ -13,6 +13,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
## END STANDARD BUILD SCRIPT INCLUDE
. "${KEYMAN_ROOT}/resources/shellHelperFunctions.sh"
. "${KEYMAN_ROOT}/resources/build/zip.inc.sh"
. "${KEYMAN_ROOT}/resources/build/ci/pull-requests.inc.sh"
# This script runs from its own folder
@ -154,32 +155,12 @@ function prepare_downloads_keyman_com_action() {
mkdir -p "${UPLOAD_PATH}"
# On Windows, we use 7-zip (SEVENZ_HOME env var). On other platforms, we use zip.
COMPRESS_CMD=
COMPRESS_ADD=
# Marc's preference; use $SEVENZ_HOME and have the BAs set up with THAT as an env var.
if [[ ! -z "${SEVENZ_HOME+x}" ]]; then
COMPRESS_CMD="${SEVENZ_HOME}/7z"
COMPRESS_ADD="a -bd -bb0 -r" # add, hide progress, log level 0, recursive
fi
if [[ -z "${COMPRESS_CMD}" ]] ; then
if command -v zip &> /dev/null; then
# Note: does not support within-archive renames!
COMPRESS_CMD=zip
COMPRESS_ADD="-r"
else
builder_die "7z and zip commands are both unavailable"
fi
fi
pushd build/publish
# Zip both the 'debug' and 'release' configurations together.
# shellcheck disable=SC2086
"${COMPRESS_CMD}" ${COMPRESS_ADD} "${ZIP}" ./*
popd
(
# shellcheck disable=2164
cd build/publish
# Zip both the 'debug' and 'release' configurations together.
add_zip_files -q -r "${ZIP}" ./*
)
# --- Second action artifact - the 'static' folder (hosted user testing on downloads.keyman.com) ---