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

Side by Side Diff: third_party/grpc/src/boringssl/gen_build_yaml.py

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
« no previous file with comments | « third_party/grpc/src/boringssl/err_data.c ('k') | third_party/grpc/src/compiler/config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python2.7
2 # Copyright 2015-2016, Google Inc.
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are
7 # met:
8 #
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above
12 # copyright notice, this list of conditions and the following disclaimer
13 # in the documentation and/or other materials provided with the
14 # distribution.
15 # * Neither the name of Google Inc. nor the names of its
16 # contributors may be used to endorse or promote products derived from
17 # this software without specific prior written permission.
18 #
19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31 import shutil
32 import sys
33 import os
34 import yaml
35
36 sys.dont_write_bytecode = True
37
38 boring_ssl_root = os.path.abspath(os.path.join(
39 os.path.dirname(sys.argv[0]),
40 '../../third_party/boringssl'))
41 sys.path.append(os.path.join(boring_ssl_root, 'util'))
42
43 try:
44 import generate_build_files
45 except ImportError:
46 print yaml.dump({})
47 sys.exit()
48
49 def map_dir(filename):
50 if filename[0:4] == 'src/':
51 return 'third_party/boringssl/' + filename[4:]
52 else:
53 return 'src/boringssl/' + filename
54
55 def map_testarg(arg):
56 if '/' in arg:
57 return 'third_party/boringssl/' + arg
58 else:
59 return arg
60
61 class Grpc(object):
62
63 yaml = None
64
65 def WriteFiles(self, files, asm_outputs):
66 self.yaml = {
67 '#': 'generated with tools/buildgen/gen_boring_ssl_build_yaml.py',
68 'raw_boringssl_build_output_for_debugging': {
69 'files': files,
70 'asm_outputs': asm_outputs,
71 },
72 'libs': [
73 {
74 'name': 'boringssl',
75 'build': 'private',
76 'language': 'c',
77 'secure': 'no',
78 'src': sorted(
79 map_dir(f)
80 for f in files['ssl'] + files['crypto']
81 ),
82 'headers': sorted(
83 map_dir(f)
84 for f in files['ssl_headers'] + files['ssl_internal_headers'] + fi les['crypto_headers'] + files['crypto_internal_headers']
85 ),
86 'boringssl': True,
87 'defaults': 'boringssl',
88 },
89 {
90 'name': 'boringssl_test_util',
91 'build': 'private',
92 'language': 'c++',
93 'secure': 'no',
94 'boringssl': True,
95 'defaults': 'boringssl',
96 'src': [
97 map_dir(f)
98 for f in sorted(files['test_support'])
99 ],
100 }
101 ] + [
102 {
103 'name': 'boringssl_%s_lib' % os.path.splitext(os.path.basename(test) )[0],
104 'build': 'private',
105 'secure': 'no',
106 'language': 'c' if os.path.splitext(test)[1] == '.c' else 'c++',
107 'src': [map_dir(test)],
108 'vs_proj_dir': 'test/boringssl',
109 'boringssl': True,
110 'defaults': 'boringssl',
111 'deps': [
112 'boringssl_test_util',
113 'boringssl',
114 ]
115 }
116 for test in sorted(files['test'])
117 ],
118 'targets': [
119 {
120 'name': 'boringssl_%s' % os.path.splitext(os.path.basename(test))[0] ,
121 'build': 'test',
122 'run': False,
123 'secure': 'no',
124 'language': 'c++',
125 'src': [],
126 'vs_proj_dir': 'test/boringssl',
127 'boringssl': True,
128 'defaults': 'boringssl',
129 'deps': [
130 'boringssl_%s_lib' % os.path.splitext(os.path.basename(test))[0] ,
131 'boringssl_test_util',
132 'boringssl',
133 ]
134 }
135 for test in sorted(files['test'])
136 ],
137 'tests': [
138 {
139 'name': 'boringssl_%s' % os.path.basename(test[0]),
140 'args': [map_testarg(arg) for arg in test[1:]],
141 'exclude_configs': ['asan'],
142 'ci_platforms': ['linux', 'mac', 'posix', 'windows'],
143 'platforms': ['linux', 'mac', 'posix', 'windows'],
144 'flaky': False,
145 'language': 'c++',
146 'boringssl': True,
147 'defaults': 'boringssl',
148 'cpu_cost': 1.0
149 }
150 for test in files['tests']
151 ]
152 }
153
154
155 os.chdir(os.path.dirname(sys.argv[0]))
156 os.mkdir('src')
157 try:
158 for f in os.listdir(boring_ssl_root):
159 os.symlink(os.path.join(boring_ssl_root, f),
160 os.path.join('src', f))
161
162 g = Grpc()
163 generate_build_files.main([g])
164
165 print yaml.dump(g.yaml)
166
167 finally:
168 shutil.rmtree('src')
OLDNEW
« no previous file with comments | « third_party/grpc/src/boringssl/err_data.c ('k') | third_party/grpc/src/compiler/config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698