mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 11:48:14 +00:00
build-all: --add-commit-sha cli arg
This commit is contained in:
@@ -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
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user