Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / infra / scripts / legacy / site_config / config_bootstrap.py
blob8777cab60253c1a3829914a04b379afda2b2e4ea
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
3 # found in the LICENSE file.
5 """
6 Site configuration information that is sufficient to configure a slave,
7 without loading any buildbot or twisted code.
8 """
10 import inspect
11 import os
13 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
15 # Override config_default with a config_private file.
16 BASE_MASTERS = []
17 try:
18 import config_private # pylint: disable=F0401
19 BASE_MASTERS += [config_private.Master, config_private.PublicMaster]
20 except ImportError:
21 import config_default as config_private # pylint: disable=W0403
22 BASE_MASTERS += [config_private.Master,]
25 class Master(config_private.Master):
26 """Buildbot master configuration options."""
28 trunk_url = (config_private.Master.server_url +
29 config_private.Master.repo_root + '/trunk')
31 webkit_trunk_url = (config_private.Master.webkit_root_url + '/trunk')
33 trunk_url_src = config_private.Master.git_server_url + '/chromium/src.git'
34 trunk_url_tools = trunk_url + '/tools'
35 nacl_url = config_private.Master.nacl_trunk_url + '/src/native_client'
36 nacl_sdk_root_url = 'https://nativeclient-sdk.googlecode.com/svn'
37 nacl_ports_trunk_url = 'https://naclports.googlecode.com/svn/trunk'
38 nacl_ports_url = nacl_ports_trunk_url + '/src'
39 gears_url = 'http://gears.googlecode.com/svn/trunk'
40 gyp_trunk_url = 'http://gyp.googlecode.com/svn/trunk'
41 branch_url = (config_private.Master.server_url +
42 config_private.Master.repo_root + '/branches')
43 merge_branch_url = branch_url + '/chrome_webkit_merge_branch'
44 merge_branch_url_src = merge_branch_url + '/src'
46 v8_url = 'http://v8.googlecode.com/svn'
47 v8_branch_url = (v8_url + '/branches')
48 v8_bleeding_edge = v8_branch_url + '/bleeding_edge'
49 v8_trunk = v8_url + '/trunk'
50 es5conform_root_url = "https://es5conform.svn.codeplex.com/svn/"
51 es5conform_revision = 62998
53 dart_url = config_private.Master.googlecode_url % 'dart'
54 dart_bleeding = dart_url + '/branches/bleeding_edge'
55 dart_trunk = dart_url + '/trunk'
57 oilpan_url = (config_private.Master.webkit_root_url + '/branches/oilpan')
59 skia_url = 'http://skia.googlecode.com/svn/'
61 syzygy_url = 'http://sawbuck.googlecode.com/svn/'
63 webrtc_url = config_private.Master.googlecode_url % 'webrtc'
64 libyuv_url = 'http://libyuv.googlecode.com/svn'
66 # Default target platform if none was given to the factory.
67 default_platform = 'win32'
69 # Used by the waterfall display.
70 project_url = 'http://www.chromium.org'
72 # Base URL for perf test results.
73 perf_base_url = 'http://build.chromium.org/f/chromium/perf'
75 # Suffix for perf URL.
76 perf_report_url_suffix = 'report.html?history=150'
78 # Directory in which to save perf-test output data files.
79 perf_output_dir = '~/www/perf'
81 # URL pointing to builds and test results.
82 archive_url = 'http://build.chromium.org/buildbot'
84 # The test results server to upload our test results.
85 test_results_server = 'test-results.appspot.com'
87 # File in which to save a list of graph names.
88 perf_graph_list = 'graphs.dat'
90 # Magic step return code inidicating "warning(s)" rather than "error".
91 retcode_warnings = 88
93 @staticmethod
94 def GetBotPassword():
95 """Returns the slave password retrieved from a local file, or None.
97 The slave password is loaded from a local file next to this module file, if
98 it exists. This is a function rather than a variable so it's not called
99 when it's not needed.
101 We can't both make this a property and also keep it static unless we use a
102 <metaclass, which is overkill for this usage.
104 # Note: could be overriden by config_private.
105 if not getattr(Master, 'bot_password', None):
106 # If the bot_password has been requested, the file is required to exist
107 # if not overriden in config_private.
108 bot_password_path = os.path.join(BASE_DIR, '.bot_password')
109 Master.bot_password = open(bot_password_path).read().strip('\n\r')
110 return Master.bot_password
112 @staticmethod
113 def _extract_masters(master):
114 return [v for v in master.__dict__.itervalues()
115 if (inspect.isclass(v) and
116 issubclass(v, config_private.Master.Base) and
117 v != config_private.Master.Base)]
119 @classmethod
120 def get_base_masters(cls):
121 masters = []
122 for base_master in BASE_MASTERS:
123 masters += cls._extract_masters(base_master)
124 return masters
126 @classmethod
127 def get_all_masters(cls):
128 return cls._extract_masters(cls)