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

Side by Side Diff: client/tools/buildbot_annotated_steps.py

Issue 11236012: Add script for pub buildbots. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 8 years, 1 month 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
« no previous file with comments | « no previous file | tools/bots/bot.py » ('j') | tools/bots/pub.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 #!/usr/bin/python 5 #!/usr/bin/python
6 6
7 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 7 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
8 # Use of this source code is governed by a BSD-style license that can be 8 # Use of this source code is governed by a BSD-style license that can be
9 # found in the LICENSE file. 9 # found in the LICENSE file.
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 args: 90 args:
91 srcpath - the location of the source code to build 91 srcpath - the location of the source code to build
92 mode - the mode release or debug 92 mode - the mode release or debug
93 version - the svn version of the currently checked out code 93 version - the svn version of the currently checked out code
94 ''' 94 '''
95 print 'ProcessTools' 95 print 'ProcessTools'
96 96
97 toolsBuildScript = os.path.join('.', 'editor', 'build', 'build.py') 97 toolsBuildScript = os.path.join('.', 'editor', 'build', 'build.py')
98 98
99 # TODO(devoncarew): should we move this into GetBuildInfo()? 99 # TODO(devoncarew): should we move this into GetBuildInfo()?
100 # get the latest changed revision from the current repository sub-tree 100 # get the latest changed revision from the current repository sub-tree
101 version = GetLatestChangedRevision() 101 version = GetLatestChangedRevision()
102 102
103 #TODO: debug statements to be removed in the future. 103 #TODO: debug statements to be removed in the future.
104 print "mode = " + mode 104 print "mode = " + mode
105 print "name = " + name 105 print "name = " + name
106 print "version = " + version 106 print "version = " + version
107 print "toolsBuildScript = " + os.path.abspath(toolsBuildScript) 107 print "toolsBuildScript = " + os.path.abspath(toolsBuildScript)
108 108
109 utils = GetUtils() 109 utils = GetUtils()
(...skipping 14 matching lines...) Expand all
124 ''' 124 '''
125 build and test the compiler 125 build and test the compiler
126 ''' 126 '''
127 print 'ProcessCompiler' 127 print 'ProcessCompiler'
128 has_shell=False 128 has_shell=False
129 if 'windows' in name: 129 if 'windows' in name:
130 # In Windows we need to run in the shell, so that we have all the 130 # In Windows we need to run in the shell, so that we have all the
131 # environment variables available. 131 # environment variables available.
132 has_shell=True 132 has_shell=True
133 return subprocess.call([sys.executable, 133 return subprocess.call([sys.executable,
134 os.path.join('utils', 'compiler', 'buildbot.py')], 134 os.path.join('tools', 'bots', 'compiler.py')],
135 env=os.environ, shell=has_shell)
136
137 def ProcessPub(name):
138 '''
139 Build and test pub and the pub packages in the main Dart repository.
140 '''
141 print 'ProcessPub'
142 has_shell=False
143 if '-win' in name:
144 # In Windows we need to run in the shell, so that we have all the
145 # environment variables available.
146 has_shell=True
147 return subprocess.call([sys.executable,
148 os.path.join('tools', 'bots', 'pub.py')],
135 env=os.environ, shell=has_shell) 149 env=os.environ, shell=has_shell)
136 150
137 def FixJavaHome(): 151 def FixJavaHome():
138 buildbot_javahome = os.getenv('BUILDBOT_JAVA_HOME') 152 buildbot_javahome = os.getenv('BUILDBOT_JAVA_HOME')
139 if buildbot_javahome: 153 if buildbot_javahome:
140 current_pwd = os.getenv('PWD') 154 current_pwd = os.getenv('PWD')
141 java_home = os.path.join(current_pwd, buildbot_javahome) 155 java_home = os.path.join(current_pwd, buildbot_javahome)
142 os.environ['JAVA_HOME'] = java_home 156 os.environ['JAVA_HOME'] = java_home
143 print 'Setting java home to' 157 print 'Setting java home to'
144 print java_home 158 print java_home
145 159
146 def ClobberBuilder(): 160 def ClobberBuilder():
147 """ Clobber the builder before we do the build. 161 """ Clobber the builder before we do the build.
148 Args: 162 Args:
149 - mode: either 'debug' or 'release' 163 - mode: either 'debug' or 'release'
150 """ 164 """
151 cmd = [sys.executable, 165 cmd = [sys.executable,
152 './tools/clean_output_directory.py'] 166 './tools/clean_output_directory.py']
153 print 'Clobbering %s' % (' '.join(cmd)) 167 print 'Clobbering %s' % (' '.join(cmd))
154 return subprocess.call(cmd) 168 return subprocess.call(cmd)
155 169
156 def GetShouldClobber(): 170 def GetShouldClobber():
157 return os.environ.get(BUILDER_CLOBBER) == "1" 171 return os.environ.get(BUILDER_CLOBBER) == "1"
158 172
159 def RunDart(scriptPath): 173 def RunDart(scriptPath):
160 if sys.platform == 'darwin': 174 if sys.platform == 'darwin':
161 pipe = subprocess.Popen( 175 pipe = subprocess.Popen(
162 ['./tools/testing/bin/macos/dart', scriptPath], 176 ['./tools/testing/bin/macos/dart', scriptPath],
163 stdout=subprocess.PIPE, stderr=subprocess.PIPE) 177 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
164 elif os.name == 'posix': 178 elif os.name == 'posix':
165 pipe = subprocess.Popen( 179 pipe = subprocess.Popen(
166 ['./tools/testing/bin/linux/dart', scriptPath], 180 ['./tools/testing/bin/linux/dart', scriptPath],
167 stdout=subprocess.PIPE, stderr=subprocess.PIPE) 181 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
168 else: 182 else:
169 pipe = subprocess.Popen( 183 pipe = subprocess.Popen(
170 ['tools\\testing\\bin\\windows\\dart.exe', scriptPath], 184 ['tools\\testing\\bin\\windows\\dart.exe', scriptPath],
171 stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) 185 stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
172 186
173 output = pipe.communicate() 187 output = pipe.communicate()
174 return output[0] 188 return output[0]
175 189
176 def GetLatestChangedRevision(): 190 def GetLatestChangedRevision():
177 # 0.1.2.0_r13661 191 # 0.1.2.0_r13661
178 # 0.1.2.0_r13661_username 192 # 0.1.2.0_r13661_username
179 fullVersion = RunDart("tools/version.dart") 193 fullVersion = RunDart("tools/version.dart")
180 194
(...skipping 20 matching lines...) Expand all
201 print '@@@STEP_FAILURE@@@' 215 print '@@@STEP_FAILURE@@@'
202 return status 216 return status
203 217
204 218
205 #TODO(sigmund): remove this indirection once we update our bots 219 #TODO(sigmund): remove this indirection once we update our bots
206 (name, version) = GetBuildInfo() 220 (name, version) = GetBuildInfo()
207 if name.startswith('dart-editor'): 221 if name.startswith('dart-editor'):
208 # TODO (danrubel) Fix dart-editor builds so that we can call FixJavaHome() b efore the build 222 # TODO (danrubel) Fix dart-editor builds so that we can call FixJavaHome() b efore the build
209 FixJavaHome() 223 FixJavaHome()
210 status = ProcessTools('release', name, version) 224 status = ProcessTools('release', name, version)
225 elif name.startswith('pub-'):
226 status = ProcessPub(name)
211 else: 227 else:
212 # The buildbot will set a BUILDBOT_JAVA_HOME relative to the dart 228 # The buildbot will set a BUILDBOT_JAVA_HOME relative to the dart
213 # root directory, set JAVA_HOME based on that. 229 # root directory, set JAVA_HOME based on that.
214 FixJavaHome() 230 FixJavaHome()
215 status = ProcessCompiler(name) 231 status = ProcessCompiler(name)
216 232
217 if status: 233 if status:
218 print '@@@STEP_FAILURE@@@' 234 print '@@@STEP_FAILURE@@@'
219 235
220 return status 236 return status
221 237
222 238
223 if __name__ == '__main__': 239 if __name__ == '__main__':
224 sys.exit(main()) 240 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | tools/bots/bot.py » ('j') | tools/bots/pub.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698