From b9e4cdafdcc30f300ef82434307fcfebdd080c1d Mon Sep 17 00:00:00 2001 From: Riey Date: Thu, 21 Jan 2021 01:15:29 +0900 Subject: [PATCH] Make engine config writer instead of build script --- Cargo.lock | 9 ++++++++- Cargo.toml | 1 + engine/capi/Cargo.toml | 4 ---- engine/capi/build.rs | 7 ------- engine/capi/data/config.yaml | 19 ------------------- engine/config-writer/Cargo.toml | 10 ++++++++++ engine/config-writer/src/main.rs | 6 ++++++ pkg/release.sh | 2 +- 8 files changed, 26 insertions(+), 32 deletions(-) delete mode 100644 engine/capi/build.rs delete mode 100644 engine/capi/data/config.yaml create mode 100644 engine/config-writer/Cargo.toml create mode 100644 engine/config-writer/src/main.rs diff --git a/Cargo.lock b/Cargo.lock index 9d3dc85d..80971041 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -340,13 +340,20 @@ name = "kime-engine-capi" version = "0.7.0" dependencies = [ "kime-engine-core", - "serde_yaml", ] [[package]] name = "kime-engine-cffi" version = "0.7.0" +[[package]] +name = "kime-engine-config-writer" +version = "0.1.0" +dependencies = [ + "kime-engine-core", + "serde_yaml", +] + [[package]] name = "kime-engine-core" version = "0.7.0" diff --git a/Cargo.toml b/Cargo.toml index a60b2a7a..c2ff1c13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ members = [ "engine/core", "engine/capi", + "engine/config-writer", "engine/cffi", "gtk3", "xim", diff --git a/engine/capi/Cargo.toml b/engine/capi/Cargo.toml index 67188614..fa13ff8b 100644 --- a/engine/capi/Cargo.toml +++ b/engine/capi/Cargo.toml @@ -13,7 +13,3 @@ crate-type = ["cdylib"] [dependencies] kime-engine-core = { path = "../core" } -[build-dependencies] -kime-engine-core = { path = "../core" } -serde_yaml = "0.8.15" - diff --git a/engine/capi/build.rs b/engine/capi/build.rs deleted file mode 100644 index b386b8d1..00000000 --- a/engine/capi/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - std::fs::write( - "data/config.yaml", - serde_yaml::to_string(&kime_engine_core::RawConfig::default()).unwrap(), - ) - .unwrap(); -} diff --git a/engine/capi/data/config.yaml b/engine/capi/data/config.yaml deleted file mode 100644 index 8c5574d8..00000000 --- a/engine/capi/data/config.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -layout: dubeolsik -esc_turn_off: true -hangul_keys: - - AltR - - Henkan - - Hangul - - Super-Space -xim_preedit_font: - - D2Coding - - 15.0 -gtk_commit_english: true -compose: - compose_choseong_ssang: true - decompose_choseong_ssang: false - compose_jungseong_ssang: false - decompose_jungseong_ssang: false - compose_jongseong_ssang: false - decompose_jongseong_ssang: false \ No newline at end of file diff --git a/engine/config-writer/Cargo.toml b/engine/config-writer/Cargo.toml new file mode 100644 index 00000000..2ab651a5 --- /dev/null +++ b/engine/config-writer/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "kime-engine-config-writer" +version = "0.1.0" +authors = ["Riey "] +edition = "2018" + +[dependencies] +kime-engine-core = { path = "../core" } +serde_yaml = "0.8.15" + diff --git a/engine/config-writer/src/main.rs b/engine/config-writer/src/main.rs new file mode 100644 index 00000000..7c0e8e25 --- /dev/null +++ b/engine/config-writer/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + print!( + "{}", + serde_yaml::to_string(&kime_engine_core::RawConfig::default()).unwrap() + ); +} diff --git a/pkg/release.sh b/pkg/release.sh index 53dc1935..17854444 100755 --- a/pkg/release.sh +++ b/pkg/release.sh @@ -12,7 +12,7 @@ cp target/release/kime-xim build/out/kime-xim cp target/release/libkime_gtk3.so build/out/im-kime.so cp target/release/libkime_engine.so build/out/libkime_engine.so -cp engine/capi/data/config.yaml build/out +cargo run --release -p kime-engine-config-writer > build/out/config.yaml cp engine/cffi/kime_engine.h build/out strip -s build/out/kime-xim