mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-27 15:00:46 +00:00
8d2ea14f06
* fbt: added hooks for build & dist environments * Moved env hooks to an optional file * Fixed var name * Added fw origin to device info * Bumped device info version * fbt: added FIRMWARE_ORIGIN option. Different implementation for FW_ORIGIN_* C macro. * api: bumped versions * fbt: added fbt_options_local.py * gitignore: cleanup Co-authored-by: あく <alleteam@gmail.com>
34 lines
838 B
Python
34 lines
838 B
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
|