@typed_pos_args('project', str, varargs=str)
@typed_kwargs('project', DEFAULT_OPTIONS, KwargInfo('meson_version', (str, NoneType)), KwargInfo('version', (str, mesonlib.File, NoneType, list), default='undefined', validator=_project_version_validator, convertor=(lambda x: (x[0] if isinstance(x, list) else x))), KwargInfo('license', ContainerTypeInfo(list, str), default=['unknown'], listify=True), KwargInfo('subproject_dir', str, default='subprojects'))
def func_project(self, node: mparser.FunctionNode, args: T.Tuple[(str, T.List[str])], kwargs: 'kwargs.Project') -> None:
    (proj_name, proj_langs) = args
    if (':' in proj_name):
        raise InvalidArguments(f"Project name {proj_name!r} must not contain ':'")
    if kwargs['meson_version']:
        cv = coredata.version
        pv = kwargs['meson_version']
        if (not mesonlib.version_compare(cv, pv)):
            raise InterpreterException(f'Meson version is {cv} but project requires {pv}')
        mesonlib.project_meson_versions[self.subproject] = kwargs['meson_version']
    if os.path.exists(self.option_file):
        oi = optinterpreter.OptionInterpreter(self.subproject)
        oi.process(self.option_file)
        self.coredata.update_project_options(oi.options)
        self.add_build_def_file(self.option_file)
    self.project_default_options = coredata.create_options_dict(kwargs['default_options'], self.subproject)
    if (self.environment.first_invocation or ((self.subproject != '') and (self.subproject not in self.coredata.initialized_subprojects))):
        default_options = self.project_default_options.copy()
        default_options.update(self.default_project_options)
        self.coredata.init_builtins(self.subproject)
    else:
        default_options = {}
    self.coredata.set_default_options(default_options, self.subproject, self.environment)
    if (not self.is_subproject()):
        self.build.project_name = proj_name
    self.active_projectname = proj_name
    version = kwargs['version']
    if isinstance(version, mesonlib.File):
        FeatureNew.single_use('version from file', '0.57.0', self.subproject, location=node)
        self.add_build_def_file(version)
        ifname = version.absolute_path(self.environment.source_dir, self.environment.build_dir)
        try:
            ver_data = Path(ifname).read_text(encoding='utf-8').split('\n')
        except FileNotFoundError:
            raise InterpreterException('Version file not found.')
        if ((len(ver_data) == 2) and (ver_data[1] == '')):
            ver_data = ver_data[0:1]
        if (len(ver_data) != 1):
            raise InterpreterException('Version file must contain exactly one line of text.')
        self.project_version = ver_data[0]
    else:
        self.project_version = version
    if (self.build.project_version is None):
        self.build.project_version = self.project_version
    proj_license = kwargs['license']
    self.build.dep_manifest[proj_name] = build.DepManifest(self.project_version, proj_license)
    if (self.subproject in self.build.projects):
        raise InvalidCode('Second call to project().')
    spdirname = kwargs['subproject_dir']
    if (not isinstance(spdirname, str)):
        raise InterpreterException('Subproject_dir must be a string')
    if os.path.isabs(spdirname):
        raise InterpreterException('Subproject_dir must not be an absolute path.')
    if spdirname.startswith('.'):
        raise InterpreterException('Subproject_dir must not begin with a period.')
    if ('..' in spdirname):
        raise InterpreterException('Subproject_dir must not contain a ".." segment.')
    if (not self.is_subproject()):
        self.subproject_dir = spdirname
    self.build.subproject_dir = self.subproject_dir
    wrap_mode = self.coredata.get_option(OptionKey('wrap_mode'))
    if ((not self.is_subproject()) or (wrap_mode != WrapMode.nopromote)):
        subdir = os.path.join(self.subdir, spdirname)
        r = wrap.Resolver(self.environment.get_source_dir(), subdir, self.subproject, wrap_mode)
        if self.is_subproject():
            self.environment.wrap_resolver.merge_wraps(r)
        else:
            self.environment.wrap_resolver = r
    self.build.projects[self.subproject] = proj_name
    mlog.log('Project name:', mlog.bold(proj_name))
    mlog.log('Project version:', mlog.bold(self.project_version))
    if (not self.is_subproject()):
        backend = self.coredata.get_option(OptionKey('backend'))
        force_vsenv = (self.user_defined_options.vsenv or backend.startswith('vs'))
        if mesonlib.setup_vsenv(force_vsenv):
            self.build.need_vsenv = True
    self.add_languages(proj_langs, True, MachineChoice.HOST)
    self.add_languages(proj_langs, False, MachineChoice.BUILD)
    self.set_backend()
    if (not self.is_subproject()):
        self.check_stdlibs()
