From a642bed2fc84926ddcf7378ccf08e1dfffff36ae Mon Sep 17 00:00:00 2001 From: VerstreuteSeele Date: Sun, 15 Jan 2023 22:35:36 +0100 Subject: [PATCH] scons fuckery --- scripts/version.py | 10 +++++++++- site_scons/commandline.scons | 7 ++++++- site_scons/environ.scons | 3 ++- site_scons/extapps.scons | 16 +--------------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/scripts/version.py b/scripts/version.py index f46eee068..a32b272aa 100644 --- a/scripts/version.py +++ b/scripts/version.py @@ -40,7 +40,15 @@ class GitVersion: os.environ.get("CUSTOM_FLIPPER_NAME", None) or "" ) - + + force_no_dirty = ( + os.environ.get("FORCE_NO_DIRTY", None) + or "" + ) + + if (force_no_dirty != ""): + dirty = False + if (custom_fz_name != "") and (len(custom_fz_name) <= 8) and (custom_fz_name.isalnum()) and (custom_fz_name.isascii()): return { "GIT_COMMIT": commit, diff --git a/site_scons/commandline.scons b/site_scons/commandline.scons index 3e6859b4e..00781db31 100644 --- a/site_scons/commandline.scons +++ b/site_scons/commandline.scons @@ -106,6 +106,11 @@ vars.AddVariables( "Replaces OTP flipper name with custom string of 8 chars", "", ), + ( + "FORCE_NO_DIRTY", + "Force disable dirty status of the build", + "", + ), ( "COPRO_CUBE_VERSION", "Cube version", @@ -242,4 +247,4 @@ vars.AddVariables( ), ) -Return("vars") +Return("vars") \ No newline at end of file diff --git a/site_scons/environ.scons b/site_scons/environ.scons index 128a667f1..ab60d4e71 100644 --- a/site_scons/environ.scons +++ b/site_scons/environ.scons @@ -21,6 +21,7 @@ variables_to_forward = [ "WORKFLOW_BRANCH_OR_TAG", "DIST_SUFFIX", "CUSTOM_FLIPPER_NAME", + "FORCE_NO_DIRTY", # Python & other tools "HOME", "APPDATA", @@ -87,4 +88,4 @@ SetOption("max_drift", 1) wrap_tempfile(coreenv, "LINKCOM") wrap_tempfile(coreenv, "ARCOM") -Return("coreenv") +Return("coreenv") \ No newline at end of file diff --git a/site_scons/extapps.scons b/site_scons/extapps.scons index 5f6b1393f..6b6735705 100644 --- a/site_scons/extapps.scons +++ b/site_scons/extapps.scons @@ -1,4 +1,3 @@ -import os from dataclasses import dataclass, field from SCons.Node import NodeList from SCons.Warnings import warn, WarningOnByDefault @@ -110,25 +109,12 @@ if appsrc := appenv.subst("$APPSRC"): app_artifacts = appenv.GetExtAppFromPath(appsrc) appenv.PhonyTarget( "launch_app", - '${PYTHON3} "${APP_RUN_SCRIPT}" --launch "${SOURCE}" --fap_dst_dir "/ext/apps/${FAP_CATEGORY}"', + '${PYTHON3} "${APP_RUN_SCRIPT}" "${SOURCE}" --fap_dst_dir "/ext/apps/${FAP_CATEGORY}"', source=app_artifacts.compact, FAP_CATEGORY=app_artifacts.app.fap_category, ) appenv.Alias("launch_app", app_artifacts.validator) -appenv.PhonyTarget( - "faps_copy", - os.linesep.join( - [ - '${PYTHON3} "${APP_RUN_SCRIPT}"' - f' "{app_artifact.compact[0].rstr()}"' - f' --fap_dst_dir "/ext/apps/{app_artifact.app.fap_category}"' - for app_artifact in appenv["EXT_APPS"].values() - ] - ), - source=["faps"], -) - # SDK management sdk_origin_path = "${BUILD_DIR}/sdk_origin"