OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 """Recipe to build windows depot_tools bootstrap zipfile.""" | 5 """Recipe to build windows depot_tools bootstrap zipfile.""" |
6 | 6 |
7 DEPS = [ | 7 DEPS = [ |
8 'recipe_engine/path', | 8 'recipe_engine/path', |
9 'recipe_engine/platform', | 9 'recipe_engine/platform', |
10 'recipe_engine/properties', | 10 'recipe_engine/properties', |
11 'recipe_engine/step', | 11 'recipe_engine/step', |
12 | 12 |
13 'depot_tools/git', | 13 'depot_tools/git', |
14 'depot_tools/infra_paths', | |
15 | 14 |
16 'file', | 15 'file', |
17 'gsutil', | 16 'gsutil', |
18 'zip', | 17 'zip', |
19 ] | 18 ] |
20 | 19 |
21 from recipe_engine.recipe_api import Property | 20 from recipe_engine.recipe_api import Property |
22 | 21 |
23 REPO_URL='https://chromium.googlesource.com/chromium/tools/depot_tools.git' | 22 REPO_URL='https://chromium.googlesource.com/chromium/tools/depot_tools.git' |
24 DOC_UPLOAD_URL='gs://chrome-infra-docs/flat/depot_tools/docs/' | 23 DOC_UPLOAD_URL='gs://chrome-infra-docs/flat/depot_tools/docs/' |
25 | 24 |
26 PROPERTIES = { | 25 PROPERTIES = { |
27 'revision': Property( | 26 'revision': Property( |
28 kind=str, help='The revision of depot_tools to check out'), | 27 kind=str, help='The revision of depot_tools to check out'), |
29 } | 28 } |
30 | 29 |
31 def RunSteps(api, revision): | 30 def RunSteps(api, revision): |
32 # prepare the output dir and zip paths | 31 # prepare the output dir and zip paths |
33 api.path['checkout'] = api.infra_paths['slave_build'].join('depot_tools') | 32 api.path['checkout'] = api.path['slave_build'].join('depot_tools') |
34 zip_out = api.infra_paths['slave_build'].join('depot_tools.zip') | 33 zip_out = api.path['slave_build'].join('depot_tools.zip') |
35 | 34 |
36 with api.step.nest('clean workspace'): | 35 with api.step.nest('clean workspace'): |
37 api.file.rmtree('rm depot_tools', api.path['checkout']) | 36 api.file.rmtree('rm depot_tools', api.path['checkout']) |
38 api.file.remove('rm depot_tools.zip', zip_out, ok_ret=(0, 1)) | 37 api.file.remove('rm depot_tools.zip', zip_out, ok_ret=(0, 1)) |
39 | 38 |
40 # generate the new directory | 39 # generate the new directory |
41 api.step('mk depot_tools', ['mkdir', api.path['checkout']]) | 40 api.step('mk depot_tools', ['mkdir', api.path['checkout']]) |
42 | 41 |
43 with api.step.nest('clone + checkout'): | 42 with api.step.nest('clone + checkout'): |
44 api.git('clone', '--single-branch', '-n', REPO_URL, api.path['checkout']) | 43 api.git('clone', '--single-branch', '-n', REPO_URL, api.path['checkout']) |
(...skipping 11 matching lines...) Expand all Loading... |
56 args=['-a', 'public-read'], unauthenticated_url=True) | 55 args=['-a', 'public-read'], unauthenticated_url=True) |
57 | 56 |
58 # upload html docs | 57 # upload html docs |
59 api.gsutil(['cp', '-r', '-z', 'html', '-a', 'public-read', | 58 api.gsutil(['cp', '-r', '-z', 'html', '-a', 'public-read', |
60 api.path['checkout'].join('man', 'html'), DOC_UPLOAD_URL], | 59 api.path['checkout'].join('man', 'html'), DOC_UPLOAD_URL], |
61 name='upload docs') | 60 name='upload docs') |
62 | 61 |
63 | 62 |
64 def GenTests(api): | 63 def GenTests(api): |
65 yield api.test('basic') + api.properties(revision='deadbeef') | 64 yield api.test('basic') + api.properties(revision='deadbeef') |
OLD | NEW |