mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-22 21:01:40 +03:00
27b698f081
Co-authored-by: あく <alleteam@gmail.com> Co-authored-by: hedger <hedger@users.noreply.github.com>
30 lines
702 B
Python
30 lines
702 B
Python
from SCons.Builder import Builder
|
|
from SCons.Action import Action
|
|
|
|
|
|
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.Append(
|
|
BUILDERS={
|
|
"VersionBuilder": Builder(
|
|
action=Action(
|
|
'${PYTHON3} "${ROOT_DIR.abspath}/scripts/version.py" generate -t ${TARGET_HW} -o ${TARGET.dir.posix} --dir "${ROOT_DIR}"',
|
|
"${VERSIONCOMSTR}",
|
|
),
|
|
emitter=version_emitter,
|
|
),
|
|
}
|
|
)
|
|
|
|
|
|
def exists(env):
|
|
return True
|