1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 20:49:49 +04:00

ufbt: fixed FAP_SRC_DIR (#2970)

* fbt, ufbt: fixed "_appdir" internal property and FAP_SRC_DIR not working in ufbt environment
* fbt, ufbt: reworked CompileIcons(); added app's own root to app's #include path
* fbt: cleaner resolve_real_dir_node

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
hedger
2023-08-10 19:21:56 +03:00
committed by GitHub
parent f75fcd4e34
commit 7178bd20cf
6 changed files with 34 additions and 44 deletions

View File

@@ -8,11 +8,14 @@ from SCons.Errors import StopError
def icons_emitter(target, source, env):
icons_src = env.GlobRecursive("*.png", env["ICON_SRC_DIR"])
icons_src += env.GlobRecursive("frame_rate", env["ICON_SRC_DIR"])
target = [
target[0].File(env.subst("${ICON_FILE_NAME}.c")),
target[0].File(env.subst("${ICON_FILE_NAME}.h")),
]
return target, source
return target, icons_src
def proto_emitter(target, source, env):
@@ -104,17 +107,12 @@ def proto_ver_generator(target, source, env):
def CompileIcons(env, target_dir, source_dir, *, icon_bundle_name="assets_icons"):
# Gathering icons sources
icons_src = env.GlobRecursive("*.png", source_dir)
icons_src += env.GlobRecursive("frame_rate", source_dir)
icons = env.IconBuilder(
return env.IconBuilder(
target_dir,
source_dir,
None,
ICON_SRC_DIR=source_dir,
ICON_FILE_NAME=icon_bundle_name,
)
env.Depends(icons, icons_src)
return icons
def generate(env):
@@ -137,7 +135,7 @@ def generate(env):
BUILDERS={
"IconBuilder": Builder(
action=Action(
'${PYTHON3} ${ASSETS_COMPILER} icons ${ABSPATHGETTERFUNC(SOURCE)} ${TARGET.dir} --filename "${ICON_FILE_NAME}"',
'${PYTHON3} ${ASSETS_COMPILER} icons ${ICON_SRC_DIR} ${TARGET.dir} --filename "${ICON_FILE_NAME}"',
"${ICONSCOMSTR}",
),
emitter=icons_emitter,