AppFlowy/Makefile.toml
2021-11-06 23:27:30 +08:00

96 lines
2.4 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/env.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"
VERSION = "0.0.1"
FEATURES = "flutter,http_server"
PRODUCT_NAME = "AppFlowy"
#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"
FLUTTER_PLATFORM = "macos"
FLUTTER_OUTPUT_DIR = "Debug"
FEATURES = "flutter"
PRODUCT_EXT = "app"
[env.production-mac]
DEV = false
PROD = true
TARGET_OS = "macos"
DESKTOP_TARGET = "x86_64-apple-darwin"
CRATE_TYPE = "cdylib"
BUILD_FLAG = "release"
FLUTTER_PLATFORM = "macos"
FLUTTER_OUTPUT_DIR = "Release"
FEATURES = "flutter"
PRODUCT_EXT = "app"
[env.production-ios]
DEV = false
PROD = true
TARGET_OS = "ios"
CRATE_TYPE = "staticlib"
BUILD_FLAG = "release"
FLUTTER_PLATFORM = "ios"
FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "ipa"
[env.production-android]
DEV = false
PROD = true
TARGET_OS = "android"
CRATE_TYPE = "cdylib"
BUILD_FLAG = "release"
FLUTTER_PLATFORM = "apk"
FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "apk"
[env.production-win]
DEV = false
PROD = true
TARGET_OS = "windows"
CRATE_TYPE = "cdylib"
BUILD_FLAG = "release"
FLUTTER_PLATFORM = "apk"
FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "exe"
[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"