@keymanapp/kmc
Version:
Keyman Developer compiler command line tools
21 lines • 1.2 kB
JavaScript
import * as kmcLdml from '@keymanapp/kmc-ldml';
import { LDMLKeyboardXMLSourceFileReader } from '@keymanapp/developer-utils';
import { BuildActivity } from './BuildActivity.js';
import { fileURLToPath } from 'url';
import { dirname } from 'node:path';
export class BuildLdmlKeyboard extends BuildActivity {
get name() { return 'LDML keyboard'; }
get sourceExtension() { return ".xml" /* KeymanFileTypes.Source.LdmlKeyboard */; }
get compiledExtension() { return ".kmx" /* KeymanFileTypes.Binary.Keyboard */; }
get description() { return 'Build a LDML keyboard'; }
async build(infile, outfile, callbacks, options) {
// TODO-LDML: consider hardware vs touch -- touch-only layout will not have a .kvk
const ldmlCompilerOptions = { ...options, readerOptions: {
cldrImportsPath: fileURLToPath(new URL(...LDMLKeyboardXMLSourceFileReader.defaultImportsURL)),
localImportsPaths: [dirname(infile)], // local dir
} };
const compiler = new kmcLdml.LdmlKeyboardCompiler();
return await super.runCompiler(compiler, infile, outfile, callbacks, ldmlCompilerOptions);
}
}
//# sourceMappingURL=BuildLdmlKeyboard.js.map