Skip to content

Commit

Permalink
fbt: dist fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hedger committed Oct 19, 2023
1 parent 8fc60a7 commit e6a5fd9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
8 changes: 4 additions & 4 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,22 @@ if GetOption("fullenv") or any(
# Target for self-update package
dist_basic_arguments = [
"--bundlever",
'"${UPDATE_VERSION_STRING}"',
"${UPDATE_VERSION_STRING}",
]
dist_radio_arguments = [
"--radio",
'"${ROOT_DIR.abspath}/${COPRO_STACK_BIN_DIR}/${COPRO_STACK_BIN}"',
"${ROOT_DIR.abspath}/${COPRO_STACK_BIN_DIR}/${COPRO_STACK_BIN}",
"--radiotype",
"${COPRO_STACK_TYPE}",
"${COPRO_DISCLAIMER}",
"--obdata",
'"${ROOT_DIR.abspath}/${COPRO_OB_DATA}"',
"${ROOT_DIR.abspath}/${COPRO_OB_DATA}",
"--stackversion",
"${COPRO_CUBE_VERSION}",
]
dist_resource_arguments = [
"-r",
'${RESOURCES_ROOT}"',
firmware_env.subst("${RESOURCES_ROOT}"),
]
dist_splash_arguments = (
[
Expand Down
8 changes: 5 additions & 3 deletions scripts/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,15 @@ def manifest(self):
self.logger.info("Comparing new manifest with existing")
only_in_old, changed, only_in_new = Manifest.compare(old_manifest, new_manifest)
for record in only_in_old:
self.logger.info(f"Only in old: {record}")
self.logger.debug(f"Only in old: {record}")
for record in changed:
self.logger.info(f"Changed: {record}")
for record in only_in_new:
self.logger.info(f"Only in new: {record}")
self.logger.debug(f"Only in new: {record}")
if any((only_in_old, changed, only_in_new)):
self.logger.warning("Manifests are different, updating")
self.logger.warning(
f"Manifest is updated ({len(only_in_new)} new, {len(only_in_old)} removed, {len(changed)} changed). Updating"
)
new_manifest.save(manifest_file)
else:
self.logger.info("Manifest is up-to-date!")
Expand Down
21 changes: 19 additions & 2 deletions scripts/fbt_tools/fbt_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,21 @@ def DistCommand(env, name, source, **kw):
command = env.Command(
target,
source,
'@${PYTHON3} "${DIST_SCRIPT}" copy -p ${DIST_PROJECTS} -s "${DIST_SUFFIX}" ${DIST_EXTRA}',
action=Action(
[
[
"${PYTHON3}",
"${DIST_SCRIPT}",
"copy",
"-p",
"${DIST_PROJECTS}",
"-s",
"${DIST_SUFFIX}",
"${DIST_EXTRA}",
]
],
"${DISTCOMSTR}",
),
**kw,
)
env.Pseudo(target)
Expand All @@ -106,7 +120,10 @@ def DistCommand(env, name, source, **kw):

def generate(env):
if not env["VERBOSE"]:
env.SetDefault(COPROCOMSTR="\tCOPRO\t${TARGET}")
env.SetDefault(
COPROCOMSTR="\tCOPRO\t${TARGET}",
DISTCOMSTR="\tDIST\t${TARGET}",
)
env.AddMethod(AddFwProject)
env.AddMethod(DistCommand)
env.AddMethod(AddFwFlashTarget)
Expand Down

0 comments on commit e6a5fd9

Please sign in to comment.