AppFlowy/Makefile.toml

84 lines
2.1 KiB
TOML

extend = [
{ path = "scripts/makefile/desktop.toml" },
{ path = "scripts/makefile/protobuf.toml" },
{ path = "scripts/makefile/tests.toml" },
{ path = "scripts/makefile/docker.toml" },
{ path = "scripts/makefile/flutter.toml" },
]
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
CARGO_MAKE_CRATE_NAME = "dart-ffi"
#crate_type: https://doc.rust-lang.org/reference/linkage.html
[env.development-mac]
DEV = true
PROD = false
TARGET_OS = "macos"
DESKTOP_TARGET = "x86_64-apple-darwin"
crate_type = "cdylib"
BUILD_FLAG = "debug"
CROSS_PLATFORM = "macos"
FLUTTER_OUTPUT_DIR = "Debug"
[env.production-mac]
DEV = false
PROD = true
TARGET_OS = "macos"
DESKTOP_TARGET = "x86_64-apple-darwin"
crate_type = "cdylib"
BUILD_FLAG = "release"
CROSS_PLATFORM = "macos"
FLUTTER_OUTPUT_DIR = "Release"
[env.production-ios]
DEV = false
PROD = true
TARGET_OS = "ios"
crate_type = "staticlib"
BUILD_FLAG = "release"
CROSS_PLATFORM = "ios"
FLUTTER_OUTPUT_DIR = "Release"
[env.production-android]
DEV = false
PROD = true
TARGET_OS = "android"
crate_type = "cdylib"
BUILD_FLAG = "release"
CROSS_PLATFORM = "apk"
FLUTTER_OUTPUT_DIR = "Release"
[env.production-win]
DEV = false
PROD = true
TARGET_OS = "windows"
crate_type = "cdylib"
BUILD_FLAG = "release"
CROSS_PLATFORM = "apk"
FLUTTER_OUTPUT_DIR = "Release"
[tasks.setup-crate-type]
private = true
script = [
"""
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
val = replace ${toml} "rlib" ${crate_type}
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
val = replace ${toml} ${crate_type} "rlib"
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
assert ${result}
""",
]
script_runner = "@duckscript"