build-all: --add-commit-sha cli arg

This commit is contained in:
Andrej730
2026-09-16 10:12:15 +05:00
parent 2bfaa4a196
commit abeea643af
3 changed files with 32 additions and 8 deletions
+8
View File
@@ -135,6 +135,8 @@ BuildType = Literal["Build", "Rebuild", "Clean"]
BUILD_TYPES = get_args(BuildType)
BUILD_TYPE_DEFAULT: BuildType = "Build"
ADD_COMMIT_SHA_DEFAULT = False
class HelpStrings:
NUM_BUILD_PROCS = (
@@ -150,6 +152,12 @@ class HelpStrings:
BUILD_CFG = f"Build configuration type. (default: {BUILD_CFG_DEFAULT})"
BUILD_CFG_FLAG = "Alternative way to specify the build configuration type, instead of the positional argument."
ADD_COMMIT_SHA = (
"Add the commit SHA to the built version string. "
"Also can be specified by using ADD_COMMIT_SHA env variable. "
f"(default: {ADD_COMMIT_SHA_DEFAULT})"
)
@staticmethod
def generator(omitted_behavior: str) -> str:
return (
+2 -6
View File
@@ -30,6 +30,7 @@ from pathlib import Path
from typing import Literal, NamedTuple, NoReturn
from common import (
ADD_COMMIT_SHA_DEFAULT,
OFF_ON,
PROJECT_NAME,
REPO_ROOT,
@@ -178,17 +179,12 @@ def parse_args() -> Args:
default=None,
help=HelpStrings.GENERATOR_FLAG,
)
ADD_COMMIT_SHA_DEFAULT = False
parser.add_argument(
"--add-commit-sha",
dest="add_commit_sha",
action=argparse.BooleanOptionalAction,
default=argparse.SUPPRESS,
help=(
"Add the commit SHA to the built version string. "
"Also can be specified by using ADD_COMMIT_SHA env variable. "
f"(default: {ADD_COMMIT_SHA_DEFAULT})"
),
help=HelpStrings.ADD_COMMIT_SHA,
)
USE_NINJA_DEFAULT = False
parser.add_argument(