@typed_pos_args('project', str, varargs=str)
@typed_kwargs('project', DEFAULT_OPTIONS, KwargInfo('meson_version', (str, NoneType)), KwargInfo('version', (str, mesonlib.File, NoneType, list), default='undefined', validator=_project_version_validator, convertor=(lambda x: (x[0] if isinstance(x, list) else x))), KwargInfo('license', ContainerTypeInfo(list, str), default=['unknown'], listify=True), KwargInfo('subproject_dir', str, default='subprojects'))
def func_project(self, node: mparser.FunctionNode, args: T.Tuple[(str, T.List[str])], kwargs: 'kwargs.Project') -> None:
    (proj_name, proj_langs) = args
    if (':' in proj_name):
        raise InvalidArguments(f"Project name {proj_name!r} must not contain ':'")
    if kwargs['meson_version']:
        cv = coredata.version
        pv = kwargs['meson_version']
        if (not mesonlib.version_compare(cv, pv)):
            raise InterpreterException(f'Meson version is {cv} but project requires {pv}')
        mesonlib.project_meson_versions[self.subproject] = kwargs['meson_version']
    if os.path.exists(self.option_file):
        oi = optinterpreter.OptionInterpreter(self.subproject)
        oi.process(self.option_file)
        self.coredata.update_project_options(oi.options)
        self.add_build_def_file(self.option_file)
    self.project_default_options = coredata.create_options_dict(kwargs['default_options'], self.subproject)
    if (self.environment.first_invocation or ((self.subproject != ) and (self.subproject not in self.coredata.initialized_subprojects))):
        default_options = self.project_default_options.copy()
        default_options.update(self.default_project_options)
        self.coredata.init_builtins(self.subproject)
    else:
        default_options = {}
    self.coredata.set_default_options(default_options, self.subproject, self.environment)
    if (not self.is_subproject()):
        self.build.project_name = proj_name
    self.active_projectname = proj_name
    version = kwargs['version']
    if isinstance(version, mesonlib.File):
        FeatureNew.single_use('version from file', '0.57.0', self.subproject, location=node)
        self.add_build_def_file(version)
        ifname = version.absolute_path(self.environment.source_dir, self.environment.build_dir)
        try:
            ver_data = Path(ifname).read_text(encoding='utf-8').split('\n')
        except FileNotFoundError:
            raise InterpreterException('Version file not found.')
        if ((len(ver_data) == 2) and (ver_data[1] == )):
            ver_data = ver_data[0:1]
        if (len(ver_data) != 1):
            raise InterpreterException('Version file must contain exactly one line of text.')
        self.project_version = ver_data[0]
    else:
        self.project_version = version
    if (self.build.project_version is None):
        self.build.project_version = self.project_version
    proj_license = kwargs['license']
    self.build.dep_manifest[proj_name] = build.DepManifest(self.project_version, proj_license)
    if (self.subproject in self.build.projects):
        raise InvalidCode('Second call to project().')
    spdirname = kwargs['subproject_dir']
    if (not isinstance(spdirname, str)):
        raise InterpreterException('Subproject_dir must be a string')
    if os.path.isabs(spdirname):
        raise InterpreterException('Subproject_dir must not be an absolute path.')
    if spdirname.startswith('.'):
        raise InterpreterException('Subproject_dir must not begin with a period.')
    if ('..' in spdirname):
        raise InterpreterException('Subproject_dir must not contain a ".." segment.')
    if (not self.is_subproject()):
        self.subproject_dir = spdirname
    self.build.subproject_dir = self.subproject_dir
    wrap_mode = self.coredata.get_option(OptionKey('wrap_mode'))
    if ((not self.is_subproject()) or (wrap_mode != WrapMode.nopromote)):
        subdir = os.path.join(self.subdir, spdirname)
        r = wrap.Resolver(self.environment.get_source_dir(), subdir, self.subproject, wrap_mode)
        if self.is_subproject():
            self.environment.wrap_resolver.merge_wraps(r)
        else:
            self.environment.wrap_resolver = r
    self.build.projects[self.subproject] = proj_name
    mlog.log('Project name:', mlog.bold(proj_name))
    mlog.log('Project version:', mlog.bold(self.project_version))
    if (not self.is_subproject()):
        backend = self.coredata.get_option(OptionKey('backend'))
        force_vsenv = (self.user_defined_options.vsenv or backend.startswith('vs'))
        if mesonlib.setup_vsenv(force_vsenv):
            self.build.need_vsenv = True
    self.add_languages(proj_langs, True, MachineChoice.HOST)
    self.add_languages(proj_langs, False, MachineChoice.BUILD)
    self.set_backend()
    if (not self.is_subproject()):
        self.check_stdlibs()