Mercurial > bitten > bitten-test
comparison scripts/build.py @ 4:196009657e5e
Simplify the recipe commands interface:
* The implementation of a command is now located using a pseudo-protocol for namespace URIs.
* Commands are simply module-level functions instead of components.
* Remove dependency of the recipe/slave code on the Trac component architecture.
author | cmlenz |
---|---|
date | Mon, 06 Jun 2005 15:54:29 +0000 |
parents | 9ac0ee86ec7c |
children | 738a0ae251f6 |
comparison
equal
deleted
inserted
replaced
3:9ac0ee86ec7c | 4:196009657e5e |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 from trac.core import ComponentManager | 3 import sys |
4 | 4 |
5 from bitten.recipe import Recipe, RecipeExecutor | 5 from bitten import BuildError |
6 from bitten.python import cmd_distutils, rep_pylint, rep_unittest, rep_trace | 6 from bitten.recipe import Recipe |
7 from bitten.general import cmd_make | 7 |
8 def build(): | |
9 step_id = None | |
10 if len(sys.argv) > 1: | |
11 step_id = sys.argv[1] | |
12 | |
13 recipe = Recipe() | |
14 steps_run = [] | |
15 for step in recipe: | |
16 if not step_id or step.id == step_id: | |
17 print '-->', step.description or step.id | |
18 for function, kw in step: | |
19 function(recipe.basedir, **kw) | |
20 print | |
21 steps_run.append(step.id) | |
22 | |
23 if step_id and not step_id in steps_run: | |
24 raise BuildError, "Recipe has no step named '%s'" % step_id | |
8 | 25 |
9 if __name__ == '__main__': | 26 if __name__ == '__main__': |
10 mgr = ComponentManager() | 27 try: |
11 recipe = Recipe() | 28 build() |
12 RecipeExecutor(mgr).execute(recipe) | 29 except BuildError, e: |
30 print>>sys.stderr, "FAILED: %s" % e | |
31 sys.exit(-1) |