Stage one of the kmcmplib filesystem refactoring, as we move to writing
to buffers and allowing caller to write to disk. Moves responsibility
for writing data out of WriteCompiledKeyboard and into
kmcmp_CompileKeyboardFile. This means that there are now no file writes
in Compiler.cpp, except for the temp UTF16fromUTF8 (which I will also
change to a in-memory buffer "real soon now").
Note that responsibility for writing in kmcmp_CompileKeyboardFile is
very much temporary as we'll move it out of the library altogether in
a subsequent commit.
In order to match existing behaviour with the legacy KeymanWeb compiler,
we should use quoted numbers for row ids. This behaviour can probably be
changed over to the new model in the future, but for now this prevents
unit tests from causing us grief.
Adds `ERROR_PackageMustContainAPackageOrAKeyboard` and corresponding
unit tests. A couple of unit tests tweaked as their fixtures were no
longer valid!
This is a transfer of the functionality in the legacy package compiler;
we could go much further in verifying file types and excluding certain
files, but that's a big design session. For now, just refreshed to
include the set of Keyman for Windows and Keyman Engine for Windows
files which are most likely to be accidentally included.
Adds WARN_RedistFileShouldNotBeInPackage and WARN_DocFileDangerous and
corresponding unit tests and constant declarations.
When building on TC we install into a temporary directory. This
broke with the recent introduction of build.sh because that
now calls `make install` whereas previously we explicitly called
`make install-temp` on TC. Instead of adding a `install-temp`
action to `build.sh` we now check in the Makefile if sudo is set.
Adds checks for bcp47 tag metadata for keyboards and lexical models --
both validity and minimality. Adds `ERROR_LanguageTagIsNotValid` and
`WARN_LanguageTagIsNotMinimal` messages and corresponding unit tests.
This was implemented by extending the existing duplicate id check, so
renamed that function accordingly.