mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-09 02:15:32 +00:00
115 lines
3.8 KiB
Bash
Executable file
115 lines
3.8 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# Compile keymanweb and copy compiled javascript and resources to output/embedded folder
|
|
#
|
|
|
|
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
|
|
|
|
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
|
|
|
# This script runs from its own folder
|
|
cd "$THIS_SCRIPT_PATH"
|
|
|
|
# ################################ Main script ################################
|
|
|
|
# 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"
|
|
|
|
builder_set_child_base src
|
|
builder_describe "Builds engine modules for Keyman Engine for Web (KMW)." \
|
|
"clean" \
|
|
"configure" \
|
|
"build" \
|
|
"test" \
|
|
":app/webview A puppetable version of KMW designed for use in a host app's WebView" \
|
|
":engine/paths Subset used to configure KMW" \
|
|
":engine/device-detect Subset used for device-detection " \
|
|
":engine/dom-utils A common subset of function used for DOM calculations, layout, etc" \
|
|
":engine/events Specialized classes utilized to support KMW API events" \
|
|
":engine/element-wrappers Subset used to integrate with website elements" \
|
|
":engine/package-cache Subset used to collate keyboards and request them from the cloud" \
|
|
":engine/main Builds all common code used by KMW's app/-level targets" \
|
|
":engine/osk Builds the Web OSK module"
|
|
|
|
# ":app/browser The website-integrating, browser-based version of KMW" \
|
|
|
|
# Possible TODO?
|
|
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $DOC_BUILD_EMBED_WEB" \
|
|
|
|
builder_describe_outputs \
|
|
configure /node_modules
|
|
|
|
# build:app/webview build/app/webview/lib/index.js \
|
|
|
|
# TODO: app/ui linkage.
|
|
|
|
builder_parse "$@"
|
|
|
|
#### Build action definitions ####
|
|
|
|
##################### TODO: call child action, verify things work as expected!
|
|
|
|
# We can run all clean & configure actions at once without much issue.
|
|
|
|
builder_run_child_actions clean
|
|
|
|
## Clean actions
|
|
|
|
# If a full-on general clean was requested, we can nuke the entire build folder.
|
|
if builder_start_action clean; then
|
|
rm -rf ./build
|
|
builder_finish_action success clean
|
|
fi
|
|
|
|
builder_run_child_actions configure
|
|
|
|
## Build actions
|
|
|
|
builder_run_child_actions build:engine/device-detect
|
|
builder_run_child_actions build:engine/dom-utils
|
|
builder_run_child_actions build:engine/element-wrappers
|
|
builder_run_child_actions build:engine/events
|
|
|
|
# Uses engine/dom-utils
|
|
builder_run_child_actions build:engine/osk
|
|
|
|
# Uses engine/osk (due to resource-path config interface)
|
|
builder_run_child_actions build:engine/paths
|
|
|
|
# Uses engine/config (also due to resource-path config interface, but for the
|
|
# more complete version of that interface)
|
|
builder_run_child_actions build:engine/package-cache
|
|
|
|
# Uses engine/paths, engine/device-detect, engine/package-cache, & engine/osk
|
|
builder_run_child_actions build:engine/main
|
|
|
|
# Uses all but engine/element-wrappers
|
|
builder_run_child_actions build:app/webview
|
|
|
|
# Uses literally everything `engine/` above
|
|
# Is not yet compilable due to unmodularized components.
|
|
# builder_run_child_actions build:app/browser
|
|
|
|
if builder_has_action build:app/browser; then
|
|
builder_die "Modularization work is not yet complete; builds dependent on this will fail."
|
|
fi
|
|
|
|
if builder_has_action build:app/ui; then
|
|
builder_die "Modularization work is not yet complete; builds dependent on this will fail."
|
|
fi
|
|
|
|
builder_run_child_actions test
|
|
|
|
if builder_start_action test; then
|
|
./test.sh :engine
|
|
|
|
builder_finish_action success test
|
|
fi
|