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-11 01:21:56 +09:00
committed by GitHub
co-authored by あく
parent f75fcd4e34
commit 7178bd20cf
6 changed files with 34 additions and 44 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import os
import re
from dataclasses import dataclass, field
from enum import Enum
from fbt.util import resolve_real_dir_node
from typing import Callable, ClassVar, List, Optional, Tuple, Union
@@ -152,7 +153,7 @@ class AppManager:
FlipperApplication(
*args,
**kw,
_appdir=app_dir_node,
_appdir=resolve_real_dir_node(app_dir_node),
_apppath=os.path.dirname(app_manifest_path),
_appmanager=self,
),
+2 -10
View File
@@ -45,7 +45,7 @@ def single_quote(arg_list):
return " ".join(f"'{arg}'" if " " in arg else str(arg) for arg in arg_list)
def extract_abs_dir(node):
def resolve_real_dir_node(node):
if isinstance(node, SCons.Node.FS.EntryProxy):
node = node.get()
@@ -53,15 +53,7 @@ def extract_abs_dir(node):
if os.path.exists(repo_dir.abspath):
return repo_dir
def extract_abs_dir_path(node):
abs_dir_node = extract_abs_dir(node)
if abs_dir_node is None:
raise StopError(f"Can't find absolute path for {node.name}")
# Don't return abspath attribute (type is str), it will break in
# OverrideEnvironment.subst_list() by splitting path on spaces
return abs_dir_node
raise StopError(f"Can't find absolute path for {node.name} ({node})")
def path_as_posix(path):