mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-10 14:33:42 +08:00
Release Build Checks
This commit is contained in:
+15
-13
@@ -158,20 +158,22 @@ base_project_h7 = {
|
||||
}
|
||||
|
||||
# Common autogenerated includes
|
||||
with open("board/obj/gitversion.h", "w") as f:
|
||||
version = get_version(BUILDER, BUILD_TYPE)
|
||||
f.write("#pragma once\n\n")
|
||||
f.write(f'extern const uint8_t gitversion[{len(version)+1}];\n')
|
||||
f.write(f'const uint8_t gitversion[{len(version)+1}] = "{version}";\n')
|
||||
|
||||
with open("board/obj/version", "w") as f:
|
||||
f.write(f'{get_version(BUILDER, BUILD_TYPE)}')
|
||||
|
||||
version = get_version(BUILDER, BUILD_TYPE)
|
||||
gitversion_header = ("#pragma once\n\n" +
|
||||
f'extern const uint8_t gitversion[{len(version)+1}];\n' +
|
||||
f'const uint8_t gitversion[{len(version)+1}] = "{version}";\n')
|
||||
certs = [get_key_header(n) for n in ["debug", "release"]]
|
||||
with open("board/obj/cert.h", "w") as f:
|
||||
f.write("#pragma once\n\n")
|
||||
for cert in certs:
|
||||
f.write("\n".join(cert) + "\n")
|
||||
cert_header = "#pragma once\n\n" + "".join("\n".join(cert) + "\n" for cert in certs)
|
||||
|
||||
|
||||
def write_generated(target, source, env):
|
||||
Path(target[0].abspath).write_text(str(source[0]))
|
||||
return 0
|
||||
|
||||
|
||||
generation_env = Environment(tools=[])
|
||||
for name, payload in (("gitversion.h", gitversion_header), ("version", version), ("cert.h", cert_header)):
|
||||
generation_env.Command(File(f"./board/obj/{name}"), Value(payload), write_generated)
|
||||
|
||||
# Packet version defines: SHA hash of the struct header files
|
||||
def version_hash(path):
|
||||
|
||||
Reference in New Issue
Block a user