Fixes#7340.
Removes the unused <Version> element from <LexicalModel> element in the
.kps schema. (This needs to be copied to api.keyman.com also.)
Updates compiler to check for <FollowKeyboardVersion> and read the
version data from the .kmx in that case.
Unit tests updated. Some of the fixtures were incorrect as they had
<FollowKeyboardVersion> set for model-type packages or packages that
contained no keyboards. Fixed.
Replaces the existing error reporting in kmc-model with CompilerEvent
style messages. Some of the existing error reporting was kinda nice, but
consistency trumps pretty here.
One downside at present is the global filename and line variables in the
model-compiler-errors.ts unit. This is fragile, and should probably be
refactored further in the future.
Where it made sense, I converted various throws into ModelCompilerError
instances. If it appeared to be an internal error, I left it as-is, but
the external API interfaces wrap all unknown exceptions and convert them
into a compiler error message, so these APIs (compileModel and
loadFromFilename) now have a guarantee that they will never throw.
At this point, all of the error messages in the model compiler are
unrecoverable -- they will halt the compile entirely. However, the
pathway is there to support recoverable errors through the normal
callbacks.reportMessage mechanisms.
The message-counting mechanism is currently missing from this, as it
belongs in the API consumer, rather than in the low-level reporting
infrastructure. This means that models with large numbers of warnings
are going to generate scads of messages for now.
Note that the _users_ of CompilerCallbacks are subject to change in the
future, once we have all the compilers using the callbacks.
Consolidates the two copies of comperr.h (they were identical) and
moves to a common folder. Updates all references to comperr.h, except
for one github commit ref.
If kmcmplib build includes the --full-test flag, then configure and run
tests that include pulling in the keyboards repo; otherwise skip all of
that.
This will require CI changes to run full tests, relating to #8361.
Relates to #8150.
Legacy .kmp compiler would transform xml-format .kvk files into a binary
.kvk file; now we want that to remain the responsibility of the keyboard
compiler, so we'll warn the few users who are still doing this.
Moves to using the `reportMessage` callback for reporting all errors in
kmc-kmn.
This required some patching to common/web/types in order to get the new
constants in place and add support for line numbers to `CompilerEvent`,
so at the same time I refactored `compilerErrorSeverityName` into the
module.
After the refactor, coverage tests were failing because they included
the test/ folder, so cleaned that up at the same time.
Adds --compiler-warnings-as-errors and --no-warn-deprecated-code options
to kmc command line and interfaces.
Note that most compilers do not yet honour these options, only kmc-kmn.
Both of these should be handled in error filtering and reporting rather
than at the compiler level, so management of these may be factored out
of kmcmplib and into kmc later (although this goal may be blocked by
kmcmpdll's need to also use them).
Fixes#8615.
The msgproc was never being located as we were missing the UTF8ToString
wrapper for the context.
This also ensures error message codes are emitted in hexadecimal, and
that the return value from the msgproc callback is 1, meaning 'continue
build'.
The build/ folder for most packages was missing due to being listed in
.gitignore.
Also, @keymanapp/ldml-keyboard-constants package was not being published
despite being a dependency of @keymanapp/kmc-keyboard.
Instead of relying on npm's use of .gitignore / .npmignore (which has
seriously wonky behaviours), we list the files that should be included
in package.json.
NPM Wonky behaviours: it seems that .npmignore causes .gitignore in the
same folder to be ignored. But, higher level .gitignore files still
affect the files included in the package, which makes
specification-by-exclusion painful (negating exclusions, etc). We do not
recommend use of .npmignore anywhere for this reason.
Fixes#8586.
All npm publish actions in the repository are now run as part of the
Developer release build, hosted at present by kmc, until we setup a
higher-level build script to do it.
Adds a 'pack' action which mirrors 'publish' for all npm packages.
Removes unnecessary dev dependencies of models-templates and
models-wordbreakers from kmc-model.
Web Release build CI step has been updated to check for presence of
.build-builder.
* Splits compiler interface functions that return bool into
CompilerInterfaces.cpp, and moves `SetError` define to that unit so
it can't be used accidentally elsewhere
* Audit of `AddWarning` calls and only those that are used in bool
functions now `return FALSE` (with new `AddWarningBool`) whereas all
others `return CERR_Break`