Supporting comments in build-cleaner.

pull/1339/head
Nicolas "Pixel" Noble 10 years ago
parent 8512fba380
commit 62b8ddfc34
  1. 7
      build.json
  2. 4
      tools/buildgen/build-cleaner.py

@ -1,8 +1,7 @@
{ {
"#": "This file describes the list of targets and dependencies.", "#1": "This file describes the list of targets and dependencies.",
"#": "It is used among other things to generate all of our project files.", "#2": "It is used among other things to generate all of our project files.",
"#": "Please refer to the templates directory for more information.", "#3": "Please refer to the templates directory for more information.",
"settings": { "settings": {
"#": "The public version number of the library.", "#": "The public version number of the library.",
"version": { "version": {

@ -52,11 +52,15 @@ _ELEM_KEYS = [
def rebuild_as_ordered_dict(indict, special_keys): def rebuild_as_ordered_dict(indict, special_keys):
outdict = collections.OrderedDict() outdict = collections.OrderedDict()
for key in sorted(indict.keys()):
if '#' in key:
outdict[key] = indict[key]
for key in special_keys: for key in special_keys:
if key in indict: if key in indict:
outdict[key] = indict[key] outdict[key] = indict[key]
for key in sorted(indict.keys()): for key in sorted(indict.keys()):
if key in special_keys: continue if key in special_keys: continue
if '#' in key: continue
outdict[key] = indict[key] outdict[key] = indict[key]
return outdict return outdict

Loading…
Cancel
Save