OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """A tool to extract size information for chrome, executed by buildbot. | 6 """A tool to extract size information for chrome, executed by buildbot. |
7 | 7 |
8 When this is run, the current directory (cwd) should be the outer build | 8 When this is run, the current directory (cwd) should be the outer build |
9 directory (e.g., chrome-release/build/). | 9 directory (e.g., chrome-release/build/). |
10 | 10 |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 350 |
351 Returns the first non-zero exit status of any command it executes, | 351 Returns the first non-zero exit status of any command it executes, |
352 or zero on success. | 352 or zero on success. |
353 """ | 353 """ |
354 build_dir = build_directory.GetBuildOutputDirectory() | 354 build_dir = build_directory.GetBuildOutputDirectory() |
355 target_dir = os.path.join(build_dir, options.target) | 355 target_dir = os.path.join(build_dir, options.target) |
356 chrome_dll = os.path.join(target_dir, 'chrome.dll') | 356 chrome_dll = os.path.join(target_dir, 'chrome.dll') |
357 chrome_child_dll = os.path.join(target_dir, 'chrome_child.dll') | 357 chrome_child_dll = os.path.join(target_dir, 'chrome_child.dll') |
358 chrome_exe = os.path.join(target_dir, 'chrome.exe') | 358 chrome_exe = os.path.join(target_dir, 'chrome.exe') |
359 mini_installer_exe = os.path.join(target_dir, 'mini_installer.exe') | 359 mini_installer_exe = os.path.join(target_dir, 'mini_installer.exe') |
360 npchrome_frame_dll = os.path.join(target_dir, 'npchrome_frame.dll') | |
361 setup_exe = os.path.join(target_dir, 'setup.exe') | 360 setup_exe = os.path.join(target_dir, 'setup.exe') |
362 libpeerconnection_dll = os.path.join(target_dir, 'libpeerconnection.dll') | 361 libpeerconnection_dll = os.path.join(target_dir, 'libpeerconnection.dll') |
363 | 362 |
364 result = 0 | 363 result = 0 |
365 | 364 |
366 print 'RESULT chrome.dll: chrome.dll= %s bytes' % get_size(chrome_dll) | 365 print 'RESULT chrome.dll: chrome.dll= %s bytes' % get_size(chrome_dll) |
367 | 366 |
368 fmt = 'RESULT chrome_child.dll: chrome_child.dll= %s bytes' | 367 fmt = 'RESULT chrome_child.dll: chrome_child.dll= %s bytes' |
369 print fmt % get_size(chrome_child_dll) | 368 print fmt % get_size(chrome_child_dll) |
370 | 369 |
371 print 'RESULT chrome.exe: chrome.exe= %s bytes' % get_size(chrome_exe) | 370 print 'RESULT chrome.exe: chrome.exe= %s bytes' % get_size(chrome_exe) |
372 | 371 |
373 if os.path.exists(mini_installer_exe): | 372 if os.path.exists(mini_installer_exe): |
374 fmt = 'RESULT mini_installer.exe: mini_installer.exe= %s bytes' | 373 fmt = 'RESULT mini_installer.exe: mini_installer.exe= %s bytes' |
375 print fmt % get_size(mini_installer_exe) | 374 print fmt % get_size(mini_installer_exe) |
376 | 375 |
377 if os.path.exists(npchrome_frame_dll): | |
378 fmt = 'RESULT npchrome_frame.dll: npchrome_frame.dll= %s bytes' | |
379 print fmt % get_size(npchrome_frame_dll) | |
380 | |
381 if os.path.exists(setup_exe): | 376 if os.path.exists(setup_exe): |
382 print 'RESULT setup.exe: setup.exe= %s bytes' % get_size(setup_exe) | 377 print 'RESULT setup.exe: setup.exe= %s bytes' % get_size(setup_exe) |
383 | 378 |
384 if os.path.exists(libpeerconnection_dll): | 379 if os.path.exists(libpeerconnection_dll): |
385 fmt = 'RESULT libpeerconnection.dll: libpeerconnection.dll= %s bytes' | 380 fmt = 'RESULT libpeerconnection.dll: libpeerconnection.dll= %s bytes' |
386 print fmt % get_size(libpeerconnection_dll) | 381 print fmt % get_size(libpeerconnection_dll) |
387 | 382 |
388 return result | 383 return result |
389 | 384 |
390 | 385 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 else: | 425 else: |
431 sys.stderr.write('Unknown platform %s.\n' % repr(options.platform)) | 426 sys.stderr.write('Unknown platform %s.\n' % repr(options.platform)) |
432 msg = 'Use the --platform= option to specify a supported platform:\n' | 427 msg = 'Use the --platform= option to specify a supported platform:\n' |
433 sys.stderr.write(msg + ' ' + ' '.join(platforms) + '\n') | 428 sys.stderr.write(msg + ' ' + ' '.join(platforms) + '\n') |
434 return 2 | 429 return 2 |
435 return real_main(options, args) | 430 return real_main(options, args) |
436 | 431 |
437 | 432 |
438 if '__main__' == __name__: | 433 if '__main__' == __name__: |
439 sys.exit(main()) | 434 sys.exit(main()) |
OLD | NEW |