mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Feat/tauri (#1716)
* feat: support tauri desktop * chore: support call flowy sdk command * chore: switch to svelte * chore: gen js protobuf * chore: import js protobuf * chore: call flowy sdk handler * chore: update scipts * chore: create index.ts * chore: track files * chore: gen ts event * chore: replace application icon * chore: migrate to react * chore: fix wanrings Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
# cargo make --profile production-windows-x86 appflowy-sdk-dev
|
||||
|
||||
[tasks.env_check]
|
||||
dependencies = ["echo_env", "install_protobuf"]
|
||||
dependencies = ["echo_env", "install_flutter_protobuf"]
|
||||
condition = { env_set = [
|
||||
"BUILD_FLAG",
|
||||
"RUST_COMPILE_TARGET",
|
||||
|
@ -1,5 +1,8 @@
|
||||
[tasks.appflowy-deps-tools]
|
||||
run_task = { name = ["install_prerequests","install_diesel", "install_protobuf"] }
|
||||
[tasks.appflowy-flutter-deps-tools]
|
||||
run_task = { name = ["install_flutter_prerequests","install_diesel"] }
|
||||
|
||||
[tasks.appflowy-tauri-deps-tools]
|
||||
run_task = { name = ["install_tauri_prerequests","install_diesel"] }
|
||||
|
||||
[tasks.install_windows_deps.windows]
|
||||
dependencies=["check_duckscript_installation", "check_visual_studio_installation", "check_vcpkg", "install_vcpkg_sqlite", "install_rust_vcpkg_cli"]
|
||||
@ -89,10 +92,13 @@ script = """
|
||||
rustup target add x86_64-unknown-linux-gnu
|
||||
"""
|
||||
|
||||
[tasks.install_prerequests]
|
||||
dependencies=["install_targets"]
|
||||
[tasks.install_tauri_prerequests]
|
||||
dependencies=["install_targets", "install_tauri_protobuf"]
|
||||
|
||||
[tasks.install_prerequests.windows]
|
||||
[tasks.install_flutter_prerequests]
|
||||
dependencies=["install_targets", "install_flutter_protobuf"]
|
||||
|
||||
[tasks.install_flutter_prerequests.windows]
|
||||
dependencies=["install_targets", "install_windows_deps"]
|
||||
|
||||
[tasks.install_tools]
|
||||
|
@ -1,5 +1,11 @@
|
||||
|
||||
[tasks.install_protobuf]
|
||||
[tasks.install_tauri_protobuf]
|
||||
script = """
|
||||
npm install -g protoc-gen-ts
|
||||
"""
|
||||
script_runner = "@duckscript"
|
||||
|
||||
[tasks.install_flutter_protobuf]
|
||||
mac_alias = "install-protobuf"
|
||||
windows_alias = "install-protobuf-windows"
|
||||
linux_alias = "install-protobuf"
|
||||
@ -16,8 +22,7 @@ condition_script = [
|
||||
exit 1
|
||||
""",
|
||||
]
|
||||
run_task = { name = ["install_protobuf_compiler"] }
|
||||
|
||||
run_task = { name = ["install_flutter_protobuf_compiler"] }
|
||||
|
||||
[tasks.install-protobuf-windows]
|
||||
script = """
|
||||
@ -40,14 +45,14 @@ end
|
||||
script_runner = "@duckscript"
|
||||
|
||||
|
||||
[tasks.install_protobuf_compiler]
|
||||
[tasks.install_flutter_protobuf_compiler]
|
||||
script = """
|
||||
echo "Install protoc_plugin (Dart)"
|
||||
dart pub global activate protoc_plugin
|
||||
"""
|
||||
script_runner = "@shell"
|
||||
|
||||
[tasks.install_protobuf_compiler.linux]
|
||||
[tasks.install_flutter_protobuf_compiler.linux]
|
||||
script = """
|
||||
echo "Install protoc_plugin (Dart)"
|
||||
dart pub global activate protoc_plugin
|
||||
|
63
frontend/scripts/makefile/tauri.toml
Normal file
63
frontend/scripts/makefile/tauri.toml
Normal file
@ -0,0 +1,63 @@
|
||||
[tasks.tauri_build]
|
||||
script = [
|
||||
"""
|
||||
cd appflowy_tauri/src-tauri
|
||||
npm run tauri build
|
||||
""",
|
||||
]
|
||||
script_runner = "@shell"
|
||||
|
||||
[tasks.tauri_pb]
|
||||
script = [
|
||||
"""
|
||||
cd appflowy_tauri/src-tauri
|
||||
cargo build
|
||||
""",
|
||||
]
|
||||
script_runner = "@shell"
|
||||
|
||||
[tasks.tauri_dev]
|
||||
script = [
|
||||
"""
|
||||
cd appflowy_tauri
|
||||
npm run tauri dev
|
||||
""",
|
||||
]
|
||||
script_runner = "@shell"
|
||||
|
||||
[tasks.tauri_clean]
|
||||
run_task = { name = [
|
||||
"rust_lib_clean",
|
||||
"rm_macro_build_cache",
|
||||
"rm_rust_generated_files",
|
||||
"rm_tauri_generated_protobuf_files",
|
||||
"rm_tauri_generated_event_files",
|
||||
] }
|
||||
|
||||
[tasks.rm_tauri_generated_protobuf_files]
|
||||
private = true
|
||||
script = ["""
|
||||
protobuf_file_paths = glob_array ${TAURI_PROTOBUF_PATH}/classes
|
||||
if not array_is_empty ${protobuf_file_paths}
|
||||
echo Remove generated protobuf files:
|
||||
for path in ${protobuf_file_paths}
|
||||
echo remove ${path}
|
||||
rm -rf ${path}
|
||||
end
|
||||
end
|
||||
"""]
|
||||
script_runner = "@duckscript"
|
||||
|
||||
[tasks.rm_tauri_generated_event_files]
|
||||
private = true
|
||||
script = ["""
|
||||
protobuf_file_paths = glob_array ${TAURI_PROTOBUF_PATH}/events
|
||||
if not array_is_empty ${protobuf_file_paths}
|
||||
echo Remove generated protobuf files:
|
||||
for path in ${protobuf_file_paths}
|
||||
echo remove ${path}
|
||||
rm -rf ${path}
|
||||
end
|
||||
end
|
||||
"""]
|
||||
script_runner = "@duckscript"
|
@ -214,7 +214,7 @@ run_task = { name = [
|
||||
description = "Run rust unit test with code coverage"
|
||||
run_task = { name = [
|
||||
"check_grcov",
|
||||
'appflowy-deps-tools',
|
||||
'appflowy-flutter-deps-tools',
|
||||
"run_rustlib_coverage_tests",
|
||||
"run_sharedlib_coverage_tests",
|
||||
"get_lcov_report",
|
||||
|
@ -1,12 +1,12 @@
|
||||
[tasks.flowy_clean]
|
||||
[tasks.dart_clean]
|
||||
run_task = { name = [
|
||||
"cargo_clean",
|
||||
"rust_lib_clean",
|
||||
"rm_macro_build_cache",
|
||||
"rm_rust_generated_files",
|
||||
"rm_dart_generated_files",
|
||||
] }
|
||||
|
||||
[tasks.cargo_clean]
|
||||
[tasks.rust_lib_clean]
|
||||
script = ["""
|
||||
cd rust-lib
|
||||
cargo clean -q
|
||||
|
Reference in New Issue
Block a user