2021-11-06 12:35:04 +00:00
|
|
|
[tasks.flowy_dev]
|
2021-11-23 08:41:05 +00:00
|
|
|
run_task = { name = ["install_prerequests","install_diesel"] }
|
2021-11-17 13:45:18 +00:00
|
|
|
|
|
|
|
[tasks.install_windows_deps.windows]
|
2021-11-17 15:43:49 +00:00
|
|
|
dependencies=["check_duckscript_installation", "check_visual_studio_installation", "check_vcpkg", "install_vcpkg_sqlite", "install_rust_vcpkg_cli"]
|
2021-11-17 13:45:18 +00:00
|
|
|
|
|
|
|
[tasks.check_visual_studio_installation.windows]
|
|
|
|
script = """
|
|
|
|
output = exec powershell -Command "Get-CimInstance MSFT_VSInstance | select -ExpandProperty Version"
|
|
|
|
stdout = set ${output.stdout}
|
|
|
|
pos = last_indexof ${stdout} .
|
|
|
|
new_str = substring ${stdout} 0 ${pos}
|
2021-11-23 00:28:59 +00:00
|
|
|
# TODO: will raise error if there are more than 1 visual studio installation
|
2021-11-17 13:45:18 +00:00
|
|
|
newer = semver_is_newer ${new_str} 16.11.0
|
|
|
|
assert ${newer} "Visual studio 2019 is not installed or version is lower than 16.11.0"
|
|
|
|
"""
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
|
|
|
[tasks.check_duckscript_installation.windows]
|
|
|
|
script = """
|
|
|
|
@echo off
|
|
|
|
@duck -h > nul
|
|
|
|
if %errorlevel% GTR 0 (
|
|
|
|
echo Please install duckscript at first: cargo install --force duckscript_cli
|
|
|
|
exit -1
|
|
|
|
)
|
|
|
|
"""
|
|
|
|
|
|
|
|
[tasks.check_vcpkg.windows]
|
|
|
|
script = """
|
|
|
|
ret = which vcpkg
|
|
|
|
if is_empty ${ret}
|
|
|
|
echo "Please install vcpkg on windows at first. Make sure to put it into PATH env var"
|
|
|
|
echo "See: https://github.com/microsoft/vcpkg#quick-start-windows"
|
|
|
|
exit -1
|
|
|
|
end
|
|
|
|
"""
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
2021-11-17 15:43:49 +00:00
|
|
|
[tasks.install_vcpkg_sqlite.windows]
|
|
|
|
script = """
|
|
|
|
vcpkg install sqlite3:x64-windows-static-md
|
|
|
|
"""
|
|
|
|
|
2021-11-17 13:45:18 +00:00
|
|
|
[tasks.install_rust_vcpkg_cli.windows]
|
|
|
|
script = """
|
|
|
|
exec cargo install vcpkg_cli
|
|
|
|
output = exec vcpkg_cli probe sqlite3
|
|
|
|
stdout = set ${output.stdout}
|
|
|
|
stderr = set ${output.stderr}
|
|
|
|
ret = indexof ${stdout} "Failed:"
|
|
|
|
assert_eq ${ret} "" ${stdout}
|
|
|
|
"""
|
|
|
|
script_runner = "@duckscript"
|
2021-11-06 12:35:04 +00:00
|
|
|
|
|
|
|
[tasks.install_diesel]
|
2021-09-05 05:50:23 +00:00
|
|
|
script = """
|
|
|
|
cargo install diesel_cli --no-default-features --features sqlite
|
|
|
|
"""
|
|
|
|
|
2021-11-17 13:45:18 +00:00
|
|
|
[tasks.install_diesel.windows]
|
|
|
|
script = """
|
|
|
|
cargo install diesel_cli --no-default-features --features sqlite
|
|
|
|
"""
|
|
|
|
dependencies = ["check_vcpkg"]
|
|
|
|
|
2021-11-24 05:23:09 +00:00
|
|
|
[tasks.install_targets.mac]
|
2021-09-05 05:50:23 +00:00
|
|
|
script = """
|
2021-11-06 12:35:04 +00:00
|
|
|
rustup target add x86_64-apple-ios
|
|
|
|
rustup target add x86_64-apple-darwin
|
|
|
|
rustup target add aarch64-apple-ios
|
|
|
|
rustup target add aarch64-apple-darwin
|
2021-11-24 05:23:09 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
[tasks.install_targets.windows]
|
|
|
|
script = """
|
2021-11-17 13:45:18 +00:00
|
|
|
rustup target add x86_64-pc-windows-msvc
|
2021-11-24 05:23:09 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
[tasks.install_targets.linux]
|
|
|
|
script = """
|
2021-11-19 03:13:07 +00:00
|
|
|
rustup target add x86_64-unknown-linux-gnu
|
2021-09-05 05:50:23 +00:00
|
|
|
"""
|
|
|
|
|
2021-11-17 13:45:18 +00:00
|
|
|
[tasks.install_prerequests]
|
|
|
|
dependencies=["install_targets"]
|
|
|
|
|
|
|
|
[tasks.install_prerequests.windows]
|
|
|
|
dependencies=["install_targets", "install_windows_deps"]
|
|
|
|
|
2021-11-06 12:35:04 +00:00
|
|
|
[tasks.install_protobuf]
|
2021-09-05 05:50:23 +00:00
|
|
|
script = """
|
2021-11-06 15:27:30 +00:00
|
|
|
# Custom dart:
|
2021-11-06 12:35:04 +00:00
|
|
|
#brew tap dart-lang/dart
|
|
|
|
#brew install dart
|
2021-11-06 15:27:30 +00:00
|
|
|
#pub global activate protoc_plugin
|
2021-11-06 12:35:04 +00:00
|
|
|
|
|
|
|
#https://pub.dev/packages/protoc_plugin
|
2021-11-06 15:27:30 +00:00
|
|
|
dart pub global activate protoc_plugin
|
|
|
|
|
2021-11-23 12:04:57 +00:00
|
|
|
cargo install --version 2.22.1 protobuf-codegen
|
2021-09-05 05:50:23 +00:00
|
|
|
"""
|
|
|
|
|
2021-11-17 13:45:18 +00:00
|
|
|
[tasks.install_protobuf.windows]
|
|
|
|
script = """
|
|
|
|
ret = which dart
|
|
|
|
if is_empty ${ret}
|
|
|
|
echo Please make sure flutter/dart is properly installed and in PATH env var
|
|
|
|
exit -1
|
|
|
|
end
|
|
|
|
ret = which protoc-gen-dart
|
|
|
|
if is_empty ${ret}
|
2021-11-23 00:28:59 +00:00
|
|
|
exec cmd.exe /c dart pub global activate protoc_plugin
|
2021-11-17 13:45:18 +00:00
|
|
|
home_dir = get_home_dir
|
|
|
|
echo Please add '${home_dir}\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\bin' into PATH env var
|
|
|
|
exit -1
|
|
|
|
end
|
|
|
|
exec cargo install --version 2.22.1 protobuf-codegen
|
|
|
|
"""
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
2021-09-05 05:50:23 +00:00
|
|
|
[tasks.install_tools]
|
|
|
|
script = """
|
|
|
|
rustup component add rustfmt
|
|
|
|
cargo install cargo-expand
|
|
|
|
cargo install cargo-watch
|
|
|
|
cargo install cargo-cache
|
|
|
|
cargo install bunyan
|
2021-11-06 12:35:04 +00:00
|
|
|
"""
|
2021-09-05 05:50:23 +00:00
|
|
|
|
2021-11-07 02:34:28 +00:00
|
|
|
[tasks.install_cocoapods]
|
|
|
|
script = """
|
|
|
|
# execute "xcode-select --install" before if "extconf.rb failed" error occurs
|
|
|
|
sudo gem install cocoapods
|
|
|
|
"""
|
|
|
|
|
|
|
|
[tasks.install_rbenv]
|
|
|
|
script = """
|
|
|
|
brew install rbenv
|
|
|
|
rbenv init
|
|
|
|
rbenv install 2.7.1
|
|
|
|
rbenv global 2.7.1
|
|
|
|
|
|
|
|
# https://github.com/rbenv/rbenv
|
|
|
|
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash
|
|
|
|
"""
|
|
|
|
|
|
|
|
[tasks.install_fish]
|
|
|
|
script = """
|
|
|
|
brew install fish
|
|
|
|
|
|
|
|
# https://stackoverflow.com/questions/26208231/modifying-path-with-fish-shell
|
|
|
|
# Export the PATH using the command:
|
|
|
|
# set -Ua fish_user_paths the_path_you_want_to_export
|
|
|
|
"""
|
|
|
|
|
2021-11-06 12:35:04 +00:00
|
|
|
[tasks.install_flutter]
|
|
|
|
script = """
|
2021-11-17 13:45:18 +00:00
|
|
|
ret = which flutter
|
|
|
|
if is_empty ${ret}
|
|
|
|
echo "[❤️] Follow the https://flutter.dev/docs/get-started/install instructions to install the flutter, skip if you already installed."
|
2021-12-10 06:43:57 +00:00
|
|
|
echo "Switch to dev channel with command: flutter channel stable"
|
2021-11-17 13:45:18 +00:00
|
|
|
exit -1
|
|
|
|
end
|
2021-09-05 05:50:23 +00:00
|
|
|
"""
|
2021-11-17 13:45:18 +00:00
|
|
|
script_runner = "@duckscript"
|
2021-11-06 12:35:04 +00:00
|
|
|
|