tool.toml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. env = { "dart_flowy_sdk_path" = "./app_flowy/packages/flowy_sdk/" }
  37. run_task = { name = ["rm_dart_generated_protobuf_files"] }
  38. [tasks.rm_dart_generated_protobuf_files]
  39. private = true
  40. script = [
  41. """
  42. protobuf_file_paths = glob_array ${dart_flowy_sdk_path}/lib/protobuf
  43. if not array_is_empty ${protobuf_file_paths}
  44. echo Remove generated protobuf files:
  45. for path in ${protobuf_file_paths}
  46. echo remove ${path}
  47. rm -rf ${path}
  48. end
  49. end
  50. """,
  51. ]
  52. script_runner = "@duckscript"
  53. [tasks.remove_files_with_pattern]
  54. private = true
  55. script = [
  56. """
  57. proto_file_paths = glob_array ${rm_proto_path}
  58. is_proto_file_paths_empty = array_is_empty ${proto_file_paths}
  59. if not ${is_proto_file_paths_empty}
  60. echo Remove generated proto files:
  61. for path in ${proto_file_paths}
  62. echo remove ${path}
  63. rm -rf ${path}
  64. end
  65. end
  66. protobuf_file_paths = glob_array ${rm_protobuf_path}
  67. is_protobuf_file_paths_empty = array_is_empty ${protobuf_file_paths}
  68. if not ${is_protobuf_file_paths_empty}
  69. echo Remove generated protobuf files:
  70. for path in ${protobuf_file_paths}
  71. echo remove ${path}
  72. rm -rf ${path}
  73. end
  74. end
  75. """,
  76. ]
  77. script_runner = "@duckscript"