Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: recipe_modules/path/example.py

Issue 1777003003: recipe_engine: change resource API to use repo root (Closed) Base URL: https://github.com/luci/recipes-py.git@master
Patch Set: review Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « recipe_modules/path/api.py ('k') | recipe_modules/path/example.expected/linux.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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']))
OLDNEW
« no previous file with comments | « recipe_modules/path/api.py ('k') | recipe_modules/path/example.expected/linux.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698