mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-03 14:09:33 +03:00
code gen: Be more robust to dirty hashes.
If any JSON files get out of whack this will print which file is malformed. Also will show any temporary files (e.g. .rej or .orig) as untracked in the code generation hashes dir. Bug: angleproject:3691 Change-Id: I534e87bd2ea692182aa558bb80e09fb526e441b0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2564000 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -93,3 +93,6 @@ Release_Win32/
|
||||
Release_x64/
|
||||
TestResults.qpa
|
||||
.idea/
|
||||
|
||||
# Any temporary files will confuse code generation.
|
||||
!scripts/code_generation_hashes/*
|
||||
|
||||
@@ -182,7 +182,10 @@ def load_hashes():
|
||||
for file in os.listdir(hash_dir):
|
||||
hash_fname = os.path.join(hash_dir, file)
|
||||
with open(hash_fname) as hash_file:
|
||||
hashes[file] = json.load(open(hash_fname))
|
||||
try:
|
||||
hashes[file] = json.load(hash_file)
|
||||
except ValueError:
|
||||
raise Exception("Could not decode JSON from %s" % file)
|
||||
return hashes
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user