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