Now allows any of the following. Quote marks are significant for
multiple tests with `-t`:
```bash
core/build.sh test:wasm --no-deps -- state-api debug-api
core/build.sh test:wasm --no-deps -- "state-api debug-api"
core/build.sh test:wasm --no-deps -t "state-api debug-api"
core/build.sh test:wasm --no-deps --test "state-api debug-api"
```
The `-t` / `--test` option takes a single string parameter which is
passed on to `meson test`, whereas the `--` "end of parameters" marker
allows arbitrary remaining parameters to be passed on to `meson test`.
Improves build script performance by:
* using built-ins wherever possible (e.g. string splitting)
* eliminating redundant code
* using absolute (to $KEYMAN_ROOT) rather than relative paths to avoid realpath
* removing unnecessary `npm run` calls
BEFORE | AFTER
-------------------------------|----------------------
time ./core/build.sh --help |
real 0m2.116s | real 0m0.874s
user 0m0.578s | user 0m0.198s
sys 0m0.984s | sys 0m0.289s
-------------------------------|----------------------
time ./web/build.sh --help |
real 0m3.523s | real 0m0.757s
user 0m1.166s | user 0m0.320s
sys 0m2.273s | sys 0m0.455s
-------------------------------|----------------------
time ./web/build.sh -d |
real 1m34.750s | real 0m59.974s
user 0m9.721s | user 0m6.284s
sys 0m19.652s | sys 0m13.202s
@keymanapp-test-bot skip
Fixes#8373.
Note that the core functionality requested in #8373 is already in place;
this commit just does some cleanup to make this easier to maintain in
the future:
* Uses `builder_is_debug_build` function to test for debug build
(instead of `builder_has_option --debug`, which would also work but
using the other function avoids typo issues with the option name).
* Renames `$_builder_debug` to `$_builder_debug_internal` to reduce
naming confusion
* Documents `$builder_debug`, `builder_is_debug_build`, and clarifies
usage of `--debug` option.
* Logs command line for dep builds (we could hide this in the future,
but it certainly doesn't hurt for now!)
This updates our meson min version on Windows to 1.0, which means that
we can avoid having Visual Studio on the path, as meson can find it
anyway. With this change, we can eliminate the batch-wrapper for the
build, significantly improving build performance and simplifying the
scripts.
This also adds a change to disable tests for dependency builds of core,
along with the `--no-tests` command line option for doing builds without
tests.
Minor cleanup includes eliminating various warnings from meson.build
files, and standardizing WASM cross-platform build options for Windows.
Allows use of `./build.sh configure -- --param-one=foo ...`.
Updates Core build to support `--` (including build.bat wrapper for
Windows builds). Fixes Linux debian rules to pass additional
parameters in with this format again, and adds `:arch` to only build
current architecture, not wasm as well...
Note that when using `--` you should typically avoid multiple actions in
a single command, as each action may interpret the additional parameters
differently!
Refactoring of build.sh to use the builder_ functions. The script should
now be a lot cleaner. Usage is available with `core/build.sh --help`
Targets are :x86, :x64, :wasm, :arch (linux/mac).
Supports additional requirements of Linux build (--target-path,
--configure).
By default will attempt to build all available targets.
Actions are: clean, configure, build, test, install, uninstall.
The install and uninstall actions only work for linux and mac targets at
present.
The hextobin tool is used to help us construct invalid .kmx files
without having to either hack these into the compiler, or write them
with a hex editor. It feels a little bit of overkill, but this makes it
easy to (a) work with our intended file structures, and (b) review any
changes to these invalid keyboard tests.
Note: I did do a cursory search for a hex2bin or hextobin that we could
easily use but did not find a good simple cross-platform tool that we
could consume (`xxd -r` would work but AFAICT constrains our format to a
dump which is much harder to work with and read -- I wanted to be able
to annotate with file structures.)
For an example, see ik_000_null_invalid.txt.
This means that building the invalid keyboards for tests requires node,
but that should be fine given we need node to build the valid keyboards
anyway.
I've put hextobin under core/tools but it could just as well live under
common/tools in the future, if we find it useful for other project unit
tests.
Removes .kmx from repo and builds them from the source .xml files using
kmldmlc (building that if necessary also with a poor fella's dependency
check for now), and generally a lot of cleanup of the meson.build files
for the ldml tests.
Moves keyboards to a subfolder of the ldml unit test folder to keep them
neat and tidy and avoid embedding huge files into ldml.js for test of
WASM.
Note: 000_null_keyboard and 002_null_invalid do build successfully, but
the core ldml keyboardprocessor currently fails on them, because they
are missing keys and vkey sections.
build-utils.sh is responsible for filling these variables.
Note: getversion.sh and getversion.bat are still currently used by
meson. gettier is no longer used with these changes.