mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
[flutter]: support dev build window
This commit is contained in:
parent
93ce7d3b7d
commit
58078c26db
4
app_flowy/.gitignore
vendored
4
app_flowy/.gitignore
vendored
@ -48,5 +48,5 @@ app.*.map.json
|
|||||||
/packages/flowy_protobuf
|
/packages/flowy_protobuf
|
||||||
/packages/flutter-quill
|
/packages/flutter-quill
|
||||||
|
|
||||||
product/**/Release
|
product/**
|
||||||
product/**/Debug
|
windows/flutter/dart_ffi/
|
@ -1,5 +0,0 @@
|
|||||||
# Debug Mode
|
|
||||||
|
|
||||||
|
|
||||||
# Release Mode
|
|
||||||
These DLLS need to be copied into the /Release folder each time we export a build.
|
|
@ -1,15 +0,0 @@
|
|||||||
#include <stdarg.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
|
|
||||||
int64_t init_sdk(char *path);
|
|
||||||
|
|
||||||
void async_command(int64_t port, const uint8_t *input, uintptr_t len);
|
|
||||||
|
|
||||||
const uint8_t *sync_command(const uint8_t *input, uintptr_t len);
|
|
||||||
|
|
||||||
int32_t set_stream_port(int64_t port);
|
|
||||||
|
|
||||||
void link_me_please(void);
|
|
@ -62,6 +62,7 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|||||||
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
|
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(DART_FFI_DIR "${CMAKE_INSTALL_PREFIX}")
|
||||||
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
||||||
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
|
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
@ -71,6 +72,9 @@ install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
|
|||||||
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
|
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
|
||||||
COMPONENT Runtime)
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
install(FILES "${DART_FFI_DLL}" DESTINATION "${DART_FFI_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
COMPONENT Runtime)
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
|
|||||||
# Published to parent scope for install step.
|
# Published to parent scope for install step.
|
||||||
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
|
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
|
||||||
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
|
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
|
||||||
|
set(DART_FFI_DLL "${CMAKE_CURRENT_SOURCE_DIR}/dart_ffi/dart_ffi.dll" PARENT_SCOPE)
|
||||||
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
|
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
|
||||||
set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
|
set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
|
||||||
|
|
||||||
|
@ -15,3 +15,8 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
|
|||||||
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
|
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
|
||||||
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
|
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
|
||||||
add_dependencies(${BINARY_NAME} flutter_assemble)
|
add_dependencies(${BINARY_NAME} flutter_assemble)
|
||||||
|
|
||||||
|
|
||||||
|
# === Flutter Library ===
|
||||||
|
#set(DART_FFI "${CMAKE_CURRENT_SOURCE_DIR}/dart_ffi/dart_ffi.dll")
|
||||||
|
#set(DART_FFI ${DART_FFI} PARENT_SCOPE)
|
@ -7,8 +7,8 @@ edition = "2018"
|
|||||||
[lib]
|
[lib]
|
||||||
name = "dart_ffi"
|
name = "dart_ffi"
|
||||||
# this value will change depending on the target os
|
# this value will change depending on the target os
|
||||||
# default cdylib
|
# default staticlib
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["staticlib"]
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -13,6 +13,9 @@ rustup show
|
|||||||
# 3. ~/.profile
|
# 3. ~/.profile
|
||||||
# 4. ~/.zshrc
|
# 4. ~/.zshrc
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: Automatically exec the script base on the current system
|
||||||
|
|
||||||
# for macos
|
# for macos
|
||||||
cargo make --profile development-mac flowy-sdk-dev
|
cargo make --profile development-mac flowy-sdk-dev
|
||||||
|
|
||||||
|
@ -77,11 +77,15 @@ private = true
|
|||||||
script = [
|
script = [
|
||||||
"""
|
"""
|
||||||
echo "🚀 🚀 🚀 Flowy-SDK(windows) build success"
|
echo "🚀 🚀 🚀 Flowy-SDK(windows) build success"
|
||||||
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT} \
|
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/windows/flutter/dart_ffi
|
||||||
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/flowy_sdk/${TARGET_OS}/dart_ffi/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT}
|
|
||||||
|
|
||||||
|
# copy dll
|
||||||
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT} \
|
||||||
|
${dart_ffi_dir}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT}
|
||||||
|
|
||||||
|
# copy binding.h
|
||||||
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/binding.h \
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/binding.h \
|
||||||
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/flowy_sdk/${TARGET_OS}/dart_ffi/binding.h
|
${dart_ffi_dir}/binding.h
|
||||||
""",
|
""",
|
||||||
]
|
]
|
||||||
script_runner = "@duckscript"
|
script_runner = "@duckscript"
|
||||||
|
@ -9,7 +9,7 @@ script_runner = "@shell"
|
|||||||
|
|
||||||
[tasks.appflowy-windows]
|
[tasks.appflowy-windows]
|
||||||
dependencies = ["flowy-sdk-release"]
|
dependencies = ["flowy-sdk-release"]
|
||||||
run_task = { name = ["flutter-build", "copy-dll-to-build-folder", "copy-to-product"] }
|
run_task = { name = ["flutter-build", "copy-to-product"] }
|
||||||
|
|
||||||
[tasks.copy-to-product]
|
[tasks.copy-to-product]
|
||||||
mac_alias = "copy-to-product-macos"
|
mac_alias = "copy-to-product-macos"
|
||||||
@ -32,20 +32,20 @@ script = [
|
|||||||
]
|
]
|
||||||
script_runner = "@shell"
|
script_runner = "@shell"
|
||||||
|
|
||||||
[tasks.copy-dll-to-build-folder]
|
|
||||||
script = [
|
|
||||||
"""
|
|
||||||
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT} \
|
|
||||||
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/runner/${BUILD_FLAG}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT}
|
|
||||||
""",
|
|
||||||
]
|
|
||||||
script_runner = "@duckscript"
|
|
||||||
|
|
||||||
[tasks.copy-to-product-windows]
|
[tasks.copy-to-product-windows]
|
||||||
script = [
|
script = [
|
||||||
"""
|
"""
|
||||||
# TODO:
|
product_path= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}
|
||||||
echo TBD...
|
output_path= set ${product_path}/${TARGET_OS}
|
||||||
|
if is_path_exists ${output_path}
|
||||||
|
rm -r ${output_path}/
|
||||||
|
fi
|
||||||
|
mkdir ${output_path}
|
||||||
|
|
||||||
|
product= set ${PRODUCT_NAME}
|
||||||
|
glob_cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/runner/${FLUTTER_OUTPUT_DIR}/**/* \
|
||||||
|
${output_path}/${product}
|
||||||
""",
|
""",
|
||||||
]
|
]
|
||||||
script_runner = "@duckscript"
|
script_runner = "@duckscript"
|
||||||
|
Loading…
Reference in New Issue
Block a user