mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Merge pull request #79 from pdckxd/main
[Build] Enhance windows build instruction and cargo make scripts
This commit is contained in:
@ -51,13 +51,15 @@ cargo make -p development-windows pb
|
|||||||
```
|
```
|
||||||
10. Build flowy-sdk (dart-ffi)
|
10. Build flowy-sdk (dart-ffi)
|
||||||
```shell
|
```shell
|
||||||
# TODO: for development
|
# for development
|
||||||
|
cargo make --profile development-desktop-windows-x86 flowy-sdk-dev
|
||||||
# for production
|
# for production
|
||||||
cargo make --profile production-desktop-windows-x86 flowy-sdk-release
|
cargo make --profile production-desktop-windows-x86 flowy-sdk-release
|
||||||
```
|
```
|
||||||
11. Build app_flowy
|
11. Build app_flowy
|
||||||
```shell
|
```shell
|
||||||
# TODO: for development
|
# for development
|
||||||
|
cargo make -p development-desktop-windows-x86 appflowy-windows-dev
|
||||||
# for production
|
# for production
|
||||||
cargo make -p production-desktop-windows-x86 appflowy-windows
|
cargo make -p production-desktop-windows-x86 appflowy-windows
|
||||||
```
|
```
|
||||||
|
@ -42,7 +42,7 @@ FLUTTER_OUTPUT_DIR = "Release"
|
|||||||
PRODUCT_EXT = "app"
|
PRODUCT_EXT = "app"
|
||||||
|
|
||||||
|
|
||||||
[env.development-windows]
|
[env.development-desktop-windows-x86]
|
||||||
TARGET_OS = "windows"
|
TARGET_OS = "windows"
|
||||||
RUST_COMPILE_TARGET = "x86_64-pc-windows-msvc"
|
RUST_COMPILE_TARGET = "x86_64-pc-windows-msvc"
|
||||||
BUILD_FLAG = "debug"
|
BUILD_FLAG = "debug"
|
||||||
|
12
frontend/app_flowy/.vscode/tasks.json
vendored
12
frontend/app_flowy/.vscode/tasks.json
vendored
@ -2,7 +2,7 @@
|
|||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
// https://code.visualstudio.com/docs/editor/tasks
|
// https://code.visualstudio.com/docs/editor/tasks
|
||||||
//https://gist.github.com/deadalusai/9e13e36d61ec7fb72148
|
//https://gist.github.com/deadalusai/9e13e36d61ec7fb72148
|
||||||
|
|
||||||
// ${workspaceRoot}: the root folder of the team
|
// ${workspaceRoot}: the root folder of the team
|
||||||
// ${file}: the current opened file
|
// ${file}: the current opened file
|
||||||
// ${fileBasename}: the current opened file's basename
|
// ${fileBasename}: the current opened file's basename
|
||||||
@ -13,6 +13,16 @@
|
|||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "sh ./scripts/build_sdk.sh",
|
"command": "sh ./scripts/build_sdk.sh",
|
||||||
|
"windows": {
|
||||||
|
"options": {
|
||||||
|
"shell": {
|
||||||
|
"executable": "cmd.exe",
|
||||||
|
"args": [
|
||||||
|
"/d", "/c", ".\\scripts\\build_sdk.cmd"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}/../"
|
"cwd": "${workspaceFolder}/../"
|
||||||
|
3
frontend/scripts/build_sdk.cmd
Normal file
3
frontend/scripts/build_sdk.cmd
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
echo "Start building rust sdk"
|
||||||
|
rustup show
|
||||||
|
cargo make --profile development-desktop-windows-x86 flowy-sdk-dev
|
@ -41,6 +41,18 @@ script = [
|
|||||||
]
|
]
|
||||||
script_runner = "@shell"
|
script_runner = "@shell"
|
||||||
|
|
||||||
|
[tasks.sdk-build.windows]
|
||||||
|
private = true
|
||||||
|
script = [
|
||||||
|
"""
|
||||||
|
cd rust-lib
|
||||||
|
echo cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features=${FEATURES}
|
||||||
|
exec cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features=${FEATURES}
|
||||||
|
cd ..
|
||||||
|
""",
|
||||||
|
]
|
||||||
|
script_runner = "@duckscript"
|
||||||
|
|
||||||
#
|
#
|
||||||
[tasks.flowy-sdk-release]
|
[tasks.flowy-sdk-release]
|
||||||
description = "Build flowy sdk in release mode"
|
description = "Build flowy sdk in release mode"
|
||||||
|
@ -10,6 +10,7 @@ output = exec powershell -Command "Get-CimInstance MSFT_VSInstance | select -Exp
|
|||||||
stdout = set ${output.stdout}
|
stdout = set ${output.stdout}
|
||||||
pos = last_indexof ${stdout} .
|
pos = last_indexof ${stdout} .
|
||||||
new_str = substring ${stdout} 0 ${pos}
|
new_str = substring ${stdout} 0 ${pos}
|
||||||
|
# TODO: will raise error if there are more than 1 visual studio installation
|
||||||
newer = semver_is_newer ${new_str} 16.11.0
|
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"
|
assert ${newer} "Visual studio 2019 is not installed or version is lower than 16.11.0"
|
||||||
"""
|
"""
|
||||||
@ -101,7 +102,7 @@ if is_empty ${ret}
|
|||||||
end
|
end
|
||||||
ret = which protoc-gen-dart
|
ret = which protoc-gen-dart
|
||||||
if is_empty ${ret}
|
if is_empty ${ret}
|
||||||
dart pub global activate protoc_plugin
|
exec cmd.exe /c dart pub global activate protoc_plugin
|
||||||
home_dir = get_home_dir
|
home_dir = get_home_dir
|
||||||
echo Please add '${home_dir}\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\bin' into PATH env var
|
echo Please add '${home_dir}\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\bin' into PATH env var
|
||||||
exit -1
|
exit -1
|
||||||
|
Reference in New Issue
Block a user