mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-06 14:07:32 +00:00
chore: Merge branch 'master' into chore/feature-esmodule-master-update
This commit is contained in:
commit
f7d082981c
53 changed files with 448 additions and 233 deletions
2
.github/workflows/deb-packaging.yml
vendored
2
.github/workflows/deb-packaging.yml
vendored
|
|
@ -62,7 +62,7 @@ jobs:
|
|||
shell: bash
|
||||
run: |
|
||||
THIS_SCRIPT="$GITHUB_WORKSPACE/.github/workflows/deb-packaging.yml"
|
||||
. "resources/build/build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
|
||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set prerelease tag as output parameter
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
# Keyman Version History
|
||||
|
||||
## 17.0.66 alpha 2023-03-13
|
||||
|
||||
* refactor(android): Use builder scripts (#7407)
|
||||
|
||||
## 17.0.65 alpha 2023-03-12
|
||||
|
||||
* refactor(core): consolidate wasm defs (#8409)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
17.0.66
|
||||
17.0.67
|
||||
|
|
@ -25,10 +25,8 @@ cd "$(dirname "$THIS_SCRIPT")"
|
|||
# "@../models/types" \ # is just a .d.ts, so there's nothing to actually BUILD.
|
||||
|
||||
builder_describe "Builds the lm-layer module" \
|
||||
"@../web/keyman-version" \
|
||||
"@../models/templates" \
|
||||
"@../models/wordbreakers" \
|
||||
"@../web/lm-worker" \
|
||||
"@/common/web/keyman-version" \
|
||||
"@/common/web/lm-worker" \
|
||||
"clean" \
|
||||
"configure" \
|
||||
"build" \
|
||||
|
|
@ -37,7 +35,7 @@ builder_describe "Builds the lm-layer module" \
|
|||
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build build/lib/web/index.mjs # is built by the final step.
|
||||
build /common/predictive-text/build/lib/web/index.mjs # is built by the final step.
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ cd "$(dirname "$THIS_SCRIPT")"
|
|||
################################ Main script ################################
|
||||
|
||||
builder_describe "Builds the standalone, headless form of Keyman Engine for Web's input-processor module" \
|
||||
"@../keyman-version" \
|
||||
"@../keyboard-processor" \
|
||||
"@../../predictive-text" \
|
||||
"@/common/web/keyman-version" \
|
||||
"@/common/web/keyboard-processor" \
|
||||
"@/common/predictive-text" \
|
||||
"@/developer/src/kmc-model test" \
|
||||
"clean" \
|
||||
"configure" \
|
||||
|
|
@ -31,7 +31,7 @@ builder_describe "Builds the standalone, headless form of Keyman Engine for Web'
|
|||
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build build/lib/index.mjs \
|
||||
build /common/web/input-processor/build/lib/index.mjs \
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -52,11 +52,11 @@ fi
|
|||
### BUILD ACTIONS
|
||||
|
||||
if builder_start_action build; then
|
||||
npm run tsc -- -b ./tsconfig.json
|
||||
tsc -b ./tsconfig.json
|
||||
node build-bundler.js
|
||||
|
||||
# Declaration bundling.
|
||||
npm run tsc -- --emitDeclarationOnly --outFile ./build/lib/index.d.ts
|
||||
tsc --emitDeclarationOnly --outFile ./build/lib/index.d.ts
|
||||
|
||||
builder_finish_action success build
|
||||
fi
|
||||
|
|
@ -69,7 +69,7 @@ if builder_start_action test; then
|
|||
FLAGS="--reporter mocha-teamcity-reporter"
|
||||
fi
|
||||
|
||||
npm run mocha -- --recursive $FLAGS ./tests/cases/
|
||||
mocha --recursive $FLAGS ./tests/cases/
|
||||
|
||||
builder_finish_action success test
|
||||
fi
|
||||
|
|
@ -19,9 +19,9 @@ cd "$THIS_SCRIPT_PATH"
|
|||
|
||||
builder_describe \
|
||||
"Compiles the web-oriented utility function module." \
|
||||
"@../recorder test" \
|
||||
"@../keyman-version" \
|
||||
"@../utils" \
|
||||
"@/common/web/recorder test" \
|
||||
"@/common/web/keyman-version" \
|
||||
"@/common/web/utils" \
|
||||
configure \
|
||||
clean \
|
||||
build \
|
||||
|
|
@ -30,7 +30,7 @@ builder_describe \
|
|||
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build build/lib/index.mjs
|
||||
build /common/web/keyboard-processor/build/lib/index.mjs
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -46,13 +46,13 @@ if builder_start_action clean; then
|
|||
fi
|
||||
|
||||
if builder_start_action build; then
|
||||
npm run tsc -- --build "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
tsc --build "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
node ./build-bundler.js
|
||||
|
||||
# Declaration bundling.
|
||||
npm run tsc -- --emitDeclarationOnly --outFile ./build/lib/index.d.ts
|
||||
npm run tsc -- --emitDeclarationOnly --outFile ./build/lib/dom-keyboard-loader.d.ts -p src/keyboards/loaders/tsconfig.dom.json
|
||||
npm run tsc -- --emitDeclarationOnly --outFile ./build/lib/node-keyboard-loader.d.ts -p src/keyboards/loaders/tsconfig.node.json
|
||||
tsc --emitDeclarationOnly --outFile ./build/lib/index.d.ts
|
||||
tsc --emitDeclarationOnly --outFile ./build/lib/dom-keyboard-loader.d.ts -p src/keyboards/loaders/tsconfig.dom.json
|
||||
tsc --emitDeclarationOnly --outFile ./build/lib/node-keyboard-loader.d.ts -p src/keyboards/loaders/tsconfig.node.json
|
||||
|
||||
builder_finish_action success build
|
||||
fi
|
||||
|
|
@ -68,8 +68,8 @@ if builder_start_action test; then
|
|||
KARMA_CONFIG=CI.conf.cjs
|
||||
fi
|
||||
|
||||
npm run mocha -- --recursive $MOCHA_FLAGS ./tests/node/
|
||||
npm run karma -- start ./tests/dom/$KARMA_CONFIG
|
||||
mocha --recursive $MOCHA_FLAGS ./tests/node/
|
||||
karma start ./tests/dom/$KARMA_CONFIG
|
||||
|
||||
builder_finish_action success test
|
||||
fi
|
||||
|
|
@ -28,7 +28,7 @@ builder_describe "Build the include script for current Keyman version" \
|
|||
|
||||
builder_describe_outputs \
|
||||
configure "/node_modules" \
|
||||
build "build/version.inc.js"
|
||||
build "/common/web/keyman-version/build/version.inc.js"
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ export class KEYMAN_VERSION {
|
|||
export default KEYMAN_VERSION;
|
||||
" > ./version.inc.ts
|
||||
|
||||
npm run tsc -- -b $builder_verbose
|
||||
tsc -b $builder_verbose
|
||||
# kmlmc (the lexical model compiler) relies on a Node-based import, but after some of the earlier
|
||||
# ES-modularization work, our main output's an ES module. Fortunately, esbuild can provide an easy stopgap.
|
||||
|
||||
|
|
|
|||
|
|
@ -26,16 +26,14 @@ WORKER_OUTPUT_FILENAME=build/lib/worker-main.js
|
|||
################################ Main script ################################
|
||||
|
||||
builder_describe \
|
||||
"Compiles the WebWorker module of Keyman's predictive-text engine as used for predictive text and autocorrective applications." \
|
||||
"@../keyman-version" \
|
||||
"@../../tools/sourcemap-path-remapper" \
|
||||
configure clean build test \
|
||||
"--ci Runs unit tests with CI reporting" \
|
||||
"--debug Includes full sources in the worker's sourcemap"
|
||||
"Compiles the Language Modeling Layer for common use in predictive text and autocorrective applications." \
|
||||
"@/common/web/keyman-version" \
|
||||
"@/common/tools/sourcemap-path-remapper" \
|
||||
configure clean build test
|
||||
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build build/lib/worker-main.wrapped.min.js
|
||||
build /common/web/lm-worker/build/lib/worker-main.wrapped.min.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -54,7 +52,7 @@ fi
|
|||
|
||||
if builder_start_action build; then
|
||||
# Build worker with tsc first
|
||||
npm run build -- $builder_verbose || builder_die "Could not build worker."
|
||||
tsc -b $builder_verbose || builder_die "Could not build worker."
|
||||
|
||||
|
||||
echo "Bundling worker modules"
|
||||
|
|
@ -80,7 +78,7 @@ if builder_start_action test; then
|
|||
MOCHA_FLAGS="$MOCHA_FLAGS --reporter mocha-teamcity-reporter"
|
||||
fi
|
||||
|
||||
npm run mocha -- --recursive $MOCHA_FLAGS ./src/test/cases/
|
||||
mocha --recursive $MOCHA_FLAGS ./src/test/cases/
|
||||
|
||||
builder_finish_action success test
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -19,14 +19,14 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
|||
|
||||
builder_describe \
|
||||
"Compiles the web-oriented utility function module." \
|
||||
"@../keyman-version" \
|
||||
"@/common/web/keyman-version" \
|
||||
configure \
|
||||
clean \
|
||||
build
|
||||
|
||||
builder_describe_outputs \
|
||||
configure "/node_modules" \
|
||||
build "build/obj/index.js"
|
||||
build "/common/web/recorder/build/obj/index.js"
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -36,11 +36,11 @@ if builder_start_action configure; then
|
|||
fi
|
||||
|
||||
if builder_start_action clean; then
|
||||
npm run tsc -- -b --clean "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
tsc --build --clean "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
builder_finish_action success clean
|
||||
fi
|
||||
|
||||
if builder_start_action build; then
|
||||
npm run tsc -- --build "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
tsc --build "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
builder_finish_action success build
|
||||
fi
|
||||
|
|
@ -47,7 +47,7 @@ if [ $FETCH_DEPS = true ]; then
|
|||
"$KEYMAN_ROOT/common/web/keyman-version/build.sh" || builder_die "Could not build keyman-version"
|
||||
fi
|
||||
|
||||
npm run tsc -- --build "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
tsc --build "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
if [ $? -ne 0 ]; then
|
||||
builder_die "Compilation of package for Sentry integration with KeymanWeb failed."
|
||||
fi
|
||||
|
|
@ -17,7 +17,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
|||
cd "$THIS_SCRIPT_PATH"
|
||||
|
||||
builder_describe "Build Keyman common file types module" \
|
||||
"@../keyman-version" \
|
||||
"@/common/web/keyman-version" \
|
||||
"configure" \
|
||||
"build" \
|
||||
"clean" \
|
||||
|
|
@ -26,7 +26,7 @@ builder_describe "Build Keyman common file types module" \
|
|||
"--dry-run,-n don't actually publish, just dry run"
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build build/src/main.js
|
||||
build /common/web/types/build/src/main.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,13 @@ cd "$THIS_SCRIPT_PATH"
|
|||
|
||||
builder_describe \
|
||||
"Compiles the web-oriented utility function module." \
|
||||
"@../keyman-version" \
|
||||
"@/common/web/keyman-version" \
|
||||
configure clean build test \
|
||||
"--ci For use with action ${BUILDER_TERM_START}test${BUILDER_TERM_END} - emits CI-friendly test reports"
|
||||
|
||||
builder_describe_outputs \
|
||||
configure "/node_modules" \
|
||||
build "build/lib/index.mjs"
|
||||
build "/common/web/utils/build/lib/index.mjs"
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -43,11 +43,11 @@ if builder_start_action build; then
|
|||
if builder_is_dep_build; then
|
||||
builder_echo "skipping tsc -b; will be completed by $builder_dep_parent"
|
||||
else
|
||||
npm run tsc -- --build "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
tsc --build "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
node build-bundler.js
|
||||
|
||||
# So... tsc does declaration-bundling on its own pretty well, at least for local development.
|
||||
npm run tsc -- --emitDeclarationOnly --outFile ./build/lib/index.d.ts
|
||||
tsc --emitDeclarationOnly --outFile ./build/lib/index.d.ts
|
||||
fi
|
||||
builder_finish_action success build
|
||||
fi
|
||||
|
|
@ -61,7 +61,7 @@ if builder_start_action test; then
|
|||
FLAGS="$FLAGS --reporter mocha-teamcity-reporter"
|
||||
fi
|
||||
|
||||
npm run mocha -- --recursive $FLAGS ./src/test/
|
||||
mocha --recursive $FLAGS ./src/test/
|
||||
|
||||
builder_finish_action success test
|
||||
fi
|
||||
|
|
@ -106,20 +106,20 @@ builder_describe_internal_dependency \
|
|||
build:mac build:mac-arm64
|
||||
|
||||
builder_describe_outputs \
|
||||
configure:x86 build/x86/$CONFIGURATION/build.ninja \
|
||||
configure:x64 build/x64/$CONFIGURATION/build.ninja \
|
||||
configure:mac build/mac/$CONFIGURATION/ \
|
||||
configure:mac-x86_64 build/mac-x86_64/$CONFIGURATION/build.ninja \
|
||||
configure:mac-arm64 build/mac-arm64/$CONFIGURATION/build.ninja \
|
||||
configure:arch build/arch/$CONFIGURATION/build.ninja \
|
||||
configure:wasm build/wasm/$CONFIGURATION/build.ninja \
|
||||
build:x86 build/x86/$CONFIGURATION/src/libkmnkbp0.a \
|
||||
build:x64 build/x64/$CONFIGURATION/src/libkmnkbp0.a \
|
||||
build:mac build/mac/$CONFIGURATION/libkmnkbp0.a \
|
||||
build:mac-x86_64 build/mac-x86_64/$CONFIGURATION/src/libkmnkbp0.a \
|
||||
build:mac-arm64 build/mac-arm64/$CONFIGURATION/src/libkmnkbp0.a \
|
||||
build:arch build/arch/$CONFIGURATION/src/libkmnkbp0.a \
|
||||
build:wasm build/wasm/$CONFIGURATION/src/libkmnkbp0.a
|
||||
configure:x86 /core/build/x86/$CONFIGURATION/build.ninja \
|
||||
configure:x64 /core/build/x64/$CONFIGURATION/build.ninja \
|
||||
configure:mac /core/build/mac/$CONFIGURATION/ \
|
||||
configure:mac-x86_64 /core/build/mac-x86_64/$CONFIGURATION/build.ninja \
|
||||
configure:mac-arm64 /core/build/mac-arm64/$CONFIGURATION/build.ninja \
|
||||
configure:arch /core/build/arch/$CONFIGURATION/build.ninja \
|
||||
configure:wasm /core/build/wasm/$CONFIGURATION/build.ninja \
|
||||
build:x86 /core/build/x86/$CONFIGURATION/src/libkmnkbp0.a \
|
||||
build:x64 /core/build/x64/$CONFIGURATION/src/libkmnkbp0.a \
|
||||
build:mac /core/build/mac/$CONFIGURATION/libkmnkbp0.a \
|
||||
build:mac-x86_64 /core/build/mac-x86_64/$CONFIGURATION/src/libkmnkbp0.a \
|
||||
build:mac-arm64 /core/build/mac-arm64/$CONFIGURATION/src/libkmnkbp0.a \
|
||||
build:arch /core/build/arch/$CONFIGURATION/src/libkmnkbp0.a \
|
||||
build:wasm /core/build/wasm/$CONFIGURATION/src/libkmnkbp0.a
|
||||
|
||||
# Iterate through all possible targets; note that targets that cannot be built
|
||||
# on the current platform have already been excluded through the archtargets
|
||||
|
|
|
|||
|
|
@ -168,7 +168,6 @@ cleanup_visual_studio_path() {
|
|||
_new_path="$_new_path:$p"
|
||||
fi
|
||||
done
|
||||
echo
|
||||
PATH="${_new_path:1}"
|
||||
unset VSINSTALLDIR
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -28,7 +28,7 @@ builder_describe "Build Keyman kmc Keyboard Compiler module" \
|
|||
"--dry-run,-n don't actually publish, just dry run"
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build build/src/main.js
|
||||
build /developer/src/kmc-keyboard/build/src/main.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ cd "$THIS_SCRIPT_PATH"
|
|||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
||||
|
||||
builder_describe "Build Keyman kmc Lexical Model model-info Compiler module" \
|
||||
"@../kmc-package" \
|
||||
"@/developer/src/kmc-package" \
|
||||
"configure" \
|
||||
"build" \
|
||||
"clean" \
|
||||
|
|
@ -26,7 +26,7 @@ builder_describe "Build Keyman kmc Lexical Model model-info Compiler module" \
|
|||
"--dry-run,-n don't actually publish, just dry run"
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build build/src/model-info-compiler.js
|
||||
build /developer/src/kmc-model-info/build/src/model-info-compiler.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ builder_describe "Build Keyman kmc Lexical Model Compiler module" \
|
|||
"--dry-run,-n don't actually publish, just dry run"
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build build/src/main.js
|
||||
build /developer/src/kmc-model/build/src/main.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ builder_describe "Build Keyman kmc Package Compiler module" \
|
|||
"--dry-run,-n don't actually publish, just dry run"
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build build/src/kmp-compiler.js
|
||||
build /developer/src/kmc-package/build/src/kmp-compiler.js
|
||||
builder_parse "$@"
|
||||
|
||||
#-------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ cd "$THIS_SCRIPT_PATH"
|
|||
builder_describe "Build Keyman Keyboard Compiler kmc" \
|
||||
"@/common/web/keyman-version" \
|
||||
"@/common/web/types" \
|
||||
"@../kmc-keyboard" \
|
||||
"@../kmc-model" \
|
||||
"@../kmc-model-info" \
|
||||
"@../kmc-package" \
|
||||
"@/developer/src/kmc-keyboard" \
|
||||
"@/developer/src/kmc-model" \
|
||||
"@/developer/src/kmc-model-info" \
|
||||
"@/developer/src/kmc-package" \
|
||||
"configure runs 'npm ci' on root folder" \
|
||||
"build (default) builds kmc to build/" \
|
||||
"clean cleans build/ folder" \
|
||||
|
|
@ -33,7 +33,7 @@ builder_describe "Build Keyman Keyboard Compiler kmc" \
|
|||
"--dry-run,-n don't actually publish, just dry run"
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build build/src/kmc.js
|
||||
build /developer/src/kmc/build/src/kmc.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh"
|
||||
|
|
@ -16,42 +16,42 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
|||
|
||||
# Tests
|
||||
|
||||
echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER not set${COLOR_RESET}"
|
||||
builder_echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER not set${COLOR_RESET}"
|
||||
if ! builder_pull_get_details; then
|
||||
echo "PASS: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER is not set"
|
||||
builder_echo "PASS: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER is not set"
|
||||
else
|
||||
builder_die "FAIL: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER is not set"
|
||||
fi
|
||||
|
||||
|
||||
echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=master${COLOR_RESET}"
|
||||
builder_echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=master${COLOR_RESET}"
|
||||
TEAMCITY_PR_NUMBER=master
|
||||
if ! builder_pull_get_details; then
|
||||
echo "PASS: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER=master"
|
||||
builder_echo "PASS: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER=master"
|
||||
else
|
||||
builder_die "FAIL: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER=master"
|
||||
fi
|
||||
|
||||
|
||||
echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=$TEAMCITY_PR_NUMBER${COLOR_RESET}"
|
||||
builder_echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=$TEAMCITY_PR_NUMBER${COLOR_RESET}"
|
||||
TEAMCITY_PR_NUMBER=7248
|
||||
if ! builder_pull_get_details; then
|
||||
builder_die "FAIL: builder_pull_get_details was unable to read and parse PR details for #$TEAMCITY_PR_NUMBER from GitHub"
|
||||
fi
|
||||
|
||||
# print metadata from PR
|
||||
echo " pull number: $builder_pull_number"
|
||||
echo " title: $builder_pull_title"
|
||||
echo " labels: ${builder_pull_labels[*]}"
|
||||
builder_echo " pull number: $builder_pull_number"
|
||||
builder_echo " title: $builder_pull_title"
|
||||
builder_echo " labels: ${builder_pull_labels[*]}"
|
||||
|
||||
echo "PASS: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=$TEAMCITY_PR_NUMBER"
|
||||
builder_echo "PASS: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=$TEAMCITY_PR_NUMBER"
|
||||
|
||||
|
||||
echo "${COLOR_BLUE}## Testing: builder_pull_has_label epic-ldml${COLOR_RESET}"
|
||||
builder_echo "${COLOR_BLUE}## Testing: builder_pull_has_label epic-ldml${COLOR_RESET}"
|
||||
if ! builder_pull_has_label epic-ldml; then
|
||||
builder_die "FAIL: builder_pull_has_label epic-ldml"
|
||||
fi
|
||||
|
||||
echo "PASS: builder_pull_has_label epic-ldml"
|
||||
builder_echo "PASS: builder_pull_has_label epic-ldml"
|
||||
|
||||
echo "All tests passed."
|
||||
builder_echo "All tests passed."
|
||||
|
|
|
|||
|
|
@ -86,10 +86,15 @@ This somewhat unwieldy incantation handles all our build environments.
|
|||
The intent is to get a good solid consistent path for the script so that we can
|
||||
safely include the build script, no matter what `pwd` is when the script is run.
|
||||
|
||||
|
||||
The only modification permissible in this block is the
|
||||
`<relative-path-to-repo-root>` text which will be a series of `../` paths taking
|
||||
us to the repository root from the location of the script itself.
|
||||
|
||||
It is essential to make the include relative to the repo root, even for scripts
|
||||
under the resources/ folder. Doing this gives us significant performance
|
||||
benefits.
|
||||
|
||||
Inclusion of other scripts should be kept outside this standard build script
|
||||
include section, as we may programatically update (a.ka. global
|
||||
search-and-replace) this section in the future as required.
|
||||
|
|
@ -113,6 +118,15 @@ following line here:
|
|||
cd "$THIS_SCRIPT_PATH"
|
||||
```
|
||||
|
||||
## Standard environment
|
||||
|
||||
`build-utils.sh` will prepend `$KEYMAN_ROOT/node_modules/.bin` to the `PATH`
|
||||
variable to ensure that we run the correct versions of npm package commands, so
|
||||
there is no need to hard-code path references or add script wrappers to
|
||||
package.json (`npm run <script>`).
|
||||
|
||||
Other environment variables and paths will probably be added over time.
|
||||
|
||||
## Split
|
||||
|
||||
The comment line splitting the prologue from the body of the script is optional,
|
||||
|
|
@ -814,6 +828,22 @@ builder_describe "sample" \
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
## `builder_trim` function
|
||||
|
||||
Trims leading and following whitespace from the input parameters.
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
my_string="$(builder_trim "$my_string")"
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
* `my_string` An input string
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
## `builder_use_color` function
|
||||
|
||||
This will normally be managed internally by build-utils, but can be manually
|
||||
|
|
|
|||
|
|
@ -35,17 +35,17 @@
|
|||
SHLVL=0
|
||||
|
||||
function findKeymanRoot() {
|
||||
# See https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself
|
||||
# None of the answers are 100% correct for cross-platform
|
||||
# On macOS, requires coreutils (`brew install coreutils`)
|
||||
local SCRIPT=$(readlink -f "${BASH_SOURCE[0]}")
|
||||
KEYMAN_ROOT="${SCRIPT%/*/*/*}"
|
||||
readonly KEYMAN_ROOT
|
||||
# We don't need readlink here because our standard script prolog does a
|
||||
# readlink -f already so we will have already escaped from any symlinks
|
||||
# But we still need to canonicalize paths to remove ../../..
|
||||
KEYMAN_ROOT="${BASH_SOURCE[0]%/*/*/*}"
|
||||
KEYMAN_ROOT="$( cd "$KEYMAN_ROOT" && echo "$PWD" )"
|
||||
readonly KEYMAN_ROOT
|
||||
}
|
||||
|
||||
function findVersion() {
|
||||
local VERSION_MD="$KEYMAN_ROOT/VERSION.md"
|
||||
VERSION=`cat $VERSION_MD | tr -d "[:space:]"`
|
||||
VERSION=$(builder_trim $(<"$VERSION_MD"))
|
||||
[[ "$VERSION" =~ ^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$ ]] && {
|
||||
VERSION_MAJOR="${BASH_REMATCH[1]}"
|
||||
VERSION_MINOR="${BASH_REMATCH[2]}"
|
||||
|
|
@ -119,12 +119,12 @@ function findVersion() {
|
|||
}
|
||||
|
||||
function findTier() {
|
||||
local TIER_MD="$KEYMAN_ROOT/TIER.md"
|
||||
TIER=`cat $TIER_MD | tr -d "[:space:]"`
|
||||
[[ "$TIER" =~ ^(alpha|beta|stable)$ ]] || {
|
||||
echo "Invalid TIER.md file: expected alpha, beta or stable."
|
||||
exit 1;
|
||||
}
|
||||
local TIER_MD="$KEYMAN_ROOT/TIER.md"
|
||||
TIER=$(builder_trim $(<"$TIER_MD"))
|
||||
[[ "$TIER" =~ ^(alpha|beta|stable)$ ]] || {
|
||||
echo "Invalid TIER.md file: expected alpha, beta or stable."
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
function printBuildNumberForTeamCity() {
|
||||
|
|
@ -171,11 +171,13 @@ function findShouldSentryRelease() {
|
|||
}
|
||||
|
||||
findKeymanRoot
|
||||
findTier
|
||||
findVersion
|
||||
|
||||
# Source builder_script
|
||||
. "$KEYMAN_ROOT/resources/builder.inc.sh"
|
||||
|
||||
findTier
|
||||
findVersion
|
||||
|
||||
# printVersionUtilsDebug
|
||||
printBuildNumberForTeamCity
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ set -u
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ set -u
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "${THIS_SCRIPT%/*}/trigger-definitions.inc.sh"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ set -u
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ function debug_echo() {
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "${THIS_SCRIPT%/*}/trigger-definitions.inc.sh"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
||||
|
|
@ -87,7 +87,7 @@ builder_parse_test() {
|
|||
shift
|
||||
shift
|
||||
local parameters="$@"
|
||||
echo "${COLOR_BLUE}## Testing: builder_parse $parameters${COLOR_RESET}"
|
||||
echo -e "${COLOR_BLUE}## Testing: builder_parse $parameters${COLOR_RESET}"
|
||||
builder_parse $parameters || builder_die "builder_parse died under curious circumstances"
|
||||
if [[ "$expected" != "${_builder_chosen_action_targets[@]}" ]]; then
|
||||
builder_die " Test: builder_parse $parameters action:target != \"$expected\""
|
||||
|
|
@ -128,7 +128,7 @@ fi
|
|||
|
||||
# Test --feature <foo>
|
||||
|
||||
echo "${COLOR_BLUE}## Testing: builder_parse --feature xyzzy${COLOR_RESET}"
|
||||
echo -e "${COLOR_BLUE}## Testing: builder_parse --feature xyzzy${COLOR_RESET}"
|
||||
builder_parse --feature xyzzy
|
||||
|
||||
if builder_has_option --feature; then
|
||||
|
|
@ -156,24 +156,24 @@ fi
|
|||
|
||||
# Due to the nature of the build-utils-traps tests, only one may be
|
||||
# specified at a time; each ends with an `exit`.
|
||||
echo "${COLOR_BLUE}## Running trap tests${COLOR_RESET}"
|
||||
echo -e "${COLOR_BLUE}## Running trap tests${COLOR_RESET}"
|
||||
$THIS_SCRIPT_PATH/build-utils-traps.test.sh error
|
||||
$THIS_SCRIPT_PATH/build-utils-traps.test.sh error-in-function
|
||||
$THIS_SCRIPT_PATH/build-utils-traps.test.sh incomplete
|
||||
echo "${COLOR_BLUE}## Running dependency tests${COLOR_RESET}"
|
||||
echo -e "${COLOR_BLUE}## Running dependency tests${COLOR_RESET}"
|
||||
$THIS_SCRIPT_PATH/builder-deps.test.sh
|
||||
$THIS_SCRIPT_PATH/dependencies/test.sh
|
||||
|
||||
echo "${COLOR_BLUE}## End external tests${COLOR_RESET}"
|
||||
echo -e "${COLOR_BLUE}## End external tests${COLOR_RESET}"
|
||||
echo
|
||||
|
||||
(
|
||||
# Finally, run with --help so we can see what it looks like; note:
|
||||
# builder_parse calls `exit 0` on a --help run, so running in a subshell
|
||||
echo "${COLOR_BLUE}## Testing --help${COLOR_RESET}"
|
||||
echo -e "${COLOR_BLUE}## Testing --help${COLOR_RESET}"
|
||||
builder_parse --no-color --help
|
||||
) || builder_die "FAIL: builder-parse returned failure code $? unexpectedly"
|
||||
|
||||
echo "${COLOR_GREEN}======================================================${COLOR_RESET}"
|
||||
echo "${COLOR_GREEN}All tests passed successfully${COLOR_RESET}"
|
||||
echo "${COLOR_GREEN}======================================================${COLOR_RESET}"
|
||||
echo -e "${COLOR_GREEN}======================================================${COLOR_RESET}"
|
||||
echo -e "${COLOR_GREEN}All tests passed successfully${COLOR_RESET}"
|
||||
echo -e "${COLOR_GREEN}======================================================${COLOR_RESET}"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
builder_describe \
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -eu
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../../build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
cd "$THIS_SCRIPT_PATH"
|
||||
|
|
|
|||
23
resources/build/tests/verify-colors.test.sh
Executable file
23
resources/build/tests/verify-colors.test.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
|
||||
# END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
builder_use_color true
|
||||
builder_echo "${COLOR_RED}COLOR_RED${COLOR_RESET}"
|
||||
builder_echo "${COLOR_GREEN}COLOR_GREEN${COLOR_RESET}"
|
||||
builder_echo "${COLOR_YELLOW}COLOR_YELLOW${COLOR_RESET}"
|
||||
builder_echo "${COLOR_BLUE}COLOR_BLUE${COLOR_RESET}"
|
||||
builder_echo "${COLOR_PURPLE}COLOR_PURPLE${COLOR_RESET}"
|
||||
builder_echo "${COLOR_TEAL}COLOR_TEAL${COLOR_RESET}"
|
||||
builder_echo "${COLOR_WHITE}COLOR_WHITE${COLOR_RESET}"
|
||||
builder_echo "${COLOR_BRIGHT_WHITE}COLOR_BRIGHT_WHITE${COLOR_RESET}"
|
||||
builder_echo "${COLOR_GREY}COLOR_GREY${COLOR_RESET}"
|
||||
builder_echo "${COLOR_RESET}COLOR_RESET${COLOR_RESET}"
|
||||
builder_echo "${BUILDER_BOLD}BUILDER_BOLD${COLOR_RESET}"
|
||||
builder_echo "${HEADING_SETMARK}HEADING_SETMARK${COLOR_RESET}"
|
||||
|
|
@ -27,11 +27,9 @@ function _builder_init() {
|
|||
}
|
||||
|
||||
function _builder_findRepoRoot() {
|
||||
# See https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself
|
||||
# None of the answers are 100% correct for cross-platform
|
||||
# On macOS, requires coreutils (`brew install coreutils`)
|
||||
local SCRIPT=$(readlink -f "${BASH_SOURCE[0]}")
|
||||
REPO_ROOT="${SCRIPT%/*/*}"
|
||||
# We don't need readlink here because our standard script prolog does a
|
||||
# readlink -f already so we will have already escaped from any symlinks
|
||||
REPO_ROOT="${BASH_SOURCE[0]%/*/*}"
|
||||
readonly REPO_ROOT
|
||||
}
|
||||
|
||||
|
|
@ -77,20 +75,20 @@ function _builder_setBuildScriptIdentifiers() {
|
|||
# 1: use_color true or false
|
||||
builder_use_color() {
|
||||
if $1; then
|
||||
COLOR_RED=$(tput setaf 1)
|
||||
COLOR_GREEN=$(tput setaf 2)
|
||||
COLOR_YELLOW=$(tput setaf 3)
|
||||
COLOR_BLUE=$(tput setaf 4)
|
||||
COLOR_PURPLE=$(tput setaf 5)
|
||||
COLOR_TEAL=$(tput setaf 6)
|
||||
COLOR_WHITE=$(tput setaf 252)
|
||||
COLOR_BRIGHT_WHITE=$(tput setaf 255)
|
||||
COLOR_GREY=$(tput setaf 8)
|
||||
COLOR_RESET=$(tput sgr0)
|
||||
# Using esc codes instead of tput for performance
|
||||
COLOR_RED='\x1b[31m' # $(tput setaf 1)
|
||||
COLOR_GREEN='\x1b[32m' # $(tput setaf 2)
|
||||
COLOR_YELLOW='\x1b[33m' # $(tput setaf 3)
|
||||
COLOR_BLUE='\x1b[34m' # $(tput setaf 4)
|
||||
COLOR_PURPLE='\x1b[35m' # $(tput setaf 5)
|
||||
COLOR_TEAL='\x1b[36m' # $(tput setaf 6)
|
||||
COLOR_WHITE='\x1b[38;5;252m' # $(tput setaf 252)
|
||||
COLOR_BRIGHT_WHITE='\x1b[38;5;255m' # $(tput setaf 255)
|
||||
COLOR_GREY='\x1b[90m' # $(tput setaf 8)
|
||||
COLOR_RESET='\x1b(B\x1b[m' # $(tput sgr0)
|
||||
# e.g. VSCode https://code.visualstudio.com/updates/v1_69#_setmark-sequence-support
|
||||
BUILDER_BOLD=$(tput bold)
|
||||
BUILDER_BOLD='\x1b[1m' # $(tput bold)
|
||||
HEADING_SETMARK='\x1b]1337;SetMark\x07'
|
||||
|
||||
# Used by `builder_display_usage` when marking special terms (actions, targets, options)
|
||||
# in the plain-text description area.
|
||||
BUILDER_TERM_START="$COLOR_BLUE"
|
||||
|
|
@ -150,12 +148,11 @@ function builder_heading() {
|
|||
|
||||
builder_echo() {
|
||||
local color=white message= mark=
|
||||
if [[ $# -gt 1 ]]; then
|
||||
if [[ $# -gt 1 && $1 =~ ^(white|grey|green|success|blue|heading|yellow|warning|red|error|purple|brightwhite|teal|debug|setmark)$ ]]; then
|
||||
color="$1"
|
||||
message="$2"
|
||||
else
|
||||
message="$1"
|
||||
shift
|
||||
fi
|
||||
message="$*"
|
||||
|
||||
if [[ ! -z ${COLOR_RED+x} ]]; then
|
||||
case $color in
|
||||
|
|
@ -235,6 +232,67 @@ _builder_item_in_glob_array() {
|
|||
return 1
|
||||
}
|
||||
|
||||
#
|
||||
# Expands a shorthand item into a full match from an array of possibilities;
|
||||
# reports an error if there are ambiguous options. Note that this function
|
||||
# returns the number of matches, so 0 = no match, 1 = a precise match.
|
||||
#
|
||||
# ### Parameters
|
||||
#
|
||||
# * 1: `item` item to search for in array, e.g. "t"
|
||||
# * 2: `array` bash array, e.g. `array=(one two three)`
|
||||
#
|
||||
# ### Description
|
||||
#
|
||||
# Does a substring search by regex for
|
||||
#
|
||||
# ### Example
|
||||
#
|
||||
# ```bash
|
||||
# actions=(clean configure build test)
|
||||
#
|
||||
# action=`_builder_expand_shorthand $1 "${actions[@]}"` &&
|
||||
# builder_die "Unrecognized parameter $1" ||
|
||||
# case $? in
|
||||
# 1) echo "Parameter $1 matches {$action}"
|
||||
# ;;
|
||||
# *) builder_die "Parameter $1 has $? matches, could mean any of {$action}"
|
||||
# esac
|
||||
# ```
|
||||
#
|
||||
_builder_expand_shorthand() {
|
||||
local item=$1
|
||||
shift
|
||||
local count=0
|
||||
local result=
|
||||
for e; do
|
||||
if [[ $e == $item ]]; then
|
||||
# Exact match trumps substring matches
|
||||
echo $item
|
||||
return 1
|
||||
fi
|
||||
if [[ $e == "$item"* ]]; then
|
||||
count=$((count+1))
|
||||
if [[ $count == 2 ]]; then
|
||||
printf "$result"
|
||||
printf ", $e"
|
||||
result=$item
|
||||
elif [[ $count -gt 2 ]]; then
|
||||
printf ", $e"
|
||||
else
|
||||
result=$e
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $count -lt 2 ]]; then
|
||||
echo $result
|
||||
else
|
||||
echo
|
||||
fi
|
||||
return $count
|
||||
}
|
||||
|
||||
|
||||
_builder_item_is_target() {
|
||||
local item="$1"
|
||||
|
|
@ -273,7 +331,7 @@ _builder_failure_trap() {
|
|||
if [ -n "${_builder_current_action}" ]; then
|
||||
action="${_builder_current_action}"
|
||||
if [[ $action =~ : ]]; then
|
||||
IFS=: read -r action target <<< $action
|
||||
IFS=: read -r action target <<< "$action"
|
||||
target=:$target
|
||||
else
|
||||
target=:project
|
||||
|
|
@ -345,7 +403,7 @@ _builder_run_child_action() {
|
|||
local action="$1" target
|
||||
|
||||
if [[ $action =~ : ]]; then
|
||||
IFS=: read -r action target <<< $action
|
||||
IFS=: read -r action target <<< "$action"
|
||||
target=:$target
|
||||
else
|
||||
target=':*'
|
||||
|
|
@ -433,7 +491,7 @@ builder_has_action() {
|
|||
local action="$1" target
|
||||
|
||||
if [[ $action =~ : ]]; then
|
||||
IFS=: read -r action target <<< $action
|
||||
IFS=: read -r action target <<< "$action"
|
||||
target=:$target
|
||||
else
|
||||
target=':*'
|
||||
|
|
@ -521,7 +579,20 @@ builder_has_option() {
|
|||
return 1
|
||||
}
|
||||
|
||||
_builder_trim() {
|
||||
#
|
||||
# Trims leading and following whitespace from the input parameters
|
||||
#
|
||||
# ### Usage
|
||||
#
|
||||
# ```bash
|
||||
# my_string="$(builder_trim "$my_string")"
|
||||
# ```
|
||||
#
|
||||
# ### Parameters
|
||||
#
|
||||
# * `my_string` An input string
|
||||
#
|
||||
builder_trim() {
|
||||
local var="$*"
|
||||
# remove leading whitespace characters
|
||||
var="${var#"${var%%[![:space:]]*}"}"
|
||||
|
|
@ -559,10 +630,9 @@ _builder_expand_relative_path() {
|
|||
_builder_expand_action_target() {
|
||||
local input="$1" target= action=
|
||||
if [[ "$input" =~ : ]]; then
|
||||
action=$(echo "$input" | cut -d: -f 1 -)
|
||||
target=$(echo "$input" | cut -d: -f 2 -)
|
||||
IFS=":" read -r action target <<< "$input"
|
||||
else
|
||||
action=$input
|
||||
action="$input"
|
||||
fi
|
||||
|
||||
if [[ -z "$action" ]]; then
|
||||
|
|
@ -578,8 +648,8 @@ _builder_expand_action_target() {
|
|||
_builder_expand_action_targets() {
|
||||
local input=($1) e output=()
|
||||
for e in "${input[@]}"; do
|
||||
e=`_builder_expand_action_target "$e"`
|
||||
output+=($e)
|
||||
e="$(_builder_expand_action_target "$e")"
|
||||
output+=("$e")
|
||||
done
|
||||
if [[ ${#output[@]} == 0 ]]; then
|
||||
echo "*:*"
|
||||
|
|
@ -678,13 +748,16 @@ builder_describe() {
|
|||
declare -A -g _builder_target_paths # array of target child project paths
|
||||
declare -A -g _builder_dep_targets # array of :targets given for a specific dependency (comma separated if more than one)
|
||||
shift
|
||||
local sub=()
|
||||
# describe each target, action, and option possibility
|
||||
while [[ $# -gt 0 ]]; do
|
||||
local key="$1"
|
||||
local value="$(echo "$key" | cut -d" " -f 1 -)"
|
||||
local value="$key"
|
||||
local description=
|
||||
if [[ $key =~ [[:space:]] ]]; then
|
||||
description="$(_builder_trim "$(echo "$key" | cut -d" " -f 2- -)")"
|
||||
IFS=" " read -r -a sub <<< "$key"
|
||||
value="${sub[0]}"
|
||||
description="$(builder_trim "${sub[@]:1}")"
|
||||
fi
|
||||
|
||||
if [[ $value =~ ^: ]]; then
|
||||
|
|
@ -692,8 +765,9 @@ builder_describe() {
|
|||
local target_path=
|
||||
if [[ $value =~ = ]]; then
|
||||
# The target has a custom child project path
|
||||
target_path="$(echo "$value" | cut -d= -f 2 -)"
|
||||
value="$(echo "$value" | cut -d= -f 1 -)"
|
||||
IFS="=" read -r -a sub <<< "$value"
|
||||
target_path="${sub[@]:1}"
|
||||
value="${sub[0]}"
|
||||
if [[ ! -d "$THIS_SCRIPT_PATH/$target_path" ]]; then
|
||||
builder_die "Target path '$target_path' for $value does not exist."
|
||||
fi
|
||||
|
|
@ -713,13 +787,13 @@ builder_describe() {
|
|||
local dependency="${value:1}"
|
||||
local dependency_target= # all targets
|
||||
if [[ $dependency =~ : ]]; then
|
||||
dependency_target=":$(echo "$dependency" | cut -d: -f 2 -)"
|
||||
dependency="$(echo "$dependency" | cut -d: -f 1 -)"
|
||||
IFS=":" read -r dependency dependency_target <<< "$dependency"
|
||||
dependency_target=":$dependency_target"
|
||||
fi
|
||||
|
||||
dependency="`_builder_expand_relative_path "$dependency"`"
|
||||
_builder_deps+=($dependency)
|
||||
_builder_dep_related_actions[$dependency]="`_builder_expand_action_targets "$description"`"
|
||||
_builder_dep_related_actions[$dependency]="$(_builder_expand_action_targets "$description")"
|
||||
_builder_dep_targets[$dependency]="$dependency_target"
|
||||
# We don't want to add deps to params, so shift+continue
|
||||
shift
|
||||
|
|
@ -729,8 +803,9 @@ builder_describe() {
|
|||
# Look for a shorthand version of the option
|
||||
local option_var=
|
||||
if [[ $value =~ = ]]; then
|
||||
option_var="$(echo "$value" | cut -d= -f 2 -)"
|
||||
value="$(echo "$value" | cut -d= -f 1 -)"
|
||||
IFS="=" read -r -a sub <<< "$value"
|
||||
option_var="${sub[@]:1}"
|
||||
value="${sub[0]}"
|
||||
fi
|
||||
|
||||
local is_inheritable=false
|
||||
|
|
@ -742,8 +817,9 @@ builder_describe() {
|
|||
fi
|
||||
|
||||
if [[ $value =~ , ]]; then
|
||||
local option_long="$(echo "$value" | cut -d, -f 1 -)"
|
||||
local option_short="$(echo "$value" | cut -d, -f 2 -)"
|
||||
IFS="," read -r -a sub <<< "$value"
|
||||
local option_long="${sub[0]}"
|
||||
local option_short="${sub[@]:1}"
|
||||
_builder_options+=($option_long)
|
||||
if $is_inheritable; then
|
||||
_builder_options_inheritable+=($option_long)
|
||||
|
|
@ -824,12 +900,12 @@ function builder_describe_outputs() {
|
|||
_builder_record_function_call builder_describe_outputs
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
local key="$1" path="$2" action target
|
||||
local key="$1" path="$2" action= target=
|
||||
path="`_builder_expand_relative_path "$path"`"
|
||||
|
||||
if [[ $key =~ : ]]; then
|
||||
action="$(echo "$key" | cut -d: -f 1 -)"
|
||||
target=":$(echo "$key" | cut -d: -f 2 -)"
|
||||
IFS=":" read -r action target <<< "$key"
|
||||
target=":$target"
|
||||
else
|
||||
# Add dependency expected output file for all targets, as well as a
|
||||
# wildcard target match
|
||||
|
|
@ -1015,19 +1091,72 @@ builder_describe_internal_dependency() {
|
|||
# Parameters
|
||||
# 1: $@ command-line arguments
|
||||
builder_parse() {
|
||||
|
||||
_builder_record_function_call builder_parse
|
||||
|
||||
local _builder_params="$@"
|
||||
local exp=()
|
||||
builder_extra_params=()
|
||||
|
||||
while [[ $# -gt 0 ]] ; do
|
||||
local action= target=
|
||||
local key="$1"
|
||||
if [[ $key == "--" ]]; then
|
||||
shift
|
||||
builder_extra_params=("$@")
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ $key =~ ^- ]]; then
|
||||
exp+=($key)
|
||||
else
|
||||
# Expand comma separated values
|
||||
if [[ $key =~ : ]]; then
|
||||
IFS=: read -r action target <<< "$key"
|
||||
else
|
||||
action="$key"
|
||||
target=
|
||||
fi
|
||||
|
||||
local actions targets
|
||||
IFS=, read -r -a actions <<< "$action"
|
||||
IFS=, read -r -a targets <<< "$target"
|
||||
|
||||
if [[ "${#actions[@]}" -eq 0 ]]; then
|
||||
# No actions, so must be at least one :target
|
||||
for target in "${targets[@]}"; do
|
||||
exp+=(:$target)
|
||||
done
|
||||
else
|
||||
for action in "${actions[@]}"; do
|
||||
if [[ "${#targets[@]}" -eq 0 ]]; then
|
||||
# No :targets so just expand actions
|
||||
exp+=($action)
|
||||
else
|
||||
# Actions:targets, expand them all
|
||||
for target in "${targets[@]}"; do
|
||||
exp+=($action:$target)
|
||||
done
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
_builder_parse_expanded_parameters "${exp[@]}"
|
||||
}
|
||||
|
||||
_builder_parse_expanded_parameters() {
|
||||
_builder_build_deps=--deps
|
||||
builder_verbose=
|
||||
builder_debug=
|
||||
builder_extra_params=()
|
||||
local _params=($@)
|
||||
_builder_chosen_action_targets=()
|
||||
_builder_chosen_options=()
|
||||
_builder_current_action=
|
||||
|
||||
local n=0
|
||||
|
||||
# Process command-line arguments
|
||||
while [[ $# -gt 0 ]] ; do
|
||||
local key="$1"
|
||||
|
|
@ -1035,23 +1164,47 @@ builder_parse() {
|
|||
local target=
|
||||
local e has_action has_target has_option longhand_option
|
||||
|
||||
if [[ $key == "--" ]]; then
|
||||
shift
|
||||
builder_extra_params=("$@")
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ $key =~ : ]]; then
|
||||
IFS=: read -r action target <<< $key
|
||||
IFS=: read -r action target <<< "$key"
|
||||
target=:$target
|
||||
else
|
||||
action="$key"
|
||||
target=
|
||||
fi
|
||||
|
||||
# Expand shorthand parameters
|
||||
|
||||
new_action=$(_builder_expand_shorthand $action "${_builder_actions[@]}") ||
|
||||
case $? in
|
||||
1)
|
||||
action=$new_action
|
||||
;;
|
||||
*)
|
||||
builder_warn "Parameter $action has $? matches, could mean any of {$new_action}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
new_target=$(_builder_expand_shorthand $target "${_builder_targets[@]}") ||
|
||||
case $? in
|
||||
1)
|
||||
target=$new_target
|
||||
;;
|
||||
*)
|
||||
builder_warn "Parameter $target has $? matches, could mean any of {$new_target}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
_builder_item_in_array "$action" "${_builder_actions[@]}" && has_action=1 || has_action=0
|
||||
_builder_item_in_array "$target" "${_builder_targets[@]}" && has_target=1 || has_target=0
|
||||
|
||||
if (( has_action )) || (( has_target )); then
|
||||
# Document parameter expansion for end use
|
||||
_params[$n]=$action$target
|
||||
fi
|
||||
n=$((n + 1))
|
||||
|
||||
# Expand short -o to --option in options lookup
|
||||
if [[ ! -z ${_builder_options_short[$key]+x} ]]; then
|
||||
key=${_builder_options_short[$key]}
|
||||
|
|
@ -1060,7 +1213,7 @@ builder_parse() {
|
|||
|
||||
if (( has_action )) && (( has_target )); then
|
||||
# apply the selected action and selected target
|
||||
_builder_chosen_action_targets+=("$key")
|
||||
_builder_chosen_action_targets+=("$action$target")
|
||||
elif (( has_action )); then
|
||||
# apply the selected action to all targets
|
||||
if [[ ! -z $target ]]; then
|
||||
|
|
@ -1163,7 +1316,7 @@ builder_parse() {
|
|||
|
||||
if builder_is_dep_build; then
|
||||
builder_echo setmark "dependency build, started by $builder_dep_parent"
|
||||
builder_echo grey "build.sh parameters: <${_builder_params[@]}>"
|
||||
builder_echo grey "build.sh parameters: <${_params[@]}>"
|
||||
if [[ -z ${_builder_deps_built+x} ]]; then
|
||||
builder_die "FATAL ERROR: Expected --builder-deps-built parameter"
|
||||
fi
|
||||
|
|
@ -1171,7 +1324,12 @@ builder_parse() {
|
|||
# This is a top-level invocation, not a dependency build, so we want to
|
||||
# track which dependencies have been built, so they don't get built multiple
|
||||
# times.
|
||||
builder_echo setmark "build.sh parameters: <${_builder_params[@]}>"
|
||||
# TODO: consider printing expanded builder parameters instead of shorthand
|
||||
echo "${_params[@]}"
|
||||
builder_echo setmark "build.sh parameters: <${_params[@]}>"
|
||||
if [[ ${#builder_extra_params[@]} -gt 0 ]]; then
|
||||
builder_echo grey "build.sh extra parameters: <${builder_extra_params[@]}>"
|
||||
fi
|
||||
_builder_deps_built=`mktemp`
|
||||
fi
|
||||
|
||||
|
|
@ -1279,10 +1437,10 @@ builder_display_usage() {
|
|||
local c1=$BUILDER_TERM_START
|
||||
local c0=$BUILDER_TERM_END
|
||||
echo
|
||||
echo "* Specify ${c1}action:target${c0} to run a specific ${c1}action${c0} against a specific ${c1}:target${c0}."
|
||||
echo "* If ${c1}action${c0} is specified without a ${c1}target${c0} suffix, it will be applied to all ${c1}:target${c0}s."
|
||||
echo "* If ${c1}:target${c0} is specified without an ${c1}action${c0} prefix, ${c1}$_builder_default_action:target${c0} will be inferred."
|
||||
echo "* If no ${c1}action${c0}, ${c1}:target${c0}, or ${c1}action:target${c0} entries are specified, ${c1}$_builder_default_action${c0} will run on all ${c1}:target${c0}s."
|
||||
echo -e "* Specify ${c1}action:target${c0} to run a specific ${c1}action${c0} against a specific ${c1}:target${c0}."
|
||||
echo -e "* If ${c1}action${c0} is specified without a ${c1}target${c0} suffix, it will be applied to all ${c1}:target${c0}s."
|
||||
echo -e "* If ${c1}:target${c0} is specified without an ${c1}action${c0} prefix, ${c1}$_builder_default_action:target${c0} will be inferred."
|
||||
echo -e "* If no ${c1}action${c0}, ${c1}:target${c0}, or ${c1}action:target${c0} entries are specified, ${c1}$_builder_default_action${c0} will run on all ${c1}:target${c0}s."
|
||||
echo
|
||||
}
|
||||
|
||||
|
|
@ -1291,7 +1449,7 @@ builder_finish_action() {
|
|||
local action="$2" target action_name
|
||||
|
||||
if [[ $action =~ : ]]; then
|
||||
IFS=: read -r action target <<< $action
|
||||
IFS=: read -r action target <<< "$action"
|
||||
target=":$target"
|
||||
else
|
||||
target=':*'
|
||||
|
|
@ -1354,7 +1512,6 @@ _builder_dep_output_exists() {
|
|||
_builder_should_build_dep() {
|
||||
local action_target="$1"
|
||||
local dep="$2"
|
||||
echo $dep
|
||||
local related_actions=(${_builder_dep_related_actions[$dep]})
|
||||
|
||||
if [[ $action_target =~ ^clean ]]; then
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ set -u
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../build/build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ fi
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../build/build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../../../resources/build/build-utils.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "$KEYMAN_ROOT/resources/build/jq.inc.sh"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ set -u
|
|||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../build/build-utils.sh"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
||||
|
|
|
|||
36
web/build.sh
36
web/build.sh
|
|
@ -3,7 +3,6 @@
|
|||
# Compiles the Keyman Engine for Web and its various end-products
|
||||
#
|
||||
|
||||
# set -x
|
||||
set -eu
|
||||
|
||||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
|
|
@ -23,15 +22,16 @@ cd "$THIS_SCRIPT_PATH"
|
|||
|
||||
# Ensures that we rely first upon the local npm-based install of Typescript.
|
||||
# (Facilitates automated setup for build agents.)
|
||||
# TODO: this should be removeable given set_keyman_standard_build_path does this in build-utils.sh (and relative paths are dodgy in $PATH!)
|
||||
PATH="../node_modules/.bin:$PATH"
|
||||
|
||||
PREDICTIVE_TEXT_SOURCE="../common/predictive-text/unit_tests/in_browser/resources/models/simple-trie.js"
|
||||
PREDICTIVE_TEXT_OUTPUT="src/test/manual/web/prediction-ui/simple-en-trie.js"
|
||||
|
||||
builder_describe "Builds Keyman Engine for Web (KMW)." \
|
||||
"@../common/web/keyman-version build" \
|
||||
"@../common/web/input-processor build" \
|
||||
"@src/tools/building/sourcemap-root build" \
|
||||
"@/common/web/keyman-version build" \
|
||||
"@/common/web/input-processor build" \
|
||||
"@/web/src/tools/building/sourcemap-root build" \
|
||||
"clean" \
|
||||
"configure" \
|
||||
"build" \
|
||||
|
|
@ -49,19 +49,19 @@ builder_describe "Builds Keyman Engine for Web (KMW)." \
|
|||
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $(builder_term build:embed) and $(builder_term build:web)" \
|
||||
|
||||
builder_describe_outputs \
|
||||
configure ../node_modules \
|
||||
configure:embed ../node_modules \
|
||||
configure:engine ../node_modules \
|
||||
configure:web ../node_modules \
|
||||
configure:ui ../node_modules \
|
||||
configure:samples ../node_modules \
|
||||
configure:tools ../node_modules \
|
||||
build:embed build/app/embed/release/keyman.js \
|
||||
build:engine build/engine/main/obj/keymanweb.js \
|
||||
build:web build/app/web/release/keymanweb.js \
|
||||
build:ui build/app/ui/release/kmwuibutton.js \
|
||||
build:samples $PREDICTIVE_TEXT_OUTPUT \
|
||||
build:tools build/tools/building/sourcemap-root/index.js
|
||||
configure /node_modules \
|
||||
configure:embed /node_modules \
|
||||
configure:engine /node_modules \
|
||||
configure:web /node_modules \
|
||||
configure:ui /node_modules \
|
||||
configure:samples /node_modules \
|
||||
configure:tools /node_modules \
|
||||
build:embed /web/build/app/embed/release/keyman.js \
|
||||
build:engine /web/build/engine/main/obj/keymanweb.js \
|
||||
build:web /web/build/app/web/release/keymanweb.js \
|
||||
build:ui /web/build/app/ui/release/kmwuibutton.js \
|
||||
build:samples /web/$PREDICTIVE_TEXT_OUTPUT \
|
||||
build:tools /web/build/tools/building/sourcemap-root/index.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -293,7 +293,7 @@ copy_outputs ( ) {
|
|||
# ```
|
||||
compile ( ) {
|
||||
local COMPILE_TARGET=$1
|
||||
npm run tsc -- -b src/$COMPILE_TARGET -v || builder_die "Build command tsc -- -b src/$COMPILE_TARGET -v failed with exit code $?"
|
||||
tsc -b src/$COMPILE_TARGET -v || builder_die "Build command tsc -b src/$COMPILE_TARGET -v failed with exit code $?"
|
||||
echo $COMPILE_TARGET TypeScript compiled under build/$COMPILE_TARGET/obj
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,18 +76,22 @@ output_path ( ) {
|
|||
fi
|
||||
}
|
||||
|
||||
# TODO: eliminate $SOURCE variable
|
||||
SOURCE="src"
|
||||
|
||||
# Ensures that we rely first upon the local npm-based install of Typescript.
|
||||
# (Facilitates automated setup for build agents.)
|
||||
# TODO: this should be removeable given set_keyman_standard_build_path does this in build-utils.sh (and relative paths are dodgy in $PATH!)
|
||||
PATH="../../../node_modules/.bin:$PATH"
|
||||
|
||||
# TODO: call tsc directly -- but currently it runs from wrong folder if called directly
|
||||
# TODO: eliminate $compiler and $compilecmd variables
|
||||
compiler="npm run tsc --"
|
||||
compilecmd="$compiler"
|
||||
|
||||
builder_describe "Builds engine modules for Keyman Engine for Web (KMW)." \
|
||||
"@../../../common/web/keyman-version build:main" \
|
||||
"@../../../common/web/input-processor build:main" \
|
||||
"@/common/web/keyman-version build:main" \
|
||||
"@/common/web/input-processor build:main" \
|
||||
"clean" \
|
||||
"configure" \
|
||||
"build" \
|
||||
|
|
@ -103,14 +107,14 @@ builder_describe "Builds engine modules for Keyman Engine for Web (KMW)." \
|
|||
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $DOC_BUILD_EMBED_WEB" \
|
||||
|
||||
builder_describe_outputs \
|
||||
configure ../../../node_modules \
|
||||
configure:configuration ../../../node_modules \
|
||||
configure:device-detect ../../../node_modules \
|
||||
configure:dom-utils ../../../node_modules \
|
||||
configure:element-wrappers ../../../node_modules \
|
||||
configure:keyboard-cache ../../../node_modules \
|
||||
configure:main ../../../node_modules \
|
||||
configure:osk ../../../node_modules \
|
||||
configure /node_modules \
|
||||
configure:configuration /node_modules \
|
||||
configure:device-detect /node_modules \
|
||||
configure:dom-utils /node_modules \
|
||||
configure:element-wrappers /node_modules \
|
||||
configure:keyboard-cache /node_modules \
|
||||
configure:main /node_modules \
|
||||
configure:osk /node_modules \
|
||||
build:configuration $(output_path $CONFIGURATION $OUTPUT_DIR)/index.js \
|
||||
build:device-detect $(output_path $DEVICEDETECT $OUTPUT_DIR)/kmwdevice.js \
|
||||
build:dom-utils $(output_path $DOMUTILS $OUTPUT_DIR)/index.js \
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ cd "$THIS_SCRIPT_PATH"
|
|||
################################ Main script ################################
|
||||
|
||||
builder_describe "Builds the Keyman Engine for Web's development & unit-testing tools" \
|
||||
"@../../../common/web/keyman-version" \
|
||||
"@../../../common/web/keyboard-processor" \
|
||||
"@/common/web/keyman-version" \
|
||||
"@/common/web/keyboard-processor" \
|
||||
"clean" \
|
||||
"build" \
|
||||
":bulk_rendering Builds the bulk-rendering tool used to validate changes to OSK display code" \
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ cd "$THIS_SCRIPT_PATH"
|
|||
################################ Main script ################################
|
||||
|
||||
builder_describe "Builds the sourcemap-sanitizing script used for Keyman Engine for Web builds" \
|
||||
"@../../../../../common/tools/sourcemap-path-remapper" \
|
||||
"@/common/tools/sourcemap-path-remapper" \
|
||||
"clean" \
|
||||
"configure" \
|
||||
"build" \
|
||||
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build ../../../../build/tools/sourcemap-root/index.js
|
||||
build /web/build/tools/sourcemap-root/index.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ if builder_start_action clean; then
|
|||
fi
|
||||
|
||||
if builder_start_action build; then
|
||||
npm run tsc -- -b "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
tsc -b "$THIS_SCRIPT_PATH/tsconfig.json"
|
||||
|
||||
# Necessary until the Web project is converted over to ES modules.
|
||||
# Node defaults to CommonJS format otherwise.
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ builder_describe \
|
|||
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build ../../../../build/tools/testing/bulk_rendering/bulk_render.js
|
||||
build /web/build/tools/testing/bulk_rendering/bulk_render.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
|
|||
|
|
@ -18,16 +18,16 @@ cd "$THIS_SCRIPT_PATH"
|
|||
################################ Main script ################################
|
||||
|
||||
builder_describe "Builds the Keyman Engine for Web's test-sequence recording tool" \
|
||||
"@../../../../../common/web/keyman-version" \
|
||||
"@../../../../../common/web/keyboard-processor" \
|
||||
"@../../../../../common/web/recorder" \
|
||||
"@/common/web/keyman-version" \
|
||||
"@/common/web/keyboard-processor" \
|
||||
"@/common/web/recorder" \
|
||||
"clean" \
|
||||
"configure" \
|
||||
"build"
|
||||
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build ../../../../build/tools/testing/recorder/index.js
|
||||
build /web/build/tools/testing/recorder/index.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ fi
|
|||
### BUILD ACTIONS
|
||||
|
||||
if builder_start_action build; then
|
||||
npm run tsc -- -b $THIS_SCRIPT_PATH/tsconfig.json
|
||||
tsc -b $THIS_SCRIPT_PATH/tsconfig.json
|
||||
|
||||
builder_finish_action success build
|
||||
fi
|
||||
Loading…
Add table
Reference in a new issue