2021-11-15 07:53:08 +00:00
|
|
|
#https://github.com/sagiegurari/cargo-make
|
|
|
|
|
2021-06-28 14:56:15 +00:00
|
|
|
extend = [
|
|
|
|
{ path = "scripts/makefile/desktop.toml" },
|
2021-07-04 15:31:33 +00:00
|
|
|
{ path = "scripts/makefile/protobuf.toml" },
|
2021-09-04 01:00:15 +00:00
|
|
|
{ path = "scripts/makefile/tests.toml" },
|
2021-10-06 07:23:38 +00:00
|
|
|
{ path = "scripts/makefile/docker.toml" },
|
2021-11-06 15:27:30 +00:00
|
|
|
{ path = "scripts/makefile/env.toml" },
|
2021-11-04 10:03:36 +00:00
|
|
|
{ path = "scripts/makefile/flutter.toml" },
|
2021-06-28 14:56:15 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
[env]
|
|
|
|
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
|
|
|
|
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
|
|
|
|
CARGO_MAKE_CRATE_NAME = "dart-ffi"
|
2021-11-15 10:19:38 +00:00
|
|
|
VERSION = "0.0.2"
|
2021-11-15 07:53:08 +00:00
|
|
|
FEATURES = "flutter"
|
2021-11-06 14:35:45 +00:00
|
|
|
PRODUCT_NAME = "AppFlowy"
|
2021-11-04 14:13:05 +00:00
|
|
|
#CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html
|
2021-11-15 13:47:51 +00:00
|
|
|
CRATE_TYPE = "staticlib"
|
|
|
|
SDK_EXT = "a"
|
2021-11-15 07:53:08 +00:00
|
|
|
|
2021-11-04 08:00:08 +00:00
|
|
|
[env.development-mac]
|
|
|
|
TARGET_OS = "macos"
|
2021-11-14 14:46:59 +00:00
|
|
|
RUST_COMPILE_TARGET = "x86_64-apple-darwin"
|
2021-11-04 10:03:36 +00:00
|
|
|
BUILD_FLAG = "debug"
|
|
|
|
FLUTTER_OUTPUT_DIR = "Debug"
|
2021-11-06 14:35:45 +00:00
|
|
|
PRODUCT_EXT = "app"
|
|
|
|
|
2021-11-23 09:45:18 +00:00
|
|
|
[env.production-mac-aarch64]
|
2021-11-15 07:53:08 +00:00
|
|
|
BUILD_FLAG = "release"
|
2021-11-04 08:00:08 +00:00
|
|
|
TARGET_OS = "macos"
|
2021-11-14 14:46:59 +00:00
|
|
|
RUST_COMPILE_TARGET = "aarch64-apple-darwin"
|
2021-11-04 10:03:36 +00:00
|
|
|
FLUTTER_OUTPUT_DIR = "Release"
|
2021-11-06 14:35:45 +00:00
|
|
|
PRODUCT_EXT = "app"
|
2021-11-04 08:00:08 +00:00
|
|
|
|
2021-11-23 09:45:18 +00:00
|
|
|
[env.production-mac-x86]
|
2021-11-04 10:03:36 +00:00
|
|
|
BUILD_FLAG = "release"
|
2021-11-15 07:53:08 +00:00
|
|
|
TARGET_OS = "macos"
|
|
|
|
RUST_COMPILE_TARGET = "x86_64-apple-darwin"
|
2021-11-04 10:03:36 +00:00
|
|
|
FLUTTER_OUTPUT_DIR = "Release"
|
2021-11-15 07:53:08 +00:00
|
|
|
PRODUCT_EXT = "app"
|
2021-11-04 08:00:08 +00:00
|
|
|
|
2021-11-17 06:17:46 +00:00
|
|
|
|
2021-11-23 09:45:18 +00:00
|
|
|
[env.development-windows-x86]
|
2021-11-17 06:17:46 +00:00
|
|
|
TARGET_OS = "windows"
|
|
|
|
RUST_COMPILE_TARGET = "x86_64-pc-windows-msvc"
|
|
|
|
BUILD_FLAG = "debug"
|
|
|
|
FLUTTER_OUTPUT_DIR = "Debug"
|
|
|
|
PRODUCT_EXT = "exe"
|
2021-11-17 09:52:49 +00:00
|
|
|
CRATE_TYPE = "cdylib"
|
|
|
|
SDK_EXT = "dll"
|
2021-11-17 06:17:46 +00:00
|
|
|
|
2021-11-23 09:45:18 +00:00
|
|
|
[env.production-windows-x86]
|
2021-11-04 10:03:36 +00:00
|
|
|
BUILD_FLAG = "release"
|
2021-11-04 08:00:08 +00:00
|
|
|
TARGET_OS = "windows"
|
2021-11-17 06:17:46 +00:00
|
|
|
RUST_COMPILE_TARGET = "x86_64-pc-windows-msvc"
|
2021-11-04 10:03:36 +00:00
|
|
|
FLUTTER_OUTPUT_DIR = "Release"
|
2021-11-06 14:35:45 +00:00
|
|
|
PRODUCT_EXT = "exe"
|
2021-11-17 09:52:49 +00:00
|
|
|
CRATE_TYPE = "cdylib"
|
|
|
|
SDK_EXT = "dll"
|
2021-06-28 14:56:15 +00:00
|
|
|
|
2021-11-19 03:13:07 +00:00
|
|
|
[env.development-linux-x86]
|
|
|
|
TARGET_OS = "linux"
|
|
|
|
RUST_COMPILE_TARGET = "x86_64-unknown-linux-gnu"
|
|
|
|
BUILD_FLAG = "debug"
|
|
|
|
CRATE_TYPE = "cdylib"
|
|
|
|
FLUTTER_OUTPUT_DIR = "Debug"
|
|
|
|
SDK_EXT = "so"
|
2021-11-19 14:40:57 +00:00
|
|
|
LINUX_ARCH = "x64"
|
2021-11-19 03:13:07 +00:00
|
|
|
|
|
|
|
[env.production-linux-x86]
|
|
|
|
BUILD_FLAG = "release"
|
|
|
|
TARGET_OS = "linux"
|
|
|
|
RUST_COMPILE_TARGET = "x86_64-unknown-linux-gnu"
|
|
|
|
CRATE_TYPE = "cdylib"
|
|
|
|
FLUTTER_OUTPUT_DIR = "Release"
|
|
|
|
SDK_EXT = "so"
|
2021-11-19 14:40:57 +00:00
|
|
|
LINUX_ARCH = "x64"
|
|
|
|
|
|
|
|
[env.development-linux-aarch64]
|
|
|
|
TARGET_OS = "linux"
|
|
|
|
RUST_COMPILE_TARGET = "aarch64-unknown-linux-gnu"
|
|
|
|
BUILD_FLAG = "debug"
|
|
|
|
CRATE_TYPE = "cdylib"
|
|
|
|
FLUTTER_OUTPUT_DIR = "Debug"
|
|
|
|
SDK_EXT = "so"
|
|
|
|
LINUX_ARCH = "arm64"
|
2021-11-19 03:13:07 +00:00
|
|
|
|
2021-11-19 09:34:49 +00:00
|
|
|
[env.production-linux-aarch64]
|
|
|
|
BUILD_FLAG = "release"
|
|
|
|
TARGET_OS = "linux"
|
|
|
|
RUST_COMPILE_TARGET = "aarch64-unknown-linux-gnu"
|
|
|
|
CRATE_TYPE = "cdylib"
|
|
|
|
FLUTTER_OUTPUT_DIR = "Release"
|
|
|
|
SDK_EXT = "so"
|
2021-11-19 14:40:57 +00:00
|
|
|
LINUX_ARCH = "arm64"
|
2021-11-19 09:34:49 +00:00
|
|
|
|
2021-11-15 07:53:08 +00:00
|
|
|
[tasks.echo_env]
|
|
|
|
script = [
|
|
|
|
'''
|
2021-11-23 07:30:08 +00:00
|
|
|
echo "-------- Env Parameters --------"
|
2021-11-15 10:15:09 +00:00
|
|
|
echo CRATE_TYPE: ${CRATE_TYPE}
|
2021-11-15 07:53:08 +00:00
|
|
|
echo BUILD_FLAG: ${BUILD_FLAG}
|
|
|
|
echo TARGET_OS: ${TARGET_OS}
|
|
|
|
echo RUST_COMPILE_TARGET: ${RUST_COMPILE_TARGET}
|
|
|
|
echo FEATURES: ${FEATURES}
|
|
|
|
echo PRODUCT_EXT: ${PRODUCT_EXT}
|
|
|
|
echo ${platforms}
|
2021-11-23 07:30:08 +00:00
|
|
|
|
|
|
|
echo "-------- Flutter --------"
|
|
|
|
flutter doctor
|
|
|
|
|
|
|
|
echo "-------- Rust --------"
|
|
|
|
rustup show
|
2021-11-15 07:53:08 +00:00
|
|
|
'''
|
|
|
|
]
|
2021-11-23 07:30:08 +00:00
|
|
|
script_runner = "@shell"
|
2021-11-15 07:53:08 +00:00
|
|
|
|
|
|
|
[env.production-ios]
|
|
|
|
BUILD_FLAG = "release"
|
|
|
|
TARGET_OS = "ios"
|
|
|
|
CRATE_TYPE = "staticlib"
|
|
|
|
BUILD_FLAG = "release"
|
|
|
|
FLUTTER_OUTPUT_DIR = "Release"
|
|
|
|
PRODUCT_EXT = "ipa"
|
|
|
|
|
|
|
|
|
2021-06-28 14:56:15 +00:00
|
|
|
[tasks.setup-crate-type]
|
|
|
|
private = true
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
|
2021-11-19 03:13:07 +00:00
|
|
|
val = replace ${toml} "staticlib" ${CRATE_TYPE}
|
2021-06-28 14:56:15 +00:00
|
|
|
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
|
|
|
|
assert ${result}
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
|
|
|
[tasks.restore-crate-type]
|
|
|
|
private = true
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
|
2021-11-19 03:13:07 +00:00
|
|
|
val = replace ${toml} ${CRATE_TYPE} "staticlib"
|
2021-06-28 14:56:15 +00:00
|
|
|
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
|
|
|
|
assert ${result}
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|