def buzz(self, *parameters): """ initialize project, find deps and builds in a single command """ from biicode.client.exception import NotInAHiveException parser = argparse.ArgumentParser(description=BiiCommand.buzz.__doc__, prog="bii buzz") parser.add_argument('-G', metavar='"CMake generator"', help='Define cmake generator. Type cmake --help to see' ' available generators') args = parser.parse_args(*parameters) # BII INIT -L try: self.bii.bii_paths.project_root except NotInAHiveException: self.bii.user_io.out.writeln("Creating biicode project (simple layout)\n" "$ bii init -l", Color.BRIGHT_MAGENTA) init_hive(self.bii, None, "simple") # BII FIND self.bii.user_io.out.writeln("Looking for dependencies\n" "$ bii find", Color.BRIGHT_MAGENTA) self.find() if args.G: self.bii.user_io.out.writeln('Configuring with generator\n' '$ bii cpp:configure -G "%s"' % args.G, Color.BRIGHT_MAGENTA) CPPToolChain(self.bii).configure(["-G", args.G]) # BII CPP:BUILD self.bii.user_io.out.writeln("Building\n" "$ bii cpp:build", Color.BRIGHT_MAGENTA) CPPToolChain(self.bii).build()
def init(self, *parameters): """ creates a new biicode project""" parser = argparse.ArgumentParser(description=BiiCommand.init.__doc__, prog="bii init") parser.add_argument("name", nargs='?', default=None, help='Optional name of the folder. If specified, bii will ' 'create a new folder and initialize a project inside, ' 'otherwise, it will try to initialize in the current folder') parser.add_argument("-L", "-l", "--layout", nargs='?', default=argparse.SUPPRESS, help='Optional layout. If no param is specified, it will use ' 'the "minimal" one. Other available: CLion') args = parser.parse_args(*parameters) # To enable -h if not hasattr(args, "layout"): layout = None else: layout = args.layout if args.layout else "simple" if args.name == ".": # Git style args.name = None init_hive(self.bii, args.name, layout)