OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 DEPS = [ | 5 DEPS = [ |
6 'path', | 6 'path', |
7 'platform', | 7 'platform', |
8 'properties', | 8 'properties', |
9 'step', | 9 'step', |
10 ] | 10 ] |
11 | 11 |
12 from recipe_engine.config_types import Path | 12 from recipe_engine.config_types import Path |
13 | 13 |
14 def RunSteps(api): | 14 def RunSteps(api): |
15 api.path.set_config('example') | 15 api.path.set_config('example') |
16 | 16 |
17 api.step('step1', ['/bin/echo', str(api.path['slave_build'].join('foo'))]) | 17 api.step('step1', ['/bin/echo', str(api.path['slave_build'].join('foo'))]) |
18 | 18 |
19 # module.resource(...) demo. | 19 # module.resource(...) demo. |
20 api.step('print resource', | 20 api.step('print resource', |
21 ['echo', api.path.resource('dir', 'file.py')]) | 21 ['echo', api.path.resource('dir', 'file.py')]) |
22 | 22 |
23 # module.package_dir() demo. | 23 # module.package_repo_resource() demo. |
24 api.step('print package dir', | 24 api.step('print package dir', |
25 ['echo', api.path.package_resource('dir', 'file.py')]) | 25 ['echo', api.path.package_repo_resource('dir', 'file.py')]) |
26 | 26 |
27 # Global dynamic paths (see config.py example for declaration): | 27 # Global dynamic paths (see config.py example for declaration): |
28 dynamic_path = Path('[BORTS]', 'jerky') | 28 dynamic_path = Path('[BORTS]', 'jerky') |
29 | 29 |
30 assert 'borts' not in api.path | 30 assert 'borts' not in api.path |
31 api.path['borts'] = api.path['slave_build'].join('borts') | 31 api.path['borts'] = api.path['slave_build'].join('borts') |
32 assert 'borts' in api.path | 32 assert 'borts' in api.path |
33 | 33 |
34 api.step('borts path', ['/bin/echo', dynamic_path]) | 34 api.step('borts path', ['/bin/echo', dynamic_path]) |
35 | 35 |
(...skipping 24 matching lines...) Expand all Loading... |
60 | 60 |
61 # We have support for chromium swarming built in to the engine for some | 61 # We have support for chromium swarming built in to the engine for some |
62 # reason. TODO(phajdan.jr) remove it. | 62 # reason. TODO(phajdan.jr) remove it. |
63 yield (api.test('linux_swarming') + | 63 yield (api.test('linux_swarming') + |
64 api.properties(path_config='swarming') + | 64 api.properties(path_config='swarming') + |
65 api.path.exists(api.path['slave_build'])) | 65 api.path.exists(api.path['slave_build'])) |
66 | 66 |
67 yield (api.test('linux_kitchen') + | 67 yield (api.test('linux_kitchen') + |
68 api.properties(path_config='kitchen') + | 68 api.properties(path_config='kitchen') + |
69 api.path.exists(api.path['slave_build'])) | 69 api.path.exists(api.path['slave_build'])) |
OLD | NEW |