* fbt: changed cdefines & lib handling for external apps; added extra checks for app manifest fields; moved around AppsC generator * fbt: commandline fixes for spaces in paths * fbt: fixed stringification for FAP_VERSION * fbt: Removed excessive quoting for gdb * docs: update for cdefines; fbt: typo fix * fbt: enforcing at least 2 components in app version= Co-authored-by: あく <alleteam@gmail.com>
47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
from SCons.Action import Action
|
|
from SCons.Builder import Builder
|
|
|
|
|
|
def _version_emitter(target, source, env):
|
|
target_dir = target[0]
|
|
target = [
|
|
target_dir.File("version.inc.h"),
|
|
target_dir.File("version.json"),
|
|
]
|
|
return target, source
|
|
|
|
|
|
def generate(env):
|
|
env.SetDefault(
|
|
VERSION_SCRIPT="${FBT_SCRIPT_DIR}/version.py",
|
|
)
|
|
env.Append(
|
|
BUILDERS={
|
|
"VersionBuilder": Builder(
|
|
action=Action(
|
|
[
|
|
[
|
|
"${PYTHON3}",
|
|
"${VERSION_SCRIPT}",
|
|
"generate",
|
|
"-t",
|
|
"${TARGET_HW}",
|
|
"--fw-origin",
|
|
"${FIRMWARE_ORIGIN}",
|
|
"-o",
|
|
"${TARGET.dir.posix}",
|
|
"--dir",
|
|
"${ROOT_DIR}",
|
|
"${VERSIONCOMSTR}",
|
|
]
|
|
]
|
|
),
|
|
emitter=_version_emitter,
|
|
),
|
|
}
|
|
)
|
|
|
|
|
|
def exists(env):
|
|
return True
|