2021-07-04 15:31:33 +00:00
|
|
|
|
2022-02-08 17:14:54 +00:00
|
|
|
[tasks.install_protobuf]
|
2022-02-17 08:32:10 +00:00
|
|
|
mac_alias = "install-protobuf"
|
|
|
|
windows_alias = "install-protobuf-windows"
|
|
|
|
linux_alias = "install-protobuf"
|
|
|
|
|
|
|
|
[tasks.install-protobuf]
|
2022-02-08 14:42:00 +00:00
|
|
|
condition_script = [
|
|
|
|
"""
|
2022-02-13 04:04:34 +00:00
|
|
|
if ! command -v protoc-gen-dart
|
|
|
|
then
|
2022-02-08 14:42:00 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# installed
|
|
|
|
exit 1
|
|
|
|
""",
|
|
|
|
]
|
2022-02-08 17:14:54 +00:00
|
|
|
run_task = { name = ["install_protobuf_compiler"] }
|
2022-02-08 14:42:00 +00:00
|
|
|
|
2022-02-08 17:14:54 +00:00
|
|
|
|
2022-02-17 08:32:10 +00:00
|
|
|
[tasks.install-protobuf-windows]
|
2022-02-08 14:42:00 +00:00
|
|
|
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}
|
|
|
|
exec cmd.exe /c dart pub global activate protoc_plugin
|
|
|
|
home_dir = get_home_dir
|
|
|
|
echo Please add '${home_dir}\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\bin' into PATH env var
|
|
|
|
exit -1
|
|
|
|
end
|
|
|
|
"""
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
2022-02-17 08:32:10 +00:00
|
|
|
|
|
|
|
[tasks.install_protobuf_compiler]
|
|
|
|
script = """
|
|
|
|
echo "Install protoc_plugin (Dart)"
|
|
|
|
dart pub global activate protoc_plugin
|
|
|
|
"""
|
|
|
|
script_runner = "@shell"
|
|
|
|
|
|
|
|
[tasks.install_protobuf_compiler.linux]
|
|
|
|
script = """
|
|
|
|
echo "Install protoc_plugin (Dart)"
|
|
|
|
dart pub global activate protoc_plugin
|
|
|
|
"""
|
|
|
|
script_runner = "@shell"
|
|
|
|
|
|
|
|
|
2021-07-04 15:31:33 +00:00
|
|
|
[tasks.gen_pb_file]
|
|
|
|
script = [
|
|
|
|
"""
|
2021-07-08 05:47:11 +00:00
|
|
|
flowy_tool=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/flowy-tool/Cargo.toml
|
2021-11-29 12:07:38 +00:00
|
|
|
rust_lib=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/
|
2021-11-21 01:34:32 +00:00
|
|
|
shared_lib=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/../shared-lib
|
2021-07-05 07:33:39 +00:00
|
|
|
flutter_lib=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages
|
2021-07-04 15:31:33 +00:00
|
|
|
|
2021-11-21 01:34:32 +00:00
|
|
|
derive_meta=${shared_lib}/flowy-derive/src/derive_cache/derive_cache.rs
|
2021-07-06 01:08:24 +00:00
|
|
|
flutter_package_lib=${flutter_lib}/flowy_sdk/lib
|
2021-07-05 07:33:39 +00:00
|
|
|
|
|
|
|
cargo run \
|
2021-07-08 05:47:11 +00:00
|
|
|
--manifest-path ${flowy_tool} pb-gen \
|
2021-12-04 09:31:32 +00:00
|
|
|
--rust_sources ${rust_lib} ${shared_lib} \
|
2021-07-05 07:33:39 +00:00
|
|
|
--derive_meta=${derive_meta} \
|
2021-07-06 01:08:24 +00:00
|
|
|
--flutter_package_lib=${flutter_package_lib}
|
2021-07-04 15:31:33 +00:00
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@shell"
|
2021-07-08 05:47:11 +00:00
|
|
|
|
|
|
|
|
2021-11-17 13:45:18 +00:00
|
|
|
[tasks.gen_pb_file.windows]
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
flowy_tool=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/flowy-tool/Cargo.toml
|
|
|
|
rust_source=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/
|
2021-11-21 01:34:32 +00:00
|
|
|
# rust_lib=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib
|
2021-11-28 12:34:03 +00:00
|
|
|
shared_lib=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/../shared-lib
|
2021-11-17 13:45:18 +00:00
|
|
|
flutter_lib=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages
|
|
|
|
|
2021-11-21 01:34:32 +00:00
|
|
|
derive_meta=set ${shared_lib}/flowy-derive/src/derive_cache/derive_cache.rs
|
2021-11-17 13:45:18 +00:00
|
|
|
flutter_package_lib=set ${flutter_lib}/flowy_sdk/lib
|
|
|
|
|
|
|
|
exec cmd /c cargo run \
|
|
|
|
--manifest-path ${flowy_tool} pb-gen \
|
|
|
|
--rust_source=${rust_source} \
|
|
|
|
--derive_meta=${derive_meta} \
|
|
|
|
--flutter_package_lib=${flutter_package_lib}
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
|
|
|
|
2021-07-08 05:47:11 +00:00
|
|
|
[tasks.gen_dart_event]
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
flowy_tool=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/flowy-tool/Cargo.toml
|
|
|
|
flutter_lib=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages
|
|
|
|
|
|
|
|
rust_source=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/
|
2022-02-16 03:13:02 +00:00
|
|
|
output=${flutter_lib}/flowy_sdk/lib/dispatch/dart_event.dart
|
2021-07-08 05:47:11 +00:00
|
|
|
|
|
|
|
cargo run \
|
|
|
|
--manifest-path ${flowy_tool} dart-event \
|
2021-11-29 12:07:38 +00:00
|
|
|
--rust_sources=${rust_source} \
|
2021-07-08 05:47:11 +00:00
|
|
|
--output=${output}
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@shell"
|
2021-11-17 13:45:18 +00:00
|
|
|
|
|
|
|
[tasks.gen_dart_event.windows]
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
flowy_tool=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/flowy-tool/Cargo.toml
|
|
|
|
flutter_lib=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages
|
|
|
|
|
|
|
|
rust_source=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/
|
2022-02-16 03:13:02 +00:00
|
|
|
output=set ${flutter_lib}/flowy_sdk/lib/dispatch/dart_event.dart
|
2021-11-17 13:45:18 +00:00
|
|
|
|
|
|
|
exec cmd.exe /c cargo run \
|
|
|
|
--manifest-path ${flowy_tool} dart-event \
|
|
|
|
--rust_source=${rust_source} \
|
|
|
|
--output=${output}
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|