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

Side by Side Diff: scripts/slave/recipe_modules/step/config.py

Issue 1347263002: Revert of Cross-repo recipe package system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « scripts/slave/recipe_modules/step/api.py ('k') | scripts/slave/recipe_modules/step/example.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import collections
6
7 from recipe_engine.config import List
8 from recipe_engine.config import (config_item_context, ConfigGroup, ConfigList,
9 Dict, Single, Set)
10 from recipe_engine.config_types import Path
11 from recipe_engine.util import Placeholder
12
13
14 def BaseConfig(**_kwargs):
15 def render_cmd(lst):
16 return [(x if isinstance(x, Placeholder) else str(x)) for x in lst]
17
18 return ConfigGroup(
19 # For compatibility with buildbot, the step name must be ascii, which is why
20 # this is a 'str' and not a 'basestring'.
21 name = Single(str),
22 cmd = List(inner_type=(int,basestring,Path,Placeholder),
23 jsonish_fn=render_cmd),
24
25 # optional
26 env = Dict(item_fn=lambda (k, v): (k, v if v is None else str(v)),
27 value_type=(basestring,int,Path,type(None))),
28 cwd = Single(Path, jsonish_fn=str, required=False),
29
30 stdout = Single(Placeholder, required=False),
31 stderr = Single(Placeholder, required=False),
32 stdin = Single(Placeholder, required=False),
33
34 allow_subannotations = Single(bool, required=False),
35
36 trigger_specs = ConfigList(
37 lambda: ConfigGroup(
38 bucket=Single(basestring),
39 builder_name=Single(basestring),
40 properties=Dict(value_type=object),
41 buildbot_changes=List(dict),
42 ),
43 ),
44
45 step_test_data = Single(collections.Callable, required=False),
46
47 ok_ret = Set(int),
48 infra_step = Single(bool, required=False),
49 step_nest_level = Single(int, required=False),
50 )
51
52
53 config_ctx = config_item_context(BaseConfig)
54
55 @config_ctx()
56 def test(c): # pragma: no cover
57 c.name = 'test'
58 c.cmd = [Path('[CHECKOUT]', 'build', 'tools', 'cool_script.py')]
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/step/api.py ('k') | scripts/slave/recipe_modules/step/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698