From 4d680580f686e3032a6b4d8af3c156d8c0e8f885 Mon Sep 17 00:00:00 2001 From: jmoore Date: Thu, 17 Jan 2013 15:05:17 +0100 Subject: [PATCH] Unify top-level ./build.py args Now, "-fs", "-java", "-cpp", "-web", and "-py" all run the builds at the proper layer, i.e. equivalent to: ./build.py -f components/tools/X/build.xml --- build.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/build.py b/build.py index 8d8c174a7e0..385c4117f9e 100755 --- a/build.py +++ b/build.py @@ -108,25 +108,23 @@ def choose_omero_version(): def handle_tools(args): + _ = os.path.sep.join additions = [] - while len(args) > 0 and args[0] in ("-perf", "-py", "-cpp", "-top"): + mappings = { + "-top": _(["build.xml"]), + "-cpp": _(["components","tools","OmeroCpp","build.xml"]), + "-fs": _(["components","tools","OmeroFS","build.xml"]), + "-java": _(["components","tools","OmeroJava","build.xml"]), + "-py": _(["components","tools","OmeroPy","build.xml"]), + "-web": _(["components","tools","OmeroWeb","build.xml"]), + } + while len(args) > 0 and args[0] in mappings.keys()+["-perf"]: if args[0] == "-perf": args.pop(0) A = "-listener net.sf.antcontrib.perf.AntPerformanceListener".split() additions.extend(A) - elif args[0] == "-py": - args.pop(0) - F = os.path.sep.join(["components","tools","OmeroPy","build.xml"]) - A = ["-f", F] - additions.extend(A) - elif args[0] == "-cpp": - args.pop(0) - F = os.path.sep.join(["components","tools","OmeroCpp","build.xml"]) - A = ["-f", F] - additions.extend(A) - elif args[0] == "-top": - args.pop(0) - F = os.path.sep.join(["build.xml"]) + elif args[0] in mappings.keys(): + F = mappings[args.pop(0)] A = ["-f", F] additions.extend(A) return additions + args