OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """ Check out the Skia sources. """ | 6 """ Check out the Skia sources. """ |
7 | 7 |
8 # build_step must be imported first, since it does some tweaking of PYTHONPATH. | 8 # build_step must be imported first, since it does some tweaking of PYTHONPATH. |
9 from build_step import BuildStep | 9 from build_step import BuildStep |
10 from utils.git_utils import GIT | 10 from utils import git_utils |
11 from utils import shell_utils | 11 from utils import shell_utils |
12 from utils import sync_skia_in_chrome | 12 from utils import sync_skia_in_chrome |
13 import shlex | 13 import shlex |
14 import sys | 14 import sys |
15 | 15 |
16 | 16 |
17 CHROMIUM_REPO = 'https://chromium.googlesource.com/chromium/src.git' | 17 CHROMIUM_REPO = 'https://chromium.googlesource.com/chromium/src.git' |
18 | 18 |
19 | 19 |
20 class ChromeCanaryUpdate(BuildStep): | 20 class ChromeCanaryUpdate(BuildStep): |
21 def __init__(self, timeout=24000, no_output_timeout=4800, attempts=5, | 21 def __init__(self, timeout=24000, no_output_timeout=4800, attempts=5, |
22 **kwargs): | 22 **kwargs): |
23 super(ChromeCanaryUpdate, self).__init__( | 23 super(ChromeCanaryUpdate, self).__init__( |
24 timeout=timeout, | 24 timeout=timeout, |
25 no_output_timeout=no_output_timeout, | 25 no_output_timeout=no_output_timeout, |
26 attempts=attempts, | 26 attempts=attempts, |
27 **kwargs) | 27 **kwargs) |
28 | 28 |
29 def _Run(self): | 29 def _Run(self): |
30 chrome_rev = shlex.split(shell_utils.run( | 30 chrome_rev = shlex.split(git_utils.GetRemoteMasterHash(CHROMIUM_REPO))[0] |
31 [GIT, 'ls-remote', CHROMIUM_REPO, | |
32 'refs/heads/master']))[0] | |
33 | 31 |
34 override_skia_checkout = True | 32 override_skia_checkout = True |
35 if 'AutoRoll' in self._builder_name: | 33 if 'AutoRoll' in self._builder_name: |
36 override_skia_checkout = False | 34 override_skia_checkout = False |
37 | 35 |
38 (got_skia_rev, got_chrome_rev) = sync_skia_in_chrome.Sync( | 36 (got_skia_rev, got_chrome_rev) = sync_skia_in_chrome.Sync( |
39 skia_revision=self._revision, | 37 skia_revision=self._revision, |
40 chrome_revision=chrome_rev, | 38 chrome_revision=chrome_rev, |
41 use_lkgr_skia=('use_lkgr_skia' in self._args.keys()), | 39 use_lkgr_skia=('use_lkgr_skia' in self._args.keys()), |
42 override_skia_checkout=override_skia_checkout) | 40 override_skia_checkout=override_skia_checkout) |
43 print 'Skia updated to %s' % got_skia_rev | 41 print 'Skia updated to %s' % got_skia_rev |
44 print 'Chrome updated to %s' % got_chrome_rev | 42 print 'Chrome updated to %s' % got_chrome_rev |
45 | 43 |
46 | 44 |
47 if '__main__' == __name__: | 45 if '__main__' == __name__: |
48 sys.exit(BuildStep.RunBuildStep(ChromeCanaryUpdate)) | 46 sys.exit(BuildStep.RunBuildStep(ChromeCanaryUpdate)) |
OLD | NEW |