@permittedKwargs(permitted_kwargs['vcs_tag'])
def func_vcs_tag(self, node, args, kwargs):
    if (('input' not in kwargs) or ('output' not in kwargs)):
        raise InterpreterException('Keyword arguments input and output must exist')
    if ('fallback' not in kwargs):
        FeatureNew('Optional fallback in vcs_tag', '0.41.0').use(self.subproject)
    fallback = kwargs.pop('fallback', self.project_version)
    if (not isinstance(fallback, str)):
        raise InterpreterException('Keyword argument fallback must be a string.')
    replace_string = kwargs.pop('replace_string', '@VCS_TAG@')
    regex_selector = '(.*)'
    vcs_cmd = kwargs.get('command', None)
    if (vcs_cmd and (not isinstance(vcs_cmd, list))):
        vcs_cmd = [vcs_cmd]
    source_dir = os.path.normpath(os.path.join(self.environment.get_source_dir(), self.subdir))
    if vcs_cmd:
        vcs_cmd[0] = (shutil.which(vcs_cmd[0]) or os.path.join(source_dir, vcs_cmd[0]))
    else:
        vcs = mesonlib.detect_vcs(source_dir)
        if vcs:
            mlog.log(('Found %s repository at %s' % (vcs['name'], vcs['wc_dir'])))
            vcs_cmd = vcs['get_rev'].split()
            regex_selector = vcs['rev_regex']
        else:
            vcs_cmd = [' ']
    kwargs['command'] = ((self.environment.get_build_command() + ['--internal', 'vcstagger', '@INPUT0@', '@OUTPUT0@', fallback, source_dir, replace_string, regex_selector]) + vcs_cmd)
    kwargs.setdefault('build_by_default', True)
    kwargs.setdefault('build_always_stale', True)
    return self._func_custom_target_impl(node, [kwargs['output']], kwargs)
@permittedKwargs(permitted_kwargs['vcs_tag'])
def func_vcs_tag(self, node, args, kwargs):
    if (('input' not in kwargs) or ('output' not in kwargs)):
        raise InterpreterException('Keyword arguments input and output must exist')
    if ('fallback' not in kwargs):
        FeatureNew('Optional fallback in vcs_tag', '0.41.0').use(self.subproject)
    fallback = kwargs.pop('fallback', self.project_version)
    if (not isinstance(fallback, str)):
        raise InterpreterException('Keyword argument fallback must be a string.')
    replace_string = kwargs.pop('replace_string', '@VCS_TAG@')
    regex_selector = '(.*)'
    vcs_cmd = kwargs.get('command', None)
    if (vcs_cmd and (not isinstance(vcs_cmd, list))):
        vcs_cmd = [vcs_cmd]
    source_dir = os.path.normpath(os.path.join(self.environment.get_source_dir(), self.subdir))
    if vcs_cmd:
        vcs_cmd[0] = (shutil.which(vcs_cmd[0]) or os.path.join(source_dir, vcs_cmd[0]))
    else:
        vcs = mesonlib.detect_vcs(source_dir)
        if vcs:
            mlog.log(('Found %s repository at %s' % (vcs['name'], vcs['wc_dir'])))
            vcs_cmd = vcs['get_rev'].split()
            regex_selector = vcs['rev_regex']
        else:
            vcs_cmd = [' ']
    kwargs['command'] = ((self.environment.get_build_command() + ['--internal', 'vcstagger', '@INPUT0@', '@OUTPUT0@', fallback, source_dir, replace_string, regex_selector]) + vcs_cmd)
    kwargs.setdefault('build_by_default', True)
    kwargs.setdefault('build_always_stale', True)
    return self._func_custom_target_impl(node, [kwargs['output']], kwargs)