mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-16 05:39:24 +00:00
The default import path is relative to ldml-keyboard-xml-reader.js. The bundling of kmc with Keyman Developer reduces the directory tree depth, so we move the import path to be a subdirectory of the immediate parent directory, rather than two levels up, so that `C:\Program Files\Keyman\Keyman Developer\kmc` can refer to `C:\Program Files\Keyman\Keyman Developer\import` when kmc is bundled. Fixes: #12279
63 lines
2.4 KiB
Bash
Executable file
63 lines
2.4 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
## START STANDARD BUILD SCRIPT INCLUDE
|
|
# adjust relative paths as necessary
|
|
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
|
. "${THIS_SCRIPT%/*}/../../../../../resources/build/builder.inc.sh"
|
|
## END STANDARD BUILD SCRIPT INCLUDE
|
|
|
|
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
|
. "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh"
|
|
|
|
builder_describe "Build Keyman Developer web utility module" \
|
|
"@/common/web/types" \
|
|
"clean" \
|
|
"configure" \
|
|
"build" \
|
|
"api analyze API and prepare API documentation (no-op for now)" \
|
|
"test" \
|
|
publish \
|
|
"--npm-publish+ For publish, do a npm publish, not npm pack (only for CI)" \
|
|
"--dry-run,-n don't actually publish, just dry run"
|
|
|
|
builder_describe_outputs \
|
|
configure /node_modules \
|
|
build /developer/src/common/web/utils/build/src/index.js
|
|
|
|
builder_parse "$@"
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------
|
|
|
|
function copy_cldr_imports() {
|
|
# Store CLDR imports
|
|
# load all versions that have a cldr_info.json
|
|
for CLDR_INFO_PATH in "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/"*/cldr_info.json
|
|
do
|
|
# TODO-LDML: developer/src/inst/download.in.mak needs these also...
|
|
CLDR_PATH=$(dirname "$CLDR_INFO_PATH")
|
|
CLDR_VER=$(basename "$CLDR_PATH")
|
|
mkdir -p "$THIS_SCRIPT_PATH/build/src/types/import/$CLDR_VER"
|
|
# TODO-LDML: When these are copied, the DOCTYPE will break due to the wrong path. We don't use the DTD so it should be OK.
|
|
cp "$CLDR_INFO_PATH" "$CLDR_PATH/import/"*.xml "$THIS_SCRIPT_PATH/build/src/types/import/$CLDR_VER/"
|
|
done
|
|
}
|
|
|
|
function do_build() {
|
|
copy_cldr_imports
|
|
tsc --build
|
|
}
|
|
|
|
builder_run_action clean rm -rf ./build/
|
|
builder_run_action configure verify_npm_setup
|
|
builder_run_action build do_build
|
|
|
|
if builder_start_action test; then
|
|
eslint .
|
|
tsc --build test
|
|
readonly C8_THRESHOLD=40
|
|
c8 --reporter=lcov --reporter=text --exclude-after-remap --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha
|
|
builder_echo warning "Coverage thresholds are currently $C8_THRESHOLD%, which is lower than ideal."
|
|
builder_echo warning "Please increase threshold in build.sh as test coverage improves."
|
|
builder_finish_action success test
|
|
fi
|
|
|
|
builder_run_action publish builder_publish_npm
|