UNPKG

@keymanapp/kmc

Version:

Keyman Developer compiler command line tools

25 lines (23 loc) 1.51 kB
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="22d4f1fb-dd14-5518-a04e-5f4938a5561e")}catch(e){}}(); 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 //# debugId=22d4f1fb-dd14-5518-a04e-5f4938a5561e