mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-29 21:52:03 -07:00
Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into xfw-dev
This commit is contained in:
+17
-39
@@ -1,27 +1,27 @@
|
||||
from fbt.version import get_git_commit_unix_timestamp
|
||||
|
||||
Import("env")
|
||||
|
||||
assetsenv = env.Clone(
|
||||
tools=["fbt_assets"],
|
||||
FW_LIB_NAME="assets",
|
||||
GIT_UNIX_TIMESTAMP=get_git_commit_unix_timestamp(),
|
||||
ASSETS_WORK_DIR=env.Dir("compiled"),
|
||||
ASSETS_SRC_DIR=env.Dir("#/assets"),
|
||||
)
|
||||
assetsenv.ApplyLibFlags()
|
||||
|
||||
# Keep firmware flash icons in build dir for api symbols for asset packs
|
||||
icons_path = (
|
||||
assetsenv.Dir("#/build/icons")
|
||||
if assetsenv["IS_BASE_FIRMWARE"]
|
||||
else assetsenv.Dir("compiled")
|
||||
else assetsenv["ASSETS_WORK_DIR"]
|
||||
)
|
||||
icons = assetsenv.CompileIcons(icons_path, assetsenv.Dir("#/assets/icons"))
|
||||
icons = assetsenv.CompileIcons(icons_path, assetsenv["ASSETS_SRC_DIR"].Dir("icons"))
|
||||
assetsenv.Alias("icons", icons)
|
||||
|
||||
|
||||
# Protobuf .proto -> .c + .h
|
||||
proto_src = assetsenv.Glob("protobuf/*.proto", source=True)
|
||||
proto_options = assetsenv.Glob("protobuf/*.options", source=True)
|
||||
proto = assetsenv.ProtoBuilder(assetsenv.Dir("compiled"), proto_src)
|
||||
proto = assetsenv.ProtoBuilder(assetsenv["ASSETS_WORK_DIR"], proto_src)
|
||||
assetsenv.Depends(proto, proto_options)
|
||||
# Precious(proto)
|
||||
assetsenv.Alias("proto", proto)
|
||||
@@ -30,8 +30,8 @@ assetsenv.Alias("proto", proto)
|
||||
# Internal animations
|
||||
|
||||
dolphin_internal = assetsenv.DolphinSymBuilder(
|
||||
assetsenv.Dir("compiled"),
|
||||
assetsenv.Dir("#/assets/dolphin"),
|
||||
assetsenv["ASSETS_WORK_DIR"],
|
||||
assetsenv["ASSETS_SRC_DIR"].Dir("dolphin"),
|
||||
DOLPHIN_RES_TYPE="internal",
|
||||
)
|
||||
assetsenv.Alias("dolphin_internal", dolphin_internal)
|
||||
@@ -40,8 +40,8 @@ assetsenv.Alias("dolphin_internal", dolphin_internal)
|
||||
# Blocking animations
|
||||
|
||||
dolphin_blocking = assetsenv.DolphinSymBuilder(
|
||||
assetsenv.Dir("compiled"),
|
||||
assetsenv.Dir("#/assets/dolphin"),
|
||||
assetsenv["ASSETS_WORK_DIR"],
|
||||
assetsenv["ASSETS_SRC_DIR"].Dir("dolphin"),
|
||||
DOLPHIN_RES_TYPE="blocking",
|
||||
)
|
||||
assetsenv.Alias("dolphin_blocking", dolphin_blocking)
|
||||
@@ -49,8 +49,8 @@ assetsenv.Alias("dolphin_blocking", dolphin_blocking)
|
||||
|
||||
# Protobuf version meta
|
||||
proto_ver = assetsenv.ProtoVerBuilder(
|
||||
"compiled/protobuf_version.h",
|
||||
"#/assets/protobuf/Changelog",
|
||||
"${ASSETS_WORK_DIR}/protobuf_version.h",
|
||||
assetsenv["ASSETS_SRC_DIR"].File("protobuf/Changelog"),
|
||||
)
|
||||
assetsenv.Depends(proto_ver, proto)
|
||||
assetsenv.Alias("proto_ver", proto_ver)
|
||||
@@ -64,41 +64,19 @@ assetsenv.Install("${LIB_DIST_DIR}", assetslib)
|
||||
|
||||
|
||||
# Resources for SD card
|
||||
env.SetDefault(FW_RESOURCES=None)
|
||||
if assetsenv["IS_BASE_FIRMWARE"]:
|
||||
dolphin_external_out_dir = assetsenv["ASSETS_WORK_DIR"].Dir("dolphin")
|
||||
# External dolphin animations
|
||||
dolphin_external = assetsenv.DolphinExtBuilder(
|
||||
assetsenv.Dir("#/assets/resources/dolphin"),
|
||||
assetsenv.Dir("#/assets/dolphin"),
|
||||
dolphin_external_out_dir,
|
||||
assetsenv["ASSETS_SRC_DIR"].Dir("dolphin"),
|
||||
DOLPHIN_RES_TYPE="external",
|
||||
)
|
||||
if assetsenv["FORCE"]:
|
||||
assetsenv.AlwaysBuild(dolphin_external)
|
||||
assetsenv.Alias("dolphin_ext", dolphin_external)
|
||||
assetsenv.Clean(dolphin_external, assetsenv.Dir("#/assets/resources/dolphin"))
|
||||
assetsenv.Clean(dolphin_external, dolphin_external_out_dir)
|
||||
|
||||
# Resources manifest
|
||||
resources = assetsenv.Command(
|
||||
"#/assets/resources/Manifest",
|
||||
assetsenv.GlobRecursive(
|
||||
"*",
|
||||
assetsenv.Dir("resources").srcnode(),
|
||||
exclude=["Manifest"],
|
||||
),
|
||||
action=Action(
|
||||
'${PYTHON3} "${ASSETS_COMPILER}" manifest "${TARGET.dir.posix}" --timestamp=${GIT_UNIX_TIMESTAMP}',
|
||||
"${RESMANIFESTCOMSTR}",
|
||||
),
|
||||
)
|
||||
assetsenv.Precious(resources)
|
||||
assetsenv.AlwaysBuild(resources)
|
||||
assetsenv.Clean(
|
||||
resources,
|
||||
assetsenv.Dir("#/assets/resources/apps"),
|
||||
)
|
||||
|
||||
# Exporting resources node to external environment
|
||||
env.Replace(FW_RESOURCES=resources)
|
||||
assetsenv.Alias("resources", resources)
|
||||
env.Replace(DOLPHIN_EXTERNAL_OUT_DIR=dolphin_external_out_dir)
|
||||
|
||||
Return("assetslib")
|
||||
|
||||
Reference in New Issue
Block a user