From d414be83134ea2e260a0d30d39cf4d503c46487f Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 9 Aug 2022 12:12:52 -0500 Subject: [PATCH] feat(core): constant generator between core and developer - change to manual regen of the .h file --- .gitignore | 3 --- core/include/ldml/keyboardprocessor_ldml.h | 18 ++++++++++++++++++ core/include/ldml/keyboardprocessor_ldml.ts | 11 +++++++++++ core/include/ldml/ldml-const-builder.ts | 2 ++ core/include/ldml/meson.build | 8 -------- core/include/meson.build | 1 - core/tools/ldml-const-builder/build.sh | 4 ++-- 7 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 core/include/ldml/keyboardprocessor_ldml.h delete mode 100644 core/include/ldml/meson.build mode change 100644 => 100755 core/tools/ldml-const-builder/build.sh diff --git a/.gitignore b/.gitignore index cadc45a9f1..cc536b78a0 100644 --- a/.gitignore +++ b/.gitignore @@ -172,6 +172,3 @@ Thumbs.db # Temporary file for logging scripts in xcode runs, see build-utils.sh for # details /xcodebuild-scripts.log - -# Generated .h file, see /core/include/ldml/build.sh -/core/include/ldml/keyboardprocessor_ldml.h diff --git a/core/include/ldml/keyboardprocessor_ldml.h b/core/include/ldml/keyboardprocessor_ldml.h new file mode 100644 index 0000000000..e92aefb221 --- /dev/null +++ b/core/include/ldml/keyboardprocessor_ldml.h @@ -0,0 +1,18 @@ +// +// Generated File - do not edit +// +// This file is generated by core/tools/ldml-const-builder/build.sh +// based on core/include/ldml/keyboardprocessor_ldml.ts +// + +#pragma once +#define LDML_META_SETTINGS_FALLBACK_OMIT 1 +#define LDML_META_SETTINGS_TRANSFORMFAILURE_OMIT 2 +#define LDML_META_SETTINGS_TRANSFORMPARTIAL_HIDE 4 +#define LDML_SECTION_KEYS ((uint32_t)'keys') +#define LDML_SECTION_LOCA ((uint32_t)'loca') +#define LDML_SECTION_META ((uint32_t)'meta') +#define LDML_SECTION_SECT ((uint32_t)'sect') +#define LDML_SECTION_STRS ((uint32_t)'strs') +#define LDML_STRS_FLAGS_EXTEND 1 +#define LDML_VERSION 1.0 diff --git a/core/include/ldml/keyboardprocessor_ldml.ts b/core/include/ldml/keyboardprocessor_ldml.ts index d6ff6e8820..bca8707e8b 100644 --- a/core/include/ldml/keyboardprocessor_ldml.ts +++ b/core/include/ldml/keyboardprocessor_ldml.ts @@ -1,3 +1,14 @@ + +// Notice! +// +// If you update this file, you *must* be sure to re-run +// +// core/tools/ldml-const-builder/build.sh clean build run +// +// To update keyboardprocessor_ldml.h, and commit the result. +// +// It is not updated automatically. + // namespace com.keyman.core.ldml { /** * Constants shared between the data access layer and the compiler diff --git a/core/include/ldml/ldml-const-builder.ts b/core/include/ldml/ldml-const-builder.ts index 646eb387ea..e64c39a2ac 100644 --- a/core/include/ldml/ldml-const-builder.ts +++ b/core/include/ldml/ldml-const-builder.ts @@ -4,8 +4,10 @@ const keys = Object.keys(constants); keys.sort(); console.log(`// // Generated File - do not edit +// // This file is generated by core/tools/ldml-const-builder/build.sh // based on core/include/ldml/keyboardprocessor_ldml.ts +// #pragma once`); diff --git a/core/include/ldml/meson.build b/core/include/ldml/meson.build deleted file mode 100644 index be594ede52..0000000000 --- a/core/include/ldml/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -bash = find_program('bash') - -kbp_ldml_h = custom_target('keyboardprocessor_ldml.h', - output : 'keyboardprocessor_ldml.h', - input : ['keyboardprocessor_ldml.ts', 'ldml-const-builder.ts'], - command : [ bash, join_paths(meson.current_source_dir(), '../../tools/ldml-const-builder/build.sh'), 'clean', 'build', 'run' ], - depend_files : files('keyboardprocessor_ldml.ts', 'ldml-const-builder.ts') - ) diff --git a/core/include/meson.build b/core/include/meson.build index cb4b17d5f6..b6211db0f2 100644 --- a/core/include/meson.build +++ b/core/include/meson.build @@ -8,4 +8,3 @@ inc = include_directories('.', is_system: true) subdir('keyman') -subdir('ldml') diff --git a/core/tools/ldml-const-builder/build.sh b/core/tools/ldml-const-builder/build.sh old mode 100644 new mode 100755 index 303b25541c..c92accd1ca --- a/core/tools/ldml-const-builder/build.sh +++ b/core/tools/ldml-const-builder/build.sh @@ -34,8 +34,8 @@ fi if builder_has_action clean; then # npm run clean - rm -rf ../../include/ldml/build/ ${KBP_LDML_H_FILE} - # TODO: clean .h? + rm -rf ../../include/ldml/build/ + # Not removing ${KBP_LDML_H_FILE} as it is checked in builder_report success clean fi