diff options
Diffstat (limited to 'templates/tools/run_tests/sources_and_headers.json.template')
-rw-r--r-- | templates/tools/run_tests/sources_and_headers.json.template | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template new file mode 100644 index 0000000000..1c0e04283a --- /dev/null +++ b/templates/tools/run_tests/sources_and_headers.json.template @@ -0,0 +1,33 @@ +<%! +import json +import os + +def proto_headers(src): + out = [] + for f in src: + name, ext = os.path.splitext(f) + if ext == '.proto': + out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h']) + return out + +def no_protos(src): + out = [] + for f in src: + if os.path.splitext(f)[1] != '.proto': + out.append(f) + return out +%> + +${json.dumps([{"name": tgt.name, + "language": tgt.language, + "src": sorted( + no_protos(tgt.src) + + tgt.get('public_headers', []) + + tgt.get('headers', [])), + "headers": sorted( + tgt.get('public_headers', []) + + tgt.get('headers', []) + + proto_headers(tgt.src)), + "deps": sorted(tgt.get('deps', []))} + for tgt in (targets + libs)], + sort_keys=True, indent=2)} |