tool.toml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [tasks.rust_env_setup]
  2. dependencies = ["rustup", "add_targets", "rust_tools"]
  3. description = "Setup the rust env"
  4. [tasks.rustup]
  5. script = [
  6. """
  7. sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
  8. curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y
  9. echo 'export PATH="$$HOME/.cargo/bin:$$PATH"' >> ~/.bash_profile
  10. source ~/.bash_profile
  11. """,
  12. ]
  13. script_runner = "@shell"
  14. [tasks.add_compile_targets]
  15. script = [
  16. """
  17. rustup target add aarch64-linux-android
  18. rustup target add arm-linux-androideabi
  19. rustup target add armv7-linux-androideabi
  20. rustup target add i686-linux-android
  21. rustup target add aarch64-apple-ios
  22. rustup target add x86_64-apple-ios
  23. rustup target add x86_64-apple-darwin
  24. """,
  25. ]
  26. script_runner = "@shell"
  27. [tasks.rust_tools]
  28. script = [
  29. """
  30. # cargo install clog-cli --force
  31. # cargo install cargo-cache
  32. rustup component add rustfmt
  33. cargo install ripgrep
  34. cargo install rusty-hook
  35. cargo install cargo-expand
  36. """,
  37. ]
  38. script_runner = "@shell"
  39. [tasks.fmt]
  40. args = ["fmt", "--", "--emit=files"]
  41. command = "cargo"
  42. install_crate = "rustfmt"
  43. [tasks.rust_commit_hook]
  44. script = [
  45. """
  46. manifest_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/tool/rust-tool/Cargo.toml
  47. cargo run --manifest-path ${manifest_path} hook --commit --path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib
  48. """,
  49. ]
  50. script_runner = "@shell"
  51. [tasks.reset_db]
  52. script = [
  53. """
  54. tool=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/tool/rust-tool/Cargo.toml
  55. cargo run --manifest-path ${tool} db --reset
  56. """,
  57. ]
  58. script_runner = "@shell"
  59. [tasks.plantuml]
  60. script = ["""
  61. brew cask install java
  62. brew install graphviz
  63. """]
  64. script_runner = "@shell"
  65. # For the system Java wrappers to find this JDK, symlink it with
  66. # sudo ln -sfn /Users/weidongfu/Documents/tools/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
  67. # This is a beta version of openjdk for Apple Silicon
  68. # (openjdk 16 preview).
  69. # openjdk is keg-only, which means it was not symlinked into /Users/weidongfu/Documents/tools/homebrew,
  70. # because it shadows the macOS `java` wrapper.
  71. # If you need to have openjdk first in your PATH run:
  72. # echo 'export PATH="/Users/weidongfu/Documents/tools/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zshrc