OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 from master.factory import chromium_factory | 5 from master.factory import chromium_factory |
6 from master.factory import gclient_factory | 6 from master.factory import gclient_factory |
7 from master.factory import chromium_commands | 7 from master.factory import chromium_commands |
8 | 8 |
9 import config | 9 import config |
10 | 10 |
11 | 11 |
12 class WebRTCFactory(chromium_factory.ChromiumFactory): | 12 class WebRTCFactory(chromium_factory.ChromiumFactory): |
13 | 13 |
14 CUSTOM_VARS_ROOT_DIR = ('root_dir', 'src') | 14 CUSTOM_VARS_ROOT_DIR = ('root_dir', 'src') |
15 | 15 |
16 # Can't use the same Valgrind constant as in chromium_factory.py, since WebRTC | 16 # Can't use the same Valgrind constant as in chromium_factory.py, since WebRTC |
17 # uses another path (use_relative_paths=True in DEPS). | 17 # uses another path (use_relative_paths=True in DEPS). |
18 CUSTOM_DEPS_VALGRIND = ('third_party/valgrind', | 18 CUSTOM_DEPS_VALGRIND = ('third_party/valgrind', |
19 config.Master.trunk_url + '/deps/third_party/valgrind/binaries') | 19 config.Master.trunk_url + '/deps/third_party/valgrind/binaries') |
20 | 20 |
21 def __init__(self, build_dir, target_platform, svn_root_url, branch, | 21 def __init__(self, build_dir, target_platform, nohooks_on_update=False, |
22 custom_deps_list=None, custom_vars_list=None, | 22 target_os=None): |
23 nohooks_on_update=False, target_os=None): | |
24 """Creates a WebRTC factory. | 23 """Creates a WebRTC factory. |
25 | 24 |
26 This factory can also be used to build stand-alone projects. | 25 This factory can also be used to build stand-alone projects. |
27 | 26 |
28 Args: | 27 Args: |
29 build_dir: Directory to perform the build relative to. Usually this is | 28 build_dir: Directory to perform the build relative to. Usually this is |
30 trunk/build for WebRTC and other projects. | 29 trunk/build for WebRTC and other projects. |
31 target_platform: Platform, one of 'win32', 'darwin', 'linux2' | 30 target_platform: Platform, one of 'win32', 'darwin', 'linux2' |
32 svn_root_url: Subversion root URL (i.e. without branch/trunk part). | |
33 branch: Branch name to checkout. | |
34 custom_vars_list: List of tuples specifying custom GYP variables. | |
35 custom_deps_list: Content to be put in the custom_deps entry of the | |
36 .gclient file for the default solution. The parameter must be a list | |
37 of tuples with two strings in each: path and remote URL. | |
38 nohooks_on_update: If True, no hooks will be executed in the update step. | 31 nohooks_on_update: If True, no hooks will be executed in the update step. |
39 target_os: Used to sync down OS-specific dependencies, if specified. | 32 target_os: Used to sync down OS-specific dependencies, if specified. |
40 """ | 33 """ |
41 chromium_factory.ChromiumFactory.__init__( | 34 chromium_factory.ChromiumFactory.__init__( |
42 self, build_dir, target_platform=target_platform, | 35 self, build_dir, target_platform=target_platform, |
43 nohooks_on_update=nohooks_on_update, target_os=target_os) | 36 nohooks_on_update=nohooks_on_update, target_os=target_os) |
44 | 37 |
45 svn_url = svn_root_url + '/' + branch | 38 svn_url = config.Master.webrtc_url + '/trunk' |
46 | 39 |
47 # Use root_dir=src since many Chromium scripts rely on that path. | 40 # Use root_dir=src since many Chromium scripts rely on that path. |
48 custom_vars_list = custom_vars_list or [] | 41 custom_vars_list = [self.CUSTOM_VARS_ROOT_DIR] |
49 custom_vars_list.append(self.CUSTOM_VARS_ROOT_DIR) | |
50 | 42 |
51 # Overwrite solutions of ChromiumFactory since we sync WebRTC, not Chromium. | 43 # Overwrite solutions of ChromiumFactory since we sync WebRTC, not Chromium. |
52 self._solutions = [] | 44 self._solutions = [] |
53 self._solutions.append(gclient_factory.GClientSolution( | 45 self._solutions.append(gclient_factory.GClientSolution( |
54 svn_url, name='src', custom_vars_list=custom_vars_list, | 46 svn_url, name='src', custom_vars_list=custom_vars_list)) |
55 custom_deps_list=custom_deps_list)) | |
56 if config.Master.webrtc_limited_url: | 47 if config.Master.webrtc_limited_url: |
57 self._solutions.append(gclient_factory.GClientSolution( | 48 self._solutions.append(gclient_factory.GClientSolution( |
58 config.Master.webrtc_limited_url, name='webrtc-limited', | 49 config.Master.webrtc_limited_url, name='webrtc-limited', |
59 custom_vars_list=custom_vars_list)) | 50 custom_vars_list=custom_vars_list)) |
60 | 51 |
61 def WebRTCFactory(self, target='Debug', clobber=False, tests=None, mode=None, | 52 def WebRTCFactory(self, target='Debug', clobber=False, tests=None, mode=None, |
62 slave_type='BuilderTester', options=None, | 53 slave_type='BuilderTester', options=None, |
63 compile_timeout=1200, build_url=None, project=None, | 54 compile_timeout=1200, build_url=None, project=None, |
64 factory_properties=None, gclient_deps=None): | 55 factory_properties=None, gclient_deps=None): |
65 options = options or '' | 56 options = options or '' |
(...skipping 20 matching lines...) Expand all Loading... |
86 gyp_defines = factory_properties['gclient_env'].get('GYP_DEFINES', '') | 77 gyp_defines = factory_properties['gclient_env'].get('GYP_DEFINES', '') |
87 for test in tests: | 78 for test in tests: |
88 if 'build_for_tool=memcheck' in gyp_defines: | 79 if 'build_for_tool=memcheck' in gyp_defines: |
89 cmds.AddMemoryTest(test, 'memcheck', | 80 cmds.AddMemoryTest(test, 'memcheck', |
90 factory_properties=factory_properties) | 81 factory_properties=factory_properties) |
91 elif 'build_for_tool=tsan' in gyp_defines: | 82 elif 'build_for_tool=tsan' in gyp_defines: |
92 cmds.AddMemoryTest(test, 'tsan', factory_properties=factory_properties) | 83 cmds.AddMemoryTest(test, 'tsan', factory_properties=factory_properties) |
93 else: | 84 else: |
94 cmds.AddAnnotatedGTestTestStep(test, factory_properties) | 85 cmds.AddAnnotatedGTestTestStep(test, factory_properties) |
95 return factory | 86 return factory |
OLD | NEW |