Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: third_party/grpc/templates/tools/run_tests/sources_and_headers.json.template

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/grpc/templates/tools/run_tests/sources_and_headers.json.template
diff --git a/third_party/grpc/templates/tools/run_tests/sources_and_headers.json.template b/third_party/grpc/templates/tools/run_tests/sources_and_headers.json.template
new file mode 100644
index 0000000000000000000000000000000000000000..18b9bc26547ccf992de4b5a2058bba35a7f1615f
--- /dev/null
+++ b/third_party/grpc/templates/tools/run_tests/sources_and_headers.json.template
@@ -0,0 +1,50 @@
+%YAML 1.2
+--- |
+ <%!
+ 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 all_targets(targets, libs):
+ for tgt in targets:
+ yield ('target', tgt)
+ for tgt in libs:
+ yield ('lib', tgt)
+
+ def no_protos_filter(src):
+ return os.path.splitext(src)[1] != '.proto'
+
+ def no_third_party_filter(src):
+ return not src.startswith('third_party/')
+
+ def filter_srcs(srcs, filters):
+ out = []
+ for s in srcs:
+ filter_passes = (f(s) for f in filters)
+ if all(filter_passes):
+ out.append(s)
+ return out
+ %>
+
+ ${json.dumps([{"name": tgt.name,
+ "type": typ,
+ "language": tgt.language,
+ "third_party": tgt.boringssl or tgt.zlib,
+ "src": sorted(
+ filter_srcs(tgt.src, (no_protos_filter, no_third_party_filter)) +
+ filter_srcs(tgt.get('public_headers', []), (no_protos_filter, no_third_party_filter)) +
+ filter_srcs(tgt.get('headers', []), (no_third_party_filter,))),
+ "headers": sorted(
+ tgt.get('public_headers', []) +
+ tgt.get('headers', []) +
+ proto_headers(tgt.src)),
+ "deps": sorted(tgt.get('deps', []))}
+ for typ, tgt in all_targets(targets, libs)],
+ sort_keys=True, indent=2)}

Powered by Google App Engine
This is Rietveld 408576698