def setup_parser_common(parser): """Parser setup common to both rez-build and rez-release.""" from rez.build_process_ import get_build_process_types from rez.build_system import get_valid_build_systems process_types = get_build_process_types() parser.add_argument( "--process", type=str, choices=process_types, default="local", help="the build process to use (default: %(default)s).") # add build system option only if one build system is associated with cwd clss = get_valid_build_systems(os.getcwd()) if clss: if len(clss) == 1: cls = clss[0] cls.bind_cli(parser) else: types = [x.name() for x in clss] parser.add_argument( "-b", "--build-system", dest="buildsys", type=str, choices=types, help="the build system to use.") parser.add_argument( "--variants", nargs='+', type=int, metavar="INDEX", help="select variants to build (zero-indexed).") parser.add_argument( "--ba", "--build-args", dest="build_args", type=str, metavar="ARGS", help="arguments to pass to the build system. Alternatively, list these " "after a '--'") parser.add_argument( "--cba", "--child-build-args", dest="child_build_args", type=str, metavar="ARGS", help="arguments to pass to the child build system, if any. " "Alternatively, list these after a second '--'.")
def setup_parser_common(parser): """Parser setup common to both rez-build and rez-release.""" from rez.build_process_ import get_build_process_types from rez.build_system import get_valid_build_systems process_types = get_build_process_types() parser.add_argument( "--process", type=str, choices=process_types, default="local", help="the build process to use (default: %(default)s).") # add build system option only if one build system is associated with cwd clss = get_valid_build_systems(os.getcwd()) if len(clss) == 1: cls = clss[0] cls.bind_cli(parser) elif clss: types = [x.name() for x in clss] parser.add_argument( "-b", "--build-system", dest="buildsys", type=str, choices=types, default=None, help="the build system to use.") parser.add_argument( "--variants", nargs='+', type=int, metavar="INDEX", help="select variants to build (zero-indexed).") parser.add_argument( "--ba", "--build-args", dest="build_args", type=str, metavar="ARGS", help="arguments to pass to the build system. Alternatively, list these " "after a '--'") parser.add_argument( "--cba", "--child-build-args", dest="child_build_args", type=str, metavar="ARGS", help="arguments to pass to the child build system, if any. " "Alternatively, list these after a second '--'.")
def setup_parser_common(parser): """Parser setup common to both rez-build and rez-release.""" from rez.build_process_ import get_build_process_types from rez.build_system import get_valid_build_systems process_types = get_build_process_types() parser.add_argument( "--process", type=str, choices=process_types, default="local", help="the build process to use (default: %(default)s).") # add build system choices valid for this package package = get_current_developer_package() clss = get_valid_build_systems(os.getcwd(), package=package) if clss: if len(clss) == 1: cls_ = clss[0] title = "%s build system arguments" % cls_.name() group = parser.add_argument_group(title) cls_.bind_cli(parser, group) types = [x.name() for x in clss] else: types = None parser.add_argument( "-b", "--build-system", dest="buildsys", choices=types, help="the build system to use. If not specified, it is detected. Set " "'build_system' or 'build_command' to specify the build system in the " "package itself.") parser.add_argument("--variants", nargs='+', type=int, metavar="INDEX", help="select variants to build (zero-indexed).") parser.add_argument( "--ba", "--build-args", dest="build_args", metavar="ARGS", help="arguments to pass to the build system. Alternatively, list these " "after a '--'.") parser.add_argument( "--cba", "--child-build-args", dest="child_build_args", metavar="ARGS", help="arguments to pass to the child build system, if any. " "Alternatively, list these after a second '--'.")
def setup_parser_common(parser): """Parser setup common to both rez-build and rez-release.""" from rez.build_process_ import get_build_process_types from rez.build_system import get_valid_build_systems process_types = get_build_process_types() parser.add_argument( "--process", type=str, choices=process_types, default="local", help="the build process to use (default: %(default)s).") # add build system choices valid for this package package = get_current_developer_package() clss = get_valid_build_systems(os.getcwd(), package=package) if clss: if len(clss) == 1: cls_ = clss[0] title = "%s build system arguments" % cls_.name() group = parser.add_argument_group(title) cls_.bind_cli(group) types = [x.name() for x in clss] else: types = None parser.add_argument( "-b", "--build-system", dest="buildsys", choices=types, help="the build system to use. If not specified, it is detected. Set " "'build_system' or 'build_command' to specify the build system in the " "package itself.") parser.add_argument( "--variants", nargs='+', type=int, metavar="INDEX", help="select variants to build (zero-indexed).") parser.add_argument( "--ba", "--build-args", dest="build_args", metavar="ARGS", help="arguments to pass to the build system. Alternatively, list these " "after a '--'.") parser.add_argument( "--cba", "--child-build-args", dest="child_build_args", metavar="ARGS", help="arguments to pass to the child build system, if any. " "Alternatively, list these after a second '--'.")