protobuf.toml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. [tasks.install_protobuf]
  2. mac_alias = "install-protobuf"
  3. windows_alias = "install-protobuf-windows"
  4. linux_alias = "install-protobuf"
  5. [tasks.install-protobuf]
  6. condition_script = [
  7. """
  8. if ! command -v protoc-gen-dart
  9. then
  10. exit 0
  11. fi
  12. # installed
  13. exit 1
  14. """,
  15. ]
  16. run_task = { name = ["install_protobuf_compiler"] }
  17. [tasks.install-protobuf-windows]
  18. script = """
  19. ret = which dart
  20. if is_empty ${ret}
  21. echo Please make sure flutter/dart is properly installed and in PATH env var
  22. exit -1
  23. end
  24. ret = which protoc-gen-dart
  25. if is_empty ${ret}
  26. exec cmd.exe /c dart pub global activate protoc_plugin
  27. end
  28. ret = which protoc-gen-dart
  29. if is_empty ${ret}
  30. home_dir = get_home_dir
  31. echo Please add '${home_dir}\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\bin' into PATH env var
  32. exit -1
  33. end
  34. """
  35. script_runner = "@duckscript"
  36. [tasks.install_protobuf_compiler]
  37. script = """
  38. echo "Install protoc_plugin (Dart)"
  39. dart pub global activate protoc_plugin
  40. """
  41. script_runner = "@shell"
  42. [tasks.install_protobuf_compiler.linux]
  43. script = """
  44. echo "Install protoc_plugin (Dart)"
  45. dart pub global activate protoc_plugin
  46. """
  47. script_runner = "@shell"