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

Side by Side Diff: scripts/master/factory/webrtc_factory.py

Issue 11896066: Add Android NDK build for WebRTC (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Added try builder Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
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 gclient_factory 5 from master.factory import gclient_factory
6 from master.factory import chromium_commands 6 from master.factory import chromium_commands
7 7 from master.factory import webrtc_commands
8 import config 8 import config
9 9
10 10
11 class WebRTCFactory(gclient_factory.GClientFactory): 11 class WebRTCFactory(gclient_factory.GClientFactory):
12 12
13 CUSTOM_VARS_ROOT_DIR = ('root_dir', 'src') 13 CUSTOM_VARS_ROOT_DIR = ('root_dir', 'src')
14 # Can't use the same Valgrind constant as in chromium_factory.py, since WebRTC 14 # Can't use the same Valgrind constant as in chromium_factory.py, since WebRTC
15 # uses another path (use_relative_paths=True in DEPS). 15 # uses another path (use_relative_paths=True in DEPS).
16 CUSTOM_DEPS_VALGRIND = ('third_party/valgrind', 16 CUSTOM_DEPS_VALGRIND = ('third_party/valgrind',
17 config.Master.trunk_url + '/deps/third_party/valgrind/binaries') 17 config.Master.trunk_url + '/deps/third_party/valgrind/binaries')
18 18
19 def __init__(self, build_dir, target_platform, svn_root_url, branch, 19 def __init__(self, build_dir, target_platform, svn_root_url, branch,
20 custom_deps_list=None): 20 custom_deps_list=None, nohooks_on_update=False, target_os=None):
21 """Creates a WebRTC factory. 21 """Creates a WebRTC factory.
22 22
23 This factory can also be used to build stand-alone projects. 23 This factory can also be used to build stand-alone projects.
24 24
25 Args: 25 Args:
26 build_dir: Directory to perform the build relative to. Usually this is 26 build_dir: Directory to perform the build relative to. Usually this is
27 trunk/build for WebRTC and other projects. 27 trunk/build for WebRTC and other projects.
28 target_platform: Platform, one of 'win32', 'darwin', 'linux2' 28 target_platform: Platform, one of 'win32', 'darwin', 'linux2'
29 svn_root_url: Subversion root URL (i.e. without branch/trunk part). 29 svn_root_url: Subversion root URL (i.e. without branch/trunk part).
30 branch: Branch name to checkout. 30 branch: Branch name to checkout.
31 custom_deps_list: Content to be put in the custom_deps entry of the 31 custom_deps_list: Content to be put in the custom_deps entry of the
32 .gclient file for the default solution. The parameter must be a list 32 .gclient file for the default solution. The parameter must be a list
33 of tuples with two strings in each: path and remote URL. 33 of tuples with two strings in each: path and remote URL.
34 nohooks_on_update: If True, no hooks will be executed in the update step.
35 target_os: Used to sync down OS-specific dependencies, if specified.
34 """ 36 """
35 svn_url = svn_root_url + '/' + branch 37 svn_url = svn_root_url + '/' + branch
36 # Use root_dir=src since many Chromium scripts rely on that path. 38 # Use root_dir=src since many Chromium scripts rely on that path.
37 custom_vars_list = [self.CUSTOM_VARS_ROOT_DIR] 39 custom_vars_list = [self.CUSTOM_VARS_ROOT_DIR]
38 solutions = [] 40 solutions = []
39 solutions.append(gclient_factory.GClientSolution( 41 solutions.append(gclient_factory.GClientSolution(
40 svn_url, name='src', custom_vars_list=custom_vars_list, 42 svn_url, name='src', custom_vars_list=custom_vars_list,
41 custom_deps_list=custom_deps_list)) 43 custom_deps_list=custom_deps_list))
42 if config.Master.webrtc_internal_url: 44 if config.Master.webrtc_internal_url:
43 solutions.append(gclient_factory.GClientSolution( 45 solutions.append(gclient_factory.GClientSolution(
44 config.Master.webrtc_internal_url, name='webrtc-internal', 46 config.Master.webrtc_internal_url, name='webrtc-internal',
45 custom_vars_list=custom_vars_list)) 47 custom_vars_list=custom_vars_list))
46 gclient_factory.GClientFactory.__init__(self, build_dir, solutions, 48 gclient_factory.GClientFactory.__init__(self, build_dir, solutions,
47 target_platform=target_platform) 49 target_platform=target_platform,
50 nohooks_on_update=nohooks_on_update,
51 target_os=target_os)
48 52
49 def WebRTCFactory(self, target='Debug', clobber=False, tests=None, mode=None, 53 def WebRTCFactory(self, target='Debug', clobber=False, tests=None, mode=None,
50 slave_type='BuilderTester', options=None, 54 slave_type='BuilderTester', options=None,
51 compile_timeout=1200, build_url=None, project=None, 55 compile_timeout=1200, build_url=None, project=None,
52 factory_properties=None, gclient_deps=None): 56 factory_properties=None, gclient_deps=None):
53 options = options or '' 57 options = options or ''
54 tests = tests or [] 58 tests = tests or []
55 factory_properties = factory_properties or {} 59 factory_properties = factory_properties or {}
56 60
57 if factory_properties.get('needs_valgrind'): 61 if factory_properties.get('needs_valgrind'):
(...skipping 18 matching lines...) Expand all
76 gyp_defines = gclient_env.get('GYP_DEFINES', '') 80 gyp_defines = gclient_env.get('GYP_DEFINES', '')
77 for test in tests: 81 for test in tests:
78 if 'build_for_tool=memcheck' in gyp_defines: 82 if 'build_for_tool=memcheck' in gyp_defines:
79 cmds.AddMemoryTest(test, 'memcheck', 83 cmds.AddMemoryTest(test, 'memcheck',
80 factory_properties=factory_properties) 84 factory_properties=factory_properties)
81 elif 'build_for_tool=tsan' in gyp_defines: 85 elif 'build_for_tool=tsan' in gyp_defines:
82 cmds.AddMemoryTest(test, 'tsan', factory_properties=factory_properties) 86 cmds.AddMemoryTest(test, 'tsan', factory_properties=factory_properties)
83 else: 87 else:
84 cmds.AddAnnotatedGTestTestStep(test, factory_properties) 88 cmds.AddAnnotatedGTestTestStep(test, factory_properties)
85 return factory 89 return factory
90
91 def WebRTCAndroidNDKFactory(self, annotation_script,
Isaac (away) 2013/03/18 17:54:21 I would rather us use ChromiumAnnotationFactory if
kjellander_chromium 2013/03/21 15:46:17 Due to the fact that the WebRTC NDK demo applicati
92 branch='master',
93 target='Release',
94 slave_type='AnnotatedBuilderTester',
95 clobber=False,
96 compile_timeout=6000,
97 project=None,
98 factory_properties=None, options=None,
99 tests=None,
100 gclient_deps=None):
101 """Annotation-driven factory to build WebRTC with the Android NDK.
102 """
103 factory_properties = factory_properties or {}
104 options = options or {}
105
106 factory = self.BuildFactory(target=target, clobber=clobber,
107 tests=tests, mode=None, slave_type=slave_type,
108 options=options,
109 compile_timeout=compile_timeout, build_url=None,
110 project=project,
111 factory_properties=factory_properties,
112 gclient_deps=gclient_deps)
113
114 # Get the factory command object to create new steps to the factory.
115 cmds = webrtc_commands.WebRTCCommands(
116 factory=factory,
117 target=target,
118 build_dir=self._build_dir,
119 target_platform=self._target_platform,
120 target_os=self._target_os)
121
122 # Add the main build.
123 env = factory_properties.get('annotation_env')
124 factory_properties['target'] = target
125 factory_properties.setdefault('clobber', clobber)
126 cmds.AddAnnotationStep('build', annotation_script, env=env,
127 factory_properties=factory_properties)
128
129 # Add compilation of NDK apps, assuming they can run as annotation scripts.
130 ndk_apps_list = factory_properties.get('ndk_apps')
131 if ndk_apps_list:
132 for ndk_app in ndk_apps_list:
133 cmds.AddAnnotationStep('ndk_app', ndk_app, env=env,
134 factory_properties=factory_properties)
135 return factory
136
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698