diff options
author | kennyballou <kballou@onyx.boisestate.edu> | 2012-10-10 13:41:06 -0600 |
---|---|---|
committer | kballou <kballou@onyx.boisestate.edu> | 2012-10-10 13:41:06 -0600 |
commit | 95bac9b4705e58afad3eb083dc65892d5b0cba27 (patch) | |
tree | 170e9d361cf883a965a1246f83ab950278a95b77 /xnt/tasks.py | |
parent | 4d12c72c7550a0fb72cd6fcd4d4dde3492cacf0e (diff) | |
download | xnt-95bac9b4705e58afad3eb083dc65892d5b0cba27.tar.gz xnt-95bac9b4705e58afad3eb083dc65892d5b0cba27.tar.xz |
Update tasks: allow for different build tools
Update the xnt.tasks module to allow tasks' make to use different build
tools.
Add modules to define the accepted build tools (currently, ant, nant, and
make)
Diffstat (limited to 'xnt/tasks.py')
-rw-r--r-- | xnt/tasks.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/xnt/tasks.py b/xnt/tasks.py index 41577b4..073aac8 100644 --- a/xnt/tasks.py +++ b/xnt/tasks.py @@ -8,6 +8,19 @@ import shutil import zipfile import contextlib +_names = sys.modules.keys() + +if 'xnt.build.ant' in _names: + import xnt.build.ant as build +elif 'xnt.build.nant' in _names: + import xnt.build.nant as build +elif 'xnt.build.make' in _names: + import xnt.build.make as build +else: + raise ImportError("No build tool module loaded") + +sys.modules['xnt.build'] = build + #File associated tasks def cp(src,dst): if os.path.isdir(src): @@ -43,7 +56,7 @@ def zip(dir,zipfilename): z.write(absfn, zfn) def make(path="",target=""): - makeCmd = ["ant", target] + makeCmd = [build.cmd, target] if path and os.path.exists(path): oldPath = os.getcwd() os.chdir(os.path.abspath(path)) |