diff options
author | kennyballou <kballou@onyx.boisestate.edu> | 2013-01-24 15:33:50 -0700 |
---|---|---|
committer | kennyballou <kballou@onyx.boisestate.edu> | 2013-01-24 15:33:50 -0700 |
commit | 98691b6a87003cea46365bb8d7c54d9e94a84b93 (patch) | |
tree | 3c555ac61a88f52613324d5e9b09d54b99804711 /xnt | |
parent | 4f7f27b6d54ed46db633ee6f652d93ca4ee2aabc (diff) | |
download | xnt-98691b6a87003cea46365bb8d7c54d9e94a84b93.tar.gz xnt-98691b6a87003cea46365bb8d7c54d9e94a84b93.tar.xz |
Add multiple target execution (hack)
Diffstat (limited to 'xnt')
-rw-r--r-- | xnt/xenant.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/xnt/xenant.py b/xnt/xenant.py index ff2dd65..4e14224 100644 --- a/xnt/xenant.py +++ b/xnt/xenant.py @@ -47,22 +47,29 @@ def main(): params = list(p for p in sys.argv[1:] if p.startswith('-D')) opts = list(o for o in sys.argv[1:] if o.startswith('-') and o not in params) - arg = list(a for a in sys.argv[1:] if a not in opts and a not in params) + targets = list(a for a in sys.argv[1:] + if a not in opts and a not in params) for opt in opts: if opt in actions: actions[opt]() else: logger.debug("%s is not a valid option", opt) - ec = invokeBuild( - __loadBuild(), - arg[0] if len(arg) == 1 else "default", - params) + exit_codes = [] + def invoke(target): + return invokeBuild(__loadBuild(), + target, + params) + if targets: + for t in targets: + exit_codes.append(invoke(t)) + else: + exit_codes.append(invoke("default")) from xnt.tasks import rm rm("build.pyc", "__pycache__") elapsed_time = time.time() - start_time logger.info("Execution time: %.3f", elapsed_time) - logger.info("Success" if ec == 0 else "Failure") + logger.info("Success" if sum(exit_codes) == 0 else "Failure") def invokeBuild(build, targetName, props=[]): def __getProperties(): |