AppFlowy/frontend/scripts/makefile/tool.toml

92 lines
2.3 KiB
TOML
Raw Normal View History

[tasks.flowy_clean]
run_task = { name = ["cargo_clean","rm_macro_build_cache", "rm_rust_generated_files", "rm_dart_generated_files"] }
2022-06-19 01:42:25 +00:00
[tasks.cargo_clean]
2022-05-27 12:26:33 +00:00
script = [
"""
cd rust-lib
2022-06-19 01:42:25 +00:00
cargo clean -q
2022-05-27 12:26:33 +00:00
cd ../../shared-lib
2022-06-19 01:42:25 +00:00
cargo clean -q
2022-05-27 12:26:33 +00:00
""",
]
script_runner = "@shell"
2022-06-19 01:42:25 +00:00
[tasks.rm_macro_build_cache]
script = [
"""
path = canonicalize ../shared-lib/lib-infra/.cache
if is_path_exists ${path}
rm -rf ${path}
end
""",
]
script_runner = "@duckscript"
#Rust Clean
[tasks.rm_rust_generated_files]
run_task = { name = ["rm_rust_lib_generated_protobuf_files", "rm_shared_lib_generated_protobuf_files"] }
2022-06-19 01:42:25 +00:00
[tasks.rm_rust_lib_generated_protobuf_files]
private = true
env = { "rm_proto_path" = "./rust-lib/**/resources/proto", "rm_protobuf_path" = "./rust-lib/**/protobuf" }
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" }
run_task = { name = "remove_files_with_pattern" }
#Dart Clean
[tasks.rm_dart_generated_files]
env = { "dart_flowy_sdk_path" = "./app_flowy/packages/flowy_sdk/" }
run_task = { name = ["rm_dart_generated_protobuf_files"] }
[tasks.rm_dart_generated_protobuf_files]
private = true
script = [
"""
protobuf_file_paths = glob_array ${dart_flowy_sdk_path}/lib/protobuf
if not array_is_empty ${protobuf_file_paths}
echo Remove generated protobuf files:
for path in ${protobuf_file_paths}
echo remove ${path}
rm -rf ${path}
end
end
""",
]
script_runner = "@duckscript"
[tasks.remove_files_with_pattern]
private = true
2022-05-27 12:26:33 +00:00
script = [
"""
proto_file_paths = glob_array ${rm_proto_path}
is_proto_file_paths_empty = array_is_empty ${proto_file_paths}
if not ${is_proto_file_paths_empty}
echo Remove generated proto files:
for path in ${proto_file_paths}
echo remove ${path}
rm -rf ${path}
end
end
protobuf_file_paths = glob_array ${rm_protobuf_path}
is_protobuf_file_paths_empty = array_is_empty ${protobuf_file_paths}
if not ${is_protobuf_file_paths_empty}
echo Remove generated protobuf files:
for path in ${protobuf_file_paths}
echo remove ${path}
rm -rf ${path}
end
end
2022-05-27 12:26:33 +00:00
""",
]
script_runner = "@duckscript"