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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/step/config.py
diff --git a/scripts/slave/recipe_modules/step/config.py b/scripts/slave/recipe_modules/step/config.py
new file mode 100644
index 0000000000000000000000000000000000000000..0c3f249e5a4ecfb3671ad0ab104dae7172796fc3
--- /dev/null
+++ b/scripts/slave/recipe_modules/step/config.py
@@ -0,0 +1,58 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import collections
+
+from recipe_engine.config import List
+from recipe_engine.config import (config_item_context, ConfigGroup, ConfigList,
+ Dict, Single, Set)
+from recipe_engine.config_types import Path
+from recipe_engine.util import Placeholder
+
+
+def BaseConfig(**_kwargs):
+ def render_cmd(lst):
+ return [(x if isinstance(x, Placeholder) else str(x)) for x in lst]
+
+ return ConfigGroup(
+ # For compatibility with buildbot, the step name must be ascii, which is why
+ # this is a 'str' and not a 'basestring'.
+ name = Single(str),
+ cmd = List(inner_type=(int,basestring,Path,Placeholder),
+ jsonish_fn=render_cmd),
+
+ # optional
+ env = Dict(item_fn=lambda (k, v): (k, v if v is None else str(v)),
+ value_type=(basestring,int,Path,type(None))),
+ cwd = Single(Path, jsonish_fn=str, required=False),
+
+ stdout = Single(Placeholder, required=False),
+ stderr = Single(Placeholder, required=False),
+ stdin = Single(Placeholder, required=False),
+
+ allow_subannotations = Single(bool, required=False),
+
+ trigger_specs = ConfigList(
+ lambda: ConfigGroup(
+ bucket=Single(basestring),
+ builder_name=Single(basestring),
+ properties=Dict(value_type=object),
+ buildbot_changes=List(dict),
+ ),
+ ),
+
+ step_test_data = Single(collections.Callable, required=False),
+
+ ok_ret = Set(int),
+ infra_step = Single(bool, required=False),
+ step_nest_level = Single(int, required=False),
+ )
+
+
+config_ctx = config_item_context(BaseConfig)
+
+@config_ctx()
+def test(c): # pragma: no cover
+ c.name = 'test'
+ c.cmd = [Path('[CHECKOUT]', 'build', 'tools', 'cool_script.py')]
« 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