Skip to content

Commit

Permalink
Merge pull request #255 from mh-northlander/feature/minimum-rust-support
Browse files Browse the repository at this point in the history
Aggregate package information into root Cargo.toml
  • Loading branch information
mh-northlander authored Jun 4, 2024
2 parents 930a4a7 + d75d43d commit 232d9ee
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 60 deletions.
20 changes: 13 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
[workspace]
resolver = "2"
members = [
"sudachi",
"sudachi-cli",
"sudachi-fuzz",
"plugin/input_text/*",
"plugin/oov/*",
"plugin/path_rewrite/*",
"python"
"python",
]
default-members = ["sudachi", "sudachi-cli"]

default-members = [
"sudachi",
"sudachi-cli"
]

resolver = "2"
[workspace.package]
version = "0.6.9-a1"
authors = ["Works Applications <[email protected]>"]
edition = "2021"
rust-version = "1.74.1"
description = "Rust version of Sudachi, the Japanese Morphological Analyzer"
readme = "README.md"
homepage = "https://github.com/WorksApplications/sudachi.rs"
repository = "https://github.com/WorksApplications/sudachi.rs"
license = "Apache-2.0"
9 changes: 5 additions & 4 deletions plugin/input_text/default_input_text/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "default_input_text"
version = "0.6.9-a1"
authors = ["Works Applications <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
9 changes: 5 additions & 4 deletions plugin/oov/simple_oov/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "simple_oov"
version = "0.6.9-a1"
authors = ["Works Applications <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
9 changes: 5 additions & 4 deletions plugin/path_rewrite/join_katakana_oov/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "join_katakana_oov"
version = "0.6.9-a1"
authors = ["Works Applications <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
9 changes: 5 additions & 4 deletions plugin/path_rewrite/join_numeric/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "join_numeric"
version = "0.6.9-a1"
authors = ["Works Applications <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
14 changes: 8 additions & 6 deletions python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[package]
name = "sudachipy"
version = "0.6.9-a1"
edition = "2018"
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "Python bindings of sudachi.rs, the Japanese Morphological Analyzer"
homepage = "https://github.com/WorksApplications/sudachi.rs"
repository = "https://github.com/WorksApplications/sudachi.rs"
license = "Apache-2.0"

readme = "README.md"
homepage.workspace = true
repository.workspace = true
license.workspace = true

[lib]
name = "sudachipy"
Expand Down
19 changes: 10 additions & 9 deletions sudachi-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[package]
name = "sudachi-cli"
version = "0.6.9-a1"
authors = ["Works Applications <[email protected]>"]
edition = "2018"
description = "Rust version of Sudachi, the Japanese Morphological Analyzer"
readme = "../README.md"
homepage = "https://github.com/WorksApplications/sudachi.rs"
repository = "https://github.com/WorksApplications/sudachi.rs"
license = "Apache-2.0"
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
description.workspace = true
readme.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true

[dependencies]
sudachi = { path = "../sudachi" }
Expand All @@ -22,4 +23,4 @@ path = "src/main.rs"

[features]
# Compile dictionary into executable (specifying dictionary becomes optional)
bake_dictionary = []
bake_dictionary = []
10 changes: 6 additions & 4 deletions sudachi-fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
[package]
name = "sudachi-fuzz"
version = "0.0.1"
authors = ["Works Applications <[email protected]>"]
edition = "2021"
description = "Rust version of Sudachi, the Japanese Morphological Analyzer"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
description.workspace = true
license.workspace = true

[dependencies]
sudachi = { path = "../sudachi" }
criterion = "0.5"
arbitrary = "1"

[target.'cfg(unix)'.dependencies]
honggfuzz = "0.5"
honggfuzz = "0.5"
19 changes: 10 additions & 9 deletions sudachi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[package]
name = "sudachi"
version = "0.6.9-a1"
authors = ["Works Applications <[email protected]>"]
edition = "2018"
description = "Rust version of Sudachi, the Japanese Morphological Analyzer"
readme = "README.md"
homepage = "https://github.com/WorksApplications/sudachi.rs"
repository = "https://github.com/WorksApplications/sudachi.rs"
license = "Apache-2.0"
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
description.workspace = true
readme.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true

[dependencies] # this should be sorted
aho-corasick = "1" # MIT/Apache 2.0
Expand Down Expand Up @@ -38,4 +39,4 @@ join_numeric = { path = "../plugin/path_rewrite/join_numeric" }
join_katakana_oov = { path = "../plugin/path_rewrite/join_katakana_oov" }

[lib]
crate-type = ["rlib"]
crate-type = ["rlib"]
14 changes: 5 additions & 9 deletions update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -eu

if [ $# -lt 2 ] && [ "$1" != "show" ] ; then
if [ $# -lt 1 ] || ( [ $# -lt 2 ] && [ "$1" != "show" ] ) ; then
echo "Provide 2 arguments [from] and [to] to update version, or 'show' to print current one."
exit 1
fi

VERSION_CRR=$(cat ./sudachi/Cargo.toml | grep -m1 "version \?=" | sed -r 's/^.*"(.*)".*$/\1/')
VERSION_CRR=$(cat ./Cargo.toml | grep -m1 "version \?=" | sed -r 's/^.*"(.*)".*$/\1/')

if [ $1 = "show" ] ; then
echo ${VERSION_CRR}
Expand All @@ -25,13 +25,9 @@ fi
# update
echo "Update version from ${VERSION_FROM} to ${VERSION_TO}"

CARGO_FILES="$(find . -name Cargo.toml)"

for FILE in $CARGO_FILES ; do
echo $FILE
# replace the first occurrence of `^version = "<version>"$`
sed -i -r "1,/^version = / s/^version = \"${VERSION_FROM}\"$/version = \"${VERSION_TO}\"/" $FILE
done
WORKSPACE_CARGO_FILE="./Cargo.toml"
echo $WORKSPACE_CARGO_FILE
sed -i -r "1,/^version = / s/^version = \"${VERSION_FROM}\"$/version = \"${VERSION_TO}\"/" $WORKSPACE_CARGO_FILE

PY_SETUP_FILE="./python/setup.py"
echo $PY_SETUP_FILE
Expand Down

0 comments on commit 232d9ee

Please sign in to comment.