Preserve proto order

pull/357/head
Craig Tiller 10 years ago
parent b05561fa1a
commit 7431fa9853
  1. 4
      build.json
  2. 4
      tools/buildgen/build-cleaner.py

@ -420,9 +420,9 @@
"build": "private", "build": "private",
"language": "c++", "language": "c++",
"src": [ "src": [
"test/cpp/util/messages.proto",
"test/cpp/util/echo.proto", "test/cpp/util/echo.proto",
"test/cpp/util/echo_duplicate.proto", "test/cpp/util/echo_duplicate.proto",
"test/cpp/util/messages.proto",
"test/cpp/end2end/async_test_server.cc", "test/cpp/end2end/async_test_server.cc",
"test/cpp/util/create_test_channel.cc" "test/cpp/util/create_test_channel.cc"
] ]
@ -432,8 +432,8 @@
"build": "private", "build": "private",
"language": "c++", "language": "c++",
"src": [ "src": [
"examples/tips/empty.proto",
"examples/tips/label.proto", "examples/tips/label.proto",
"examples/tips/empty.proto",
"examples/tips/pubsub.proto", "examples/tips/pubsub.proto",
"examples/tips/client.cc" "examples/tips/client.cc"
], ],

@ -33,9 +33,9 @@ def clean_elem(indict):
for name in ['public_headers', 'headers', 'src']: for name in ['public_headers', 'headers', 'src']:
if name not in indict: continue if name not in indict: continue
inlist = indict[name] inlist = indict[name]
protos = set(x for x in inlist if os.path.splitext(x)[1] == '.proto') protos = list(x for x in inlist if os.path.splitext(x)[1] == '.proto')
others = set(x for x in inlist if x not in protos) others = set(x for x in inlist if x not in protos)
indict[name] = sorted(protos) + sorted(others) indict[name] = protos + sorted(others)
return rebuild_as_ordered_dict(indict, _ELEM_KEYS) return rebuild_as_ordered_dict(indict, _ELEM_KEYS)
for filename in sys.argv[1:]: for filename in sys.argv[1:]:

Loading…
Cancel
Save