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

Side by Side 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, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 %YAML 1.2
2 --- |
3 <%!
4 import json
5 import os
6
7 def proto_headers(src):
8 out = []
9 for f in src:
10 name, ext = os.path.splitext(f)
11 if ext == '.proto':
12 out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h'])
13 return out
14
15 def all_targets(targets, libs):
16 for tgt in targets:
17 yield ('target', tgt)
18 for tgt in libs:
19 yield ('lib', tgt)
20
21 def no_protos_filter(src):
22 return os.path.splitext(src)[1] != '.proto'
23
24 def no_third_party_filter(src):
25 return not src.startswith('third_party/')
26
27 def filter_srcs(srcs, filters):
28 out = []
29 for s in srcs:
30 filter_passes = (f(s) for f in filters)
31 if all(filter_passes):
32 out.append(s)
33 return out
34 %>
35
36 ${json.dumps([{"name": tgt.name,
37 "type": typ,
38 "language": tgt.language,
39 "third_party": tgt.boringssl or tgt.zlib,
40 "src": sorted(
41 filter_srcs(tgt.src, (no_protos_filter, no_third_party_filt er)) +
42 filter_srcs(tgt.get('public_headers', []), (no_protos_filte r, no_third_party_filter)) +
43 filter_srcs(tgt.get('headers', []), (no_third_party_filter, ))),
44 "headers": sorted(
45 tgt.get('public_headers', []) +
46 tgt.get('headers', []) +
47 proto_headers(tgt.src)),
48 "deps": sorted(tgt.get('deps', []))}
49 for typ, tgt in all_targets(targets, libs)],
50 sort_keys=True, indent=2)}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698