ufbt: deploying sample ufbt automation for new apps; added source "ufbt -s env" for toolchain access (#2648)

This commit is contained in:
hedger
2023-05-08 14:01:52 +03:00
committed by GitHub
parent 954780ed24
commit f7dd77795a
7 changed files with 66 additions and 3 deletions
+9 -2
View File
@@ -380,8 +380,9 @@ dist_env.Alias("vscode_dist", vscode_dist)
# Creating app from base template
dist_env.SetDefault(FBT_APPID=appenv.subst("$APPID") or "template")
app_template_dir = project_template_dir.Dir("app_template")
app_template_dist = []
for template_file in project_template_dir.Dir("app_template").glob("*"):
for template_file in app_template_dir.glob("*"):
dist_file_name = dist_env.subst(template_file.name)
if template_file.name.endswith(".png"):
app_template_dist.append(
@@ -397,12 +398,13 @@ for template_file in project_template_dir.Dir("app_template").glob("*"):
},
)
)
AddPostAction(
app_template_dist[-1],
[
Mkdir(original_app_dir.Dir("images")),
Touch(original_app_dir.Dir("images").File(".gitkeep")),
# scons' glob ignores .dot directories, so we need to copy .github manually
Copy(original_app_dir.Dir(".github"), app_template_dir.Dir(".github")),
],
)
dist_env.Precious(app_template_dist)
@@ -440,3 +442,8 @@ else:
raise UserError(f"Dolphin folder not found: {dolphin_src_dir}")
dist_env.PhonyTarget("dolphin_ext", Action(missing_dolphin_folder, None))
dist_env.PhonyTarget(
"env",
"@echo $( ${FBT_SCRIPT_DIR}/toolchain/fbtenv.sh $)",
)