From 021f1bf0c23fc3080a3ef2d3fe88e5005f05c91f Mon Sep 17 00:00:00 2001 From: Alexandre Senges Date: Mon, 25 Sep 2023 12:11:26 +0200 Subject: [PATCH] Refactor repository to use workspaces (#86) Refactor repository to use workspaces --- .github/workflows/test.yml | 2 ++ Cargo.toml | 28 ++----------------- i18n-helpers/Cargo.toml | 25 +++++++++++++++++ {fuzz => i18n-helpers/fuzz}/.gitignore | 0 {fuzz => i18n-helpers/fuzz}/Cargo.lock | 0 {fuzz => i18n-helpers/fuzz}/Cargo.toml | 0 .../fuzz}/fuzz_targets/group_events.rs | 0 .../fuzz}/fuzz_targets/normalize.rs | 0 .../src}/bin/mdbook-gettext.rs | 0 .../src}/bin/mdbook-i18n-normalize.rs | 0 .../src}/bin/mdbook-xgettext.rs | 0 {src => i18n-helpers/src}/lib.rs | 0 {src => i18n-helpers/src}/normalize.rs | 0 13 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 i18n-helpers/Cargo.toml rename {fuzz => i18n-helpers/fuzz}/.gitignore (100%) rename {fuzz => i18n-helpers/fuzz}/Cargo.lock (100%) rename {fuzz => i18n-helpers/fuzz}/Cargo.toml (100%) rename {fuzz => i18n-helpers/fuzz}/fuzz_targets/group_events.rs (100%) rename {fuzz => i18n-helpers/fuzz}/fuzz_targets/normalize.rs (100%) rename {src => i18n-helpers/src}/bin/mdbook-gettext.rs (100%) rename {src => i18n-helpers/src}/bin/mdbook-i18n-normalize.rs (100%) rename {src => i18n-helpers/src}/bin/mdbook-xgettext.rs (100%) rename {src => i18n-helpers/src}/lib.rs (100%) rename {src => i18n-helpers/src}/normalize.rs (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 36afd90..34ca081 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,11 +50,13 @@ jobs: - name: Run group_events fuzzer and minimize corpus run: | + cd i18n-helpers cargo fuzz run group_events -- -only_ascii=1 -max_total_time=30 cargo fuzz cmin group_events - name: Run normalize fuzzer and minimize corpus run: | + cd i18n-helpers cargo fuzz run normalize -- -only_ascii=1 -max_total_time=30 cargo fuzz cmin normalize diff --git a/Cargo.toml b/Cargo.toml index 386c001..aebac73 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,25 +1,3 @@ -[package] -name = "mdbook-i18n-helpers" -version = "0.2.3" -authors = ["Martin Geisler "] -categories = ["command-line-utilities", "localization"] -edition = "2021" -keywords = ["mdbook", "i18n", "translation", "gettext"] -license = "Apache-2.0" -repository = "https://github.com/google/mdbook-i18n-helpers" -description = "Plugins for a mdbook translation workflow based on Gettext." - -[dependencies] -anyhow = "1.0.68" -chrono = { version = "0.4.31", default-features = false, features = ["alloc"] } -mdbook = { version = "0.4.25", default-features = false } -polib = "0.2.0" -pulldown-cmark = { version = "0.9.2", default-features = false } -pulldown-cmark-to-cmark = "11.0.0" -regex = "1.9.4" -semver = "1.0.16" -serde_json = "1.0.91" - -[dev-dependencies] -pretty_assertions = "1.3.0" -tempfile = "3.5.0" +[workspace] +members = ["i18n-helpers"] +default-members = ["i18n-helpers"] diff --git a/i18n-helpers/Cargo.toml b/i18n-helpers/Cargo.toml new file mode 100644 index 0000000..386c001 --- /dev/null +++ b/i18n-helpers/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "mdbook-i18n-helpers" +version = "0.2.3" +authors = ["Martin Geisler "] +categories = ["command-line-utilities", "localization"] +edition = "2021" +keywords = ["mdbook", "i18n", "translation", "gettext"] +license = "Apache-2.0" +repository = "https://github.com/google/mdbook-i18n-helpers" +description = "Plugins for a mdbook translation workflow based on Gettext." + +[dependencies] +anyhow = "1.0.68" +chrono = { version = "0.4.31", default-features = false, features = ["alloc"] } +mdbook = { version = "0.4.25", default-features = false } +polib = "0.2.0" +pulldown-cmark = { version = "0.9.2", default-features = false } +pulldown-cmark-to-cmark = "11.0.0" +regex = "1.9.4" +semver = "1.0.16" +serde_json = "1.0.91" + +[dev-dependencies] +pretty_assertions = "1.3.0" +tempfile = "3.5.0" diff --git a/fuzz/.gitignore b/i18n-helpers/fuzz/.gitignore similarity index 100% rename from fuzz/.gitignore rename to i18n-helpers/fuzz/.gitignore diff --git a/fuzz/Cargo.lock b/i18n-helpers/fuzz/Cargo.lock similarity index 100% rename from fuzz/Cargo.lock rename to i18n-helpers/fuzz/Cargo.lock diff --git a/fuzz/Cargo.toml b/i18n-helpers/fuzz/Cargo.toml similarity index 100% rename from fuzz/Cargo.toml rename to i18n-helpers/fuzz/Cargo.toml diff --git a/fuzz/fuzz_targets/group_events.rs b/i18n-helpers/fuzz/fuzz_targets/group_events.rs similarity index 100% rename from fuzz/fuzz_targets/group_events.rs rename to i18n-helpers/fuzz/fuzz_targets/group_events.rs diff --git a/fuzz/fuzz_targets/normalize.rs b/i18n-helpers/fuzz/fuzz_targets/normalize.rs similarity index 100% rename from fuzz/fuzz_targets/normalize.rs rename to i18n-helpers/fuzz/fuzz_targets/normalize.rs diff --git a/src/bin/mdbook-gettext.rs b/i18n-helpers/src/bin/mdbook-gettext.rs similarity index 100% rename from src/bin/mdbook-gettext.rs rename to i18n-helpers/src/bin/mdbook-gettext.rs diff --git a/src/bin/mdbook-i18n-normalize.rs b/i18n-helpers/src/bin/mdbook-i18n-normalize.rs similarity index 100% rename from src/bin/mdbook-i18n-normalize.rs rename to i18n-helpers/src/bin/mdbook-i18n-normalize.rs diff --git a/src/bin/mdbook-xgettext.rs b/i18n-helpers/src/bin/mdbook-xgettext.rs similarity index 100% rename from src/bin/mdbook-xgettext.rs rename to i18n-helpers/src/bin/mdbook-xgettext.rs diff --git a/src/lib.rs b/i18n-helpers/src/lib.rs similarity index 100% rename from src/lib.rs rename to i18n-helpers/src/lib.rs diff --git a/src/normalize.rs b/i18n-helpers/src/normalize.rs similarity index 100% rename from src/normalize.rs rename to i18n-helpers/src/normalize.rs