From 4b605b6373e8b00a64328edc53bc425e2a2b14de Mon Sep 17 00:00:00 2001 From: "Nathan.fooo" <86001920+appflowy@users.noreply.github.com> Date: Fri, 3 Feb 2023 14:13:33 +0800 Subject: [PATCH] chore: update vscode task (#1790) --- frontend/.vscode/launch.json | 75 ++++++++-------------- frontend/.vscode/tasks.json | 37 +++-------- frontend/rust-lib/flowy-codegen/Cargo.toml | 2 +- frontend/scripts/build_sdk.cmd | 3 - frontend/scripts/build_sdk.sh | 36 ----------- 5 files changed, 36 insertions(+), 117 deletions(-) delete mode 100644 frontend/scripts/build_sdk.cmd delete mode 100755 frontend/scripts/build_sdk.sh diff --git a/frontend/.vscode/launch.json b/frontend/.vscode/launch.json index 3e85432aa1..256b9651c3 100644 --- a/frontend/.vscode/launch.json +++ b/frontend/.vscode/launch.json @@ -4,6 +4,19 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + // This task builds the Rust and Dart code of AppFlowy. + "name": "AF-desktop: Build All", + "request": "launch", + "program": "./lib/main.dart", + "type": "dart", + "preLaunchTask": "AF: Build Appflowy Core", + "env": { + // "RUST_LOG": "trace" + "RUST_LOG": "debug" + }, + "cwd": "${workspaceRoot}/app_flowy" + }, { // This task only builds the Dart code of AppFlowy. "name": "AF-desktop: Build Dart Only", @@ -15,29 +28,6 @@ }, "cwd": "${workspaceRoot}/app_flowy" }, - { - // This task builds the Rust and Dart code of AppFlowy. - "name": "AF-desktop: Build All", - "request": "launch", - "program": "./lib/main.dart", - "type": "dart", - "preLaunchTask": "AF: build_flowy_sdk", - "env": { - "RUST_LOG": "debug" - }, - "cwd": "${workspaceRoot}/app_flowy" - }, - { - "name": "AF-desktop: Build All (rustlog: trace)", - "request": "launch", - "program": "./lib/main.dart", - "type": "dart", - "preLaunchTask": "AF: build_flowy_sdk", - "env": { - "RUST_LOG": "trace" - }, - "cwd": "${workspaceRoot}/app_flowy" - }, { // This task builds will: // - call the clean task, @@ -53,6 +43,20 @@ }, "cwd": "${workspaceRoot}/app_flowy" }, + { + "name": "AF-desktop: Debug Rust", + "request": "attach", + "type": "lldb", + "pid": "${command:pickMyProcess}" + }, + // { + // "name": "AF-desktop: profile mode", + // "request": "launch", + // "program": "./lib/main.dart", + // "type": "dart", + // "flutterMode": "profile", + // "cwd": "${workspaceRoot}/app_flowy" + // }, { // This task builds the Rust and Dart code of AppFlowy for android. "name": "AF-android: Build All", @@ -65,17 +69,6 @@ }, "cwd": "${workspaceRoot}/app_flowy" }, - { - "name": "AF-android: Build All (rustlog: trace)", - "request": "launch", - "program": "./lib/main.dart", - "type": "dart", - "preLaunchTask": "AF: build_mobile_sdk", - "env": { - "RUST_LOG": "trace" - }, - "cwd": "${workspaceRoot}/app_flowy" - }, { // This task builds will: // - call the clean task, @@ -116,19 +109,5 @@ // "preLaunchTask": "AF: Tauri UI Build", // "cwd": "${workspaceRoot}/appflowy_tauri/" // }, - { - "name": "AF: Debug Rust", - "request": "attach", - "type": "lldb", - "pid": "${command:pickMyProcess}" - }, - { - "name": "AF: app_flowy (profile mode)", - "request": "launch", - "program": "./lib/main.dart", - "type": "dart", - "flutterMode": "profile", - "cwd": "${workspaceRoot}/app_flowy" - }, ] } \ No newline at end of file diff --git a/frontend/.vscode/tasks.json b/frontend/.vscode/tasks.json index 0aeb819865..2ed54bc78a 100644 --- a/frontend/.vscode/tasks.json +++ b/frontend/.vscode/tasks.json @@ -16,7 +16,7 @@ "dependsOn": [ "AF: Dart Clean", "AF: Flutter Clean", - "AF: build_flowy_sdk", + "AF: Build Appflowy Core", "AF: Flutter Pub Get", "AF: Flutter Package Get", "AF: Generate Language Files", @@ -34,7 +34,7 @@ "dependsOn": [ "AF: Dart Clean", "AF: Flutter Clean", - "AF: build_flowy_sdk_for_android", + "AF: Build Appflowy Core_for_android", "AF: Flutter Pub Get", "AF: Flutter Package Get", "AF: Generate Language Files", @@ -46,7 +46,7 @@ } }, { - "label": "AF: build_flowy_sdk_for_android", + "label": "AF: Build Appflowy Core_for_android", "type": "shell", "command": "cargo make --profile development-android appflowy-core-dev-android", "group": "build", @@ -55,37 +55,16 @@ } }, { - "label": "AF: build_flowy_sdk", + "label": "AF: Build Appflowy Core", "type": "shell", - "command": "sh ./scripts/build_sdk.sh", "windows": { - "options": { - "env": { - "FLOWY_DEV_ENV": "Windows" - }, - "shell": { - "executable": "cmd.exe", - "args": [ - "/d", - "/c", - ".\\scripts\\build_sdk.cmd" - ] - } - } + "command": "cargo make --profile development-windows appflowy-core-dev" }, "linux": { - "options": { - "env": { - "FLOWY_DEV_ENV": "Linux" - } - } + "command": "cargo make --profile \"development-linux-$(uname -m)\" appflowy-core-dev" }, "osx": { - "options": { - "env": { - "FLOWY_DEV_ENV": "macOS" - } - } + "command": "cargo make --profile \"development-mac-$(uname -m)\" appflowy-core-dev" }, "group": "build", "options": { @@ -221,7 +200,7 @@ "options": { "cwd": "${workspaceFolder}" }, - "problemMatcher": ["$tsc"], + "problemMatcher": ["$tsc"] }, { "label": "AF: Tauri Clean + Dev", diff --git a/frontend/rust-lib/flowy-codegen/Cargo.toml b/frontend/rust-lib/flowy-codegen/Cargo.toml index d65ca032cf..40143cfbdb 100644 --- a/frontend/rust-lib/flowy-codegen/Cargo.toml +++ b/frontend/rust-lib/flowy-codegen/Cargo.toml @@ -12,7 +12,7 @@ serde_json = "1.0" flowy-ast = { path = "../flowy-ast"} quote = "1.0" -cmd_lib = { version = "1", optional = true } +cmd_lib = { version = "1.3.0", optional = true } protoc-rust = { version = "2", optional = true } walkdir = { version = "2", optional = true } similar = { version = "1.2.2", optional = true } diff --git a/frontend/scripts/build_sdk.cmd b/frontend/scripts/build_sdk.cmd deleted file mode 100644 index 05a95b29c4..0000000000 --- a/frontend/scripts/build_sdk.cmd +++ /dev/null @@ -1,3 +0,0 @@ -echo "Start building rust sdk" -rustup show -cargo make --profile development-windows-x86 appflowy-core-dev \ No newline at end of file diff --git a/frontend/scripts/build_sdk.sh b/frontend/scripts/build_sdk.sh deleted file mode 100755 index b94776ccd0..0000000000 --- a/frontend/scripts/build_sdk.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -#!/usr/bin/env fish -echo 'Start building rust sdk' - -rustup show - -#Env check -#1. rustc --version will be the same as cargo --version -#2. override the toolchain if the current toolchain not equal to the rust-toolchain file specified. -# rustup override set stable-2021-04-24 -#3. Check your cargo env using the same source by: which cargo -# 1. ~/.bash_profile, -# 2. ~/.bashrc -# 3. ~/.profile -# 4. ~/.zshrc - - -case "$FLOWY_DEV_ENV" in -Linux) - cargo make --profile "development-linux-$(uname -m)" appflowy-core-dev - ;; - -macOS) - cargo make --profile "development-mac-$(uname -m)" appflowy-core-dev - ;; - -Windows) - cargo make --profile development-windows appflowy-core-dev - ;; - -*) - # All undefined cases - echo "[ERROR] The FLOWY_DEV_ENV environment variable must be set. Please see the GitHub wiki for instructions." - exit 1 - ;; -esac