refactor: auto generate electron_version.h from the version file (#18866)
* refactor: auto generate electron_version.h from the version file * Update BUILD.gn Co-Authored-By: Jeremy Apthorp <nornagon@nornagon.net>
This commit is contained in:
parent
504edf2cf6
commit
7201845894
16 changed files with 143 additions and 62 deletions
16
build/generate-template.py
Normal file
16
build/generate-template.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import json
|
||||
import sys
|
||||
from string import Template
|
||||
|
||||
inpath = sys.argv[1]
|
||||
outpath = sys.argv[2]
|
||||
argpaths = sys.argv[3:]
|
||||
|
||||
with open(inpath, 'r') as infile, open(outpath, 'w') as outfile:
|
||||
data = {}
|
||||
for argpath in argpaths:
|
||||
with open(argpath, 'r') as argfile:
|
||||
data.update(json.load(argfile))
|
||||
|
||||
s = Template(infile.read()).substitute(data)
|
||||
outfile.write(s)
|
Loading…
Add table
Add a link
Reference in a new issue