diff options
author | kennyballou <kballou@onyx.boisestate.edu> | 2013-01-25 18:51:28 -0700 |
---|---|---|
committer | kennyballou <kballou@onyx.boisestate.edu> | 2013-01-25 18:51:28 -0700 |
commit | 564c08e6d6ccd928f2b0a3f7f5a81a404359c748 (patch) | |
tree | a16bb878e57001b69117fd255e26a11a60aa3f6d /xnt/xenant.py | |
parent | 982e419fc249a0991c417079c050a08c18b06cde (diff) | |
parent | d5884e72eb8224932d7d5fd4b51343f2b610a172 (diff) | |
download | xnt-564c08e6d6ccd928f2b0a3f7f5a81a404359c748.tar.gz xnt-564c08e6d6ccd928f2b0a3f7f5a81a404359c748.tar.xz |
Merge branch 'add_multi_target_support'
Conflicts:
xnt/xenant.py
Diffstat (limited to 'xnt/xenant.py')
-rw-r--r-- | xnt/xenant.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/xnt/xenant.py b/xnt/xenant.py index 11c2760..8f19440 100644 --- a/xnt/xenant.py +++ b/xnt/xenant.py @@ -47,21 +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) + ec = sum(exit_codes) logger.info("Success" if ec == 0 else "Failure") if ec != 0: sys.exit(ec) |