tool.toml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. [tasks.flowy_clean]
  2. run_task = { name = ["cargo_clean","rm_macro_build_cache", "rm_rust_generated_files", "rm_dart_generated_files"] }
  3. [tasks.cargo_clean]
  4. script = [
  5. """
  6. cd rust-lib
  7. cargo clean -q
  8. cd ../../shared-lib
  9. cargo clean -q
  10. """,
  11. ]
  12. script_runner = "@shell"
  13. [tasks.rm_macro_build_cache]
  14. script = [
  15. """
  16. path = canonicalize ../shared-lib/lib-infra/.cache
  17. if is_path_exists ${path}
  18. rm -rf ${path}
  19. end
  20. """,
  21. ]
  22. script_runner = "@duckscript"
  23. #Rust Clean
  24. [tasks.rm_rust_generated_files]
  25. run_task = { name = ["rm_rust_lib_generated_protobuf_files", "rm_shared_lib_generated_protobuf_files"] }
  26. [tasks.rm_rust_lib_generated_protobuf_files]
  27. private = true
  28. env = { "rm_proto_path" = "./rust-lib/**/resources/proto", "rm_protobuf_path" = "./rust-lib/**/protobuf" }
  29. run_task = { name = "remove_files_with_pattern" }
  30. [tasks.rm_shared_lib_generated_protobuf_files]
  31. private = true
  32. env = { "rm_proto_path" = "./shared-lib/**/resources/proto", "rm_protobuf_path" = "./shared-lib/**/protobuf" }
  33. run_task = { name = "remove_files_with_pattern" }
  34. #Dart Clean
  35. [tasks.rm_dart_generated_files]
  36. private = true
  37. env = { "dart_flowy_sdk_path" = "./app_flowy/packages/flowy_sdk/" }
  38. run_task = { name = ["rm_dart_generated_protobuf_files"] }
  39. [tasks.rm_dart_generated_protobuf_files]
  40. private = true
  41. script = [
  42. """
  43. protobuf_file_paths = glob_array ${dart_flowy_sdk_path}/lib/protobuf
  44. if array_is_empty ${protobuf_file_paths}
  45. return
  46. end
  47. echo Remove generated protobuf files:
  48. for path in ${protobuf_file_paths}
  49. echo remove ${path}
  50. rm -rf ${path}
  51. end
  52. """,
  53. ]
  54. script_runner = "@duckscript"
  55. [tasks.remove_files_with_pattern]
  56. private = true
  57. script = [
  58. """
  59. proto_file_paths = glob_array ${rm_proto_path}
  60. is_proto_file_paths_empty = array_is_empty ${proto_file_paths}
  61. if !is_proto_file_paths_empty
  62. echo Remove generated proto files:
  63. for path in ${proto_file_paths}
  64. echo remove ${path}
  65. rm -rf ${path}
  66. end
  67. end
  68. protobuf_file_paths = glob_array ${rm_protobuf_path}
  69. is_protobuf_file_paths_empty = array_is_empty ${protobuf_file_paths}
  70. if !is_protobuf_file_paths_empty
  71. echo Remove generated protobuf files:
  72. for path in ${protobuf_file_paths}
  73. echo remove ${path}
  74. rm -rf ${path}
  75. end
  76. end
  77. """,
  78. ]
  79. script_runner = "@duckscript"