1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-01-15 12:47:04 +00:00
oot/tools/ZAPD/ZAPD/genbuildinfo.py
Dragorn421 4e55168eaa
Update ZAPD (#1569)
* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "094e79734"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "094e79734"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "110b9eb"

* Add EnumData.xml where some names are now externalized

* Remove legacy typedefs for zapd, no longer needed!
2023-10-24 21:36:10 -04:00

24 lines
814 B
Python

#!/usr/bin/python3
import argparse
from datetime import datetime
import getpass
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("--devel", action="store_true")
args = parser.parse_args()
with open("build/ZAPD/BuildInfo.cpp", "w+") as buildFile:
# Get commit hash from git
# If git fails due to a missing .git directory, a default label will be used instead.
try:
label = subprocess.check_output(["git", "describe", "--always"]).strip().decode("utf-8")
except:
label = "GIT_NOT_FOUND"
now = datetime.now()
if args.devel:
label += " ~ Development version"
buildFile.write("extern const char gBuildHash[] = \"" + label + "\";\n")
#buildFile.write("extern const char gBuildDate[] = \"" + now.strftime("%Y-%m-%d %H:%M:%S") + "\";\n")