OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 DEPS = [ | 5 DEPS = [ |
6 'depot_tools/gclient', | 6 'depot_tools/gclient', |
7 'depot_tools/bot_update', | 7 'depot_tools/bot_update', |
8 'goma', | |
9 'recipe_engine/path', | 8 'recipe_engine/path', |
10 'recipe_engine/platform', | 9 'recipe_engine/platform', |
11 'recipe_engine/properties', | 10 'recipe_engine/properties', |
12 'recipe_engine/python', | 11 'recipe_engine/python', |
13 'recipe_engine/step', | 12 'recipe_engine/step', |
14 ] | 13 ] |
15 | 14 |
16 from recipe_engine.recipe_api import Property | 15 from recipe_engine.recipe_api import Property |
17 | 16 |
18 PROPERTIES = { | 17 PROPERTIES = { |
(...skipping 29 matching lines...) Expand all Loading... |
48 out_dir += "_v8" | 47 out_dir += "_v8" |
49 if clang: | 48 if clang: |
50 out_dir += "_clang" | 49 out_dir += "_clang" |
51 if memory_tool == 'asan': | 50 if memory_tool == 'asan': |
52 out_dir += "_asan" | 51 out_dir += "_asan" |
53 return out_dir | 52 return out_dir |
54 | 53 |
55 | 54 |
56 def _GNGenBuilds(api, memory_tool, skia, xfa, v8, target_cpu, clang, rel, | 55 def _GNGenBuilds(api, memory_tool, skia, xfa, v8, target_cpu, clang, rel, |
57 target_os, out_dir): | 56 target_os, out_dir): |
58 api.goma.ensure_goma() | |
59 gn_bool = {True: 'true', False: 'false'} | 57 gn_bool = {True: 'true', False: 'false'} |
60 # Generate build files by GN. | 58 # Generate build files by GN. |
61 checkout = api.path['checkout'] | 59 checkout = api.path['checkout'] |
62 gn_cmd = api.path['depot_tools'].join('gn.py') | 60 gn_cmd = api.path['depot_tools'].join('gn.py') |
63 | 61 |
64 # Prepare the arguments to pass in. | 62 # Prepare the arguments to pass in. |
65 args = [ | 63 args = [ |
66 'is_debug=%s' % gn_bool[not rel], | 64 'is_debug=%s' % gn_bool[not rel], |
67 'is_component_build=false', | 65 'is_component_build=false', |
68 'pdf_enable_v8=%s' % gn_bool[v8], | 66 'pdf_enable_v8=%s' % gn_bool[v8], |
69 'pdf_enable_xfa=%s' % gn_bool[xfa], | 67 'pdf_enable_xfa=%s' % gn_bool[xfa], |
70 'pdf_use_skia=%s' % gn_bool[skia], | 68 'pdf_use_skia=%s' % gn_bool[skia], |
71 'pdf_is_standalone=true', | 69 'pdf_is_standalone=true', |
72 'use_goma=true', | |
73 'goma_dir="%s"' % api.goma.goma_dir, | |
74 ] | 70 ] |
75 if api.platform.is_win and not memory_tool: | 71 if api.platform.is_win and not memory_tool: |
76 args.append('symbol_level=1') | 72 args.append('symbol_level=1') |
77 if api.platform.is_linux: | 73 if api.platform.is_linux: |
78 args.append('use_sysroot=false') | 74 args.append('use_sysroot=false') |
79 if clang: | 75 if clang: |
80 args.append('is_clang=true') | 76 args.append('is_clang=true') |
81 if memory_tool == 'asan': | 77 if memory_tool == 'asan': |
82 args.append('is_asan=true is_lsan=true') | 78 args.append('is_asan=true is_lsan=true') |
83 if target_os: | 79 if target_os: |
84 args.append('target_os="%s"' % target_os) | 80 args.append('target_os="%s"' % target_os) |
85 if target_cpu == 'x86': | 81 if target_cpu == 'x86': |
86 args.append('target_cpu="x86"') | 82 args.append('target_cpu="x86"') |
87 | 83 |
88 api.python('gn gen', gn_cmd, | 84 api.python('gn gen', gn_cmd, |
89 ['--root=' + str(checkout), 'gen', '//out/' + out_dir, | 85 ['--root=' + str(checkout), 'gen', '//out/' + out_dir, |
90 '--args=' + ' '.join(args)], | 86 '--args=' + ' '.join(args)], |
91 cwd=checkout) | 87 cwd=checkout) |
92 | 88 |
93 def _BuildSteps(api, clang, out_dir): | 89 def _BuildSteps(api, out_dir): |
94 # Build sample file using Ninja | 90 # Build sample file using Ninja |
95 debug_path = api.path['checkout'].join('out', out_dir) | 91 debug_path = api.path['checkout'].join('out', out_dir) |
96 ninja_cmd = ['ninja', '-C', debug_path, | 92 api.step('compile with ninja', ['ninja', '-C', debug_path]) |
97 '-j', api.goma.recommended_goma_jobs] | |
98 | |
99 with api.goma.build_with_goma( | |
100 ninja_log_outdir=debug_path, | |
101 ninja_log_compiler='clang' if clang else 'unknown', | |
102 ninja_log_command=ninja_cmd): | |
103 api.step('compile with ninja', ninja_cmd) | |
104 | 93 |
105 | 94 |
106 def _RunDrMemoryTests(api, v8): | 95 def _RunDrMemoryTests(api, v8): |
107 pdfium_tests_py = str(api.path['checkout'].join('tools', | 96 pdfium_tests_py = str(api.path['checkout'].join('tools', |
108 'drmemory', | 97 'drmemory', |
109 'scripts', | 98 'scripts', |
110 'pdfium_tests.py')) | 99 'pdfium_tests.py')) |
111 api.python('unittests', pdfium_tests_py, | 100 api.python('unittests', pdfium_tests_py, |
112 args=['--test', 'pdfium_unittests'], | 101 args=['--test', 'pdfium_unittests'], |
113 cwd=api.path['checkout']) | 102 cwd=api.path['checkout']) |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 160 |
172 def RunSteps(api, memory_tool, skia, xfa, v8, target_cpu, clang, rel, skip_test, | 161 def RunSteps(api, memory_tool, skia, xfa, v8, target_cpu, clang, rel, skip_test, |
173 target_os): | 162 target_os): |
174 _CheckoutSteps(api, memory_tool, skia, xfa, v8, target_cpu, clang, target_os) | 163 _CheckoutSteps(api, memory_tool, skia, xfa, v8, target_cpu, clang, target_os) |
175 | 164 |
176 out_dir = _OutPath(api, memory_tool, skia, xfa, v8, clang, rel) | 165 out_dir = _OutPath(api, memory_tool, skia, xfa, v8, clang, rel) |
177 | 166 |
178 _GNGenBuilds(api, memory_tool, skia, xfa, v8, target_cpu, clang, rel, | 167 _GNGenBuilds(api, memory_tool, skia, xfa, v8, target_cpu, clang, rel, |
179 target_os, out_dir) | 168 target_os, out_dir) |
180 | 169 |
181 _BuildSteps(api, clang, out_dir) | 170 _BuildSteps(api, out_dir) |
182 | 171 |
183 if skip_test: | 172 if skip_test: |
184 return | 173 return |
185 | 174 |
186 with api.step.defer_results(): | 175 with api.step.defer_results(): |
187 _RunTests(api, memory_tool, v8, out_dir) | 176 _RunTests(api, memory_tool, v8, out_dir) |
188 | 177 |
189 | 178 |
190 def GenTests(api): | 179 def GenTests(api): |
191 yield ( | 180 yield ( |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 | 386 |
398 yield ( | 387 yield ( |
399 api.test('android') + | 388 api.test('android') + |
400 api.platform('linux', 64) + | 389 api.platform('linux', 64) + |
401 api.properties(mastername='client.pdfium', | 390 api.properties(mastername='client.pdfium', |
402 buildername='android', | 391 buildername='android', |
403 slavename='test_slave', | 392 slavename='test_slave', |
404 target_os='android', | 393 target_os='android', |
405 skip_test=True) | 394 skip_test=True) |
406 ) | 395 ) |
OLD | NEW |