refactor: crates (#4258)

* chore: rename flowy-folder2 to flowy-folder

* chore: rename flowy-document2 to flowy-document

* chore: fix test

* chore: move lib-infra crate

* chore: remove shared-lib

* chore: fix clippy
This commit is contained in:
Nathan.fooo
2023-12-31 07:29:40 +08:00
committed by GitHub
parent 2f6a4f8c7b
commit 5facb61e23
460 changed files with 498 additions and 11141 deletions

View File

@ -80,13 +80,6 @@ cd rust-lib
RUST_LOG=info RUST_BACKTRACE=1 cargo test --no-default-features --features "rev-sqlite"
'''
[tasks.shared_lib_unit_test]
env = { RUST_LOG = "info" }
description = "Run shared-lib unit test"
script = '''
cd ../shared-lib
cargo test --no-default-features
'''
[tasks.check_grcov]
description = "Check if `grcov` is installled"
@ -115,7 +108,7 @@ script = ["""
rm ${full_path}
end
shared_lib_profs = glob_array ../shared-lib/**/*.profraw
shared_lib_profs = glob_array ./rust-lib/build-tool/**/*.profraw
for prof in ${shared_lib_profs}
full_path = canonicalize ${prof}
rm ${full_path}
@ -171,54 +164,12 @@ script = [
""",
]
[tasks.get_sharedlib_grcov_report]
description = "Get `grcov` HTML report for test coverage shared-lib"
script_runner = "@shell"
script = [
"""
echo --- Getting 'grcov' results 'shared-lib' ---
cd ../shared-lib
grcov . \
--binary-path target/debug/deps \
--source-dir . \
--output-type html \
--branch \
--ignore-not-existing \
--log-level WARN \
--output-path target/coverage-html
echo "--- Done! Generated HTML report under 'target/coverage-html' for sharedlib."
""",
]
[tasks.get_grcov_report]
description = "Get `grcov` HTML report for test coverage"
run_task = { name = [
"get_rustlib_grcov_report",
"get_sharedlib_grcov_report",
], parallel = true }
[tasks.get_sharedlib_lcov_report]
description = "Generates `lcov` report for `shared-lib`"
script_runner = "@shell"
script = ["""
echo Getting 'lcov' results for 'shared-lib'
cd ../shared-lib
grcov . \
--binary-path target/debug/deps \
--source-dir . \
--output-type lcov \
--branch \
--ignore-not-existing \
--log-level WARN \
--output-path target/coverage.lcov
echo "--- Done! Generated 'target/coverage.lcov' sharedlib."
"""]
[tasks.get_rustlib_lcov_report]
description = "Generates `lcov` report for `rust-lib`"
script_runner = "@shell"
@ -242,7 +193,6 @@ script = ["""
[tasks.get_lcov_report]
description = "Get `lcov` reports for test coverage"
run_task = { name = [
"get_sharedlib_lcov_report",
"get_rustlib_lcov_report",
], parallel = true }

View File

@ -11,7 +11,7 @@ script = ["""
cd rust-lib
cargo clean -q
cd ../../shared-lib
cd ./build-tool
cargo clean -q
"""]
script_runner = "@shell"
@ -40,7 +40,7 @@ run_task = { name = "remove_files_with_pattern" }
[tasks.rm_shared_lib_generated_protobuf_files]
private = true
env = { "rm_proto_path" = "../shared-lib/**/resources/proto", "rm_protobuf_path" = "../shared-lib/**/protobuf" }
env = { "rm_proto_path" = "./rust-lib/build-tool/**/resources/proto", "rm_protobuf_path" = "./rust-lib/build-tool/**/protobuf" }
run_task = { name = "remove_files_with_pattern" }