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-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"
|
|
|
|
DEV = true
|
|
|
|
LIB_OUT_DIR = "debug"
|
|
|
|
RELEASE = false
|
2021-07-25 03:08:59 +00:00
|
|
|
#TARGET_OS = "unknown"
|
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
|
|
|
|
crate_type = set ""
|
|
|
|
os = get_env TARGET_OS
|
|
|
|
is_android = eq ${os} "android"
|
|
|
|
is_ios = eq ${os} "ios"
|
|
|
|
is_macos = eq ${os} "macos"
|
|
|
|
is_pad = eq ${os} "pad"
|
|
|
|
|
|
|
|
if ${is_android}
|
|
|
|
crate_type = set "cdylib"
|
|
|
|
elseif ${is_ios}
|
|
|
|
crate_type = set "staticlib"
|
|
|
|
elseif ${is_macos}
|
|
|
|
crate_type = set "cdylib"
|
|
|
|
elseif ${is_pad}
|
|
|
|
crate_type = set "cdylib"
|
|
|
|
else
|
|
|
|
crate_type = set "rlib"
|
|
|
|
end
|
|
|
|
|
|
|
|
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
|
|
|
|
crate_type = set ""
|
|
|
|
os = get_env TARGET_OS
|
|
|
|
is_android = eq ${os} "android"
|
|
|
|
is_ios = eq ${os} "ios"
|
|
|
|
is_macos = eq ${os} "macos"
|
|
|
|
is_pad = eq ${os} "pad"
|
|
|
|
|
|
|
|
if ${is_android}
|
|
|
|
crate_type = set "cdylib"
|
|
|
|
elseif ${is_ios}
|
|
|
|
crate_type = set "staticlib"
|
|
|
|
elseif ${is_macos}
|
|
|
|
crate_type = set "cdylib"
|
|
|
|
elseif ${is_pad}
|
|
|
|
crate_type = set "cdylib"
|
|
|
|
else
|
|
|
|
crate_type = set "rlib"
|
|
|
|
end
|
|
|
|
|
|
|
|
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"
|