示例#1
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        # Change current directory
        c = cfg.get('force', False)
        if c:
            args.append('--force')

        c = make_list(cfg.get('filters'))
        if len(c):
            args.append('--filters="%s"' % ','.join(c))

        c_basedir = cfg.get('basedir', None)
        c = cfg.get('name', None)
        if c and c_basedir is not None:
            args.append('--name="%s"' % c)

        c = make_list(cfg.get('include'))
        for o in c:
            args.append('--include="%s"' % expand_resource(self.group, o))

        c = make_list(cfg.get('exclude'))
        for o in c:
            args.append('--exclude="%s"' % expand_resource(self.group, o))
    def prepare(self):
        cfg = self.conf

        # Encoding of the input file (e.g. utf-8)
        self.encoding = cfg.get('encoding', 'utf-8')

        self.regex_ignores = []

        # Ignore unknown directives
        unknown = make_list(cfg.get('ignore_directives'))
        if len(unknown):
            self.regex_ignores.append(re.compile('^Unknown directive type "(' +\
                    '|'.join(unknown) + ')".*'))

            self.regex_ignores.append(re.compile('^No directive entry for "(' +\
                    '|'.join(unknown) + ')".*'))

        # Ignore unknown roles
        unknown = make_list(cfg.get('ignore_roles'))
        if len(unknown):
            self.regex_ignores.append(re.compile('^Unknown interpreted text ' +\
                    'role "(' + '|'.join(unknown) + ')".*'))

            self.regex_ignores.append(re.compile('^No role entry for "(' +\
                    '|'.join(unknown) + ')".*'))
示例#3
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        # Change current directory
        c = cfg.get('force', False)
        if c:
            args.append('--force')

        c = make_list(cfg.get('filters'))
        if len(c):
            args.append('--filters="%s"' % ','.join(c))

        c_basedir = cfg.get('basedir', None)
        c = cfg.get('name', None)
        if c and c_basedir is not None:
            args.append('--name="%s"' % c)

        c = make_list(cfg.get('include'))
        for o in c:
            args.append('--include="%s"' % expand_resource(self.group, o))

        c = make_list(cfg.get('exclude'))
        for o in c:
            args.append('--exclude="%s"' % expand_resource(self.group, o))
    def prepare(self):
        cfg = self.conf

        # Encoding of the input file (e.g. utf-8)
        self.encoding = cfg.get('encoding', 'utf-8')

        self.regex_ignores = []

        # Ignore unknown directives
        unknown = make_list(cfg.get('ignore_directives'))
        if len(unknown):
            self.regex_ignores.append(re.compile('^Unknown directive type "(' +\
                    '|'.join(unknown) + ')".*'))

            self.regex_ignores.append(re.compile('^No directive entry for "(' +\
                    '|'.join(unknown) + ')".*'))

        # Ignore unknown roles
        unknown = make_list(cfg.get('ignore_roles'))
        if len(unknown):
            self.regex_ignores.append(re.compile('^Unknown interpreted text ' +\
                    'role "(' + '|'.join(unknown) + ')".*'))

            self.regex_ignores.append(re.compile('^No role entry for "(' +\
                    '|'.join(unknown) + ')".*'))
示例#5
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        args.append('--force')

        c = cfg.get('work_dir')
        if c:
            self.workdir = expand_resource(self.group, c)
            if self.workdir is None:
                self.bld.fatal(cfg['work_dir'] + ' not found.')

        output_dir = expand_resource(self.group, cfg['output_dir'])
        if output_dir is None:
            self.bld.fatal(cfg['output_dir'] + ' not found.')
        args.append('-o ' + output_dir)

        project_dir = expand_resource(self.group, cfg['project_dir'])
        if project_dir is None:
            self.bld.fatal(cfg['project_dir'] + ' not found.')
        args.append(project_dir)

        for fname in make_list(cfg.get('exclude')):
            exclude_files = expand_wildcard(self.group, fname)
            if exclude_files is None:
                self.bld.fatal(fname + ' not found.')
            args.extend(exclude_files)
示例#6
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        c = cfg.get('target')
        if c is None:
            self.bld.fatal('"target" is required by %s' % tool_name)
        else:
            self.target = c.format(**self.group.get_patterns())

        c = cfg.get('work_dir')
        if c:
            self.workdir = expand_resource(self.group, c)

        self.add_bool_args('verbose', 'msgs2stderr', 'quiet', 'checksum',
                'archive', 'recursive', 'relative', 'no_implied_dirs', 'backup',
                'update', 'inplace', 'append', 'append_verify', 'dirs', 'links',
                'copy_links', 'copy_unsafe_links', 'safe_links', 'munge_links',
                'copy_dirlinks', 'keep_dirlinks', 'hard_links', 'perms',
                'executability', 'acls', 'xattrs', 'owner', 'group', 'devices',
                'specials', 'times', 'omit_dir_times', 'omit_link_times',
                'super', 'fake_super', 'sparse', 'preallocate', 'dry_run',
                'whole_file', 'one_file_system', 'existing', 'ignore_existing',
                'remove_source_files', 'delete', 'delete_before',
                'delete_during', 'delete_delay', 'delete_after',
                'delete_excluded', 'ignore_missing_args', 'delete_missing_args',
                'ignore-errors', 'force', 'partial', 'delay_updates',
                'prune_empty_dirs', 'numeric_ids', 'ignore_times', 'size_only',
                'fuzzy', 'compress', 'cvs_exclude', 'from0', 'protect_args',
                'blocking_io', 'stats', '8_bit_output', 'human_readable',
                'progress', 'itemize_changes', 'list_only', 'ipv4', 'ipv6')

        self.add_int_args('block_size', 'max_delete', 'max_size', 'min_size',
                'timeout', 'contimeout', 'modify_window', 'compress_level',
                'port', 'bwlimit', 'protocol', 'checksum_seed')

        self.add_list_args_join(',', 'skip_compress')

        self.add_list_args_multi('filter', 'exclude', 'include')

        self.add_path_args('backup_dir', 'exclude_from', 'include_from',
                'files_from', 'password_file', 'read_batch')

        self.add_str_args('info', 'debug', 'suffix', 'chmod', 'rsh',
                'rsync_path', 'partial_dir', 'usermap', 'groupmap', 'chown',
                'remote_option', 'temp_dir', 'compare_dest', 'copy_dest',
                'link_dest', 'address', 'sockopts', 'out_format', 'log_file',
                'log_file_format', 'write_batch', 'only_write_batch', 'iconv')

        c = cfg.get('no_MOTD')
        if c:
            args.append('--no-motd')

        c = make_list(cfg.get('no_OPTION'))
        for option in c:
            args.append('--no-' + option)

        c = cfg.get('outbuf')
        if c:
            args.append('--outbuf=' + c[1].upper())
示例#7
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        args.append('--force')

        c = cfg.get('work_dir')
        if c:
            self.workdir = expand_resource(self.group, c)
            if self.workdir is None:
                self.bld.fatal(cfg['work_dir'] + ' not found.')

        output_dir = expand_resource(self.group, cfg['output_dir'])
        if output_dir is None:
            self.bld.fatal(cfg['output_dir'] + ' not found.')
        args.append('-o ' + output_dir)

        project_dir = expand_resource(self.group, cfg['project_dir'])
        if project_dir is None:
            self.bld.fatal(cfg['project_dir'] + ' not found.')
        args.append(project_dir)

        for fname in make_list(cfg.get('exclude')):
            exclude_files = expand_wildcard(self.group, fname)
            if exclude_files is None:
                self.bld.fatal(fname + ' not found.')
            args.extend(exclude_files)
示例#8
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        # Change current directory, before running pylint, helps module imports
        c = cfg.get('work_dir')
        if c:
            self.workdir = expand_resource(self.group, c)
            if self.workdir is None:
                self.bld.fatal(cfg['work_dir'] + ' not found.')

        # Flags
        c = make_list(cfg.get('flags'))
        if len(c) == 0:
            # see:
            # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=498809;msg=10
            c = [
                '-D__gnuc_va_list=va_list',
                '-warnposix',
                '+forcehints',
                '-formatcode',
                '-compdestroy',
            ]

        for flag in c:
            args.append(flag)
示例#9
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        # Change current directory, before running pylint, helps module imports
        c = cfg.get('work_dir')
        if c:
            self.workdir = expand_resource(self.group, c)
            if self.workdir is None:
                self.bld.fatal(cfg['work_dir'] + ' not found.')

        # Flags
        c = make_list(cfg.get('flags'))
        if len(c) == 0:
            # see:
            # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=498809;msg=10
            c = [
                '-D__gnuc_va_list=va_list',
                '-warnposix',
                '+forcehints',
                '-formatcode',
                '-compdestroy',
            ]

        for flag in c:
            args.append(flag)
示例#10
0
    def prepare(self):
        bld = self.group.context
        cfg = self.conf
        args = self.args

        # Custom configuration file
        if cfg.get('config_file', None):
            args.append("--config='%s'" %
                        bld.path.find_resource(cfg['config_file']).abspath())

        # Custom reporter (<PATH>|jslint|checkstyle)
        if cfg.get('reporter', None):
            args.append('--reporter=%s' % cfg['reporter'])

        # Exclude files matching the given filename pattern
        # (same as .jshintignore)
        exclude_files = make_list(cfg.get('ignore_files'))
        for exclude_file in exclude_files:
            args.append('--exclude=%s' % exclude_file)

        # Pass in custom jshintignore file path
        if cfg.get('ignore_list_file', None):
            args.append(
                "--exclude-path='%s'" %
                bld.path.find_resource(cfg['ignore_list_file']).abspath())
示例#11
0
    def prepare(self):
        cfg = self. conf
        args = self.args

        c = make_list(cfg.get('disable'))
        if len(c):
            invalid_disable_items = set(c) - self.DISABLE_LIST
            if len(invalid_disable_items):
                self.bld.fatal('invalid disable configuration items: ' +\
                        ', '.join(invalid_disable_items))
            args.append('--disable=' + ','.join(c))
示例#12
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        c = cfg.get('amd')
        if c:
            args.append('--amd')

        c = cfg.get('commonjs')
        if c:
            args.append('--commonjs')

        c = cfg.get('handlebarpath')
        if c:
            args.append("--handlebarPath='%s'" % c)

        for handler in make_list(cfg.get('known')):
            args.append("--known='%s'" % handler)

        c = cfg.get('known_only')
        if c:
            args.append('--knownOnly')

        c = cfg.get('minimize')
        if c:
            args.append('--min')

        c = cfg.get('namespace')
        if c:
            args.append("--namespace='%s'" % c)

        c = cfg.get('simple')
        if c:
            args.append('--simple')

        c = cfg.get('root')
        if c:
            args.append("--root='%s'" % c)

        c = cfg.get('partial')
        if c:
            args.append('--partial')

        c = cfg.get('data')
        if c:
            args.append("--data='%s'" % json_dump(c))

        c = cfg.get('extension')
        if c:
            args.append("--extension='%s'" % c)

        c = cfg.get('bom')
        if c:
            args.append('--bom')
示例#13
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        c = cfg.get('amd')
        if c:
            args.append('--amd')

        c = cfg.get('commonjs')
        if c:
            args.append('--commonjs')

        c = cfg.get('handlebarpath')
        if c:
            args.append("--handlebarPath='%s'" % c)

        for handler in make_list(cfg.get('known')):
            args.append("--known='%s'" % handler)

        c = cfg.get('known_only')
        if c:
            args.append('--knownOnly')

        c = cfg.get('minimize')
        if c:
            args.append('--min')

        c = cfg.get('namespace')
        if c:
            args.append("--namespace='%s'" % c)

        c = cfg.get('simple')
        if c:
            args.append('--simple')

        c = cfg.get('root')
        if c:
            args.append("--root='%s'" % c)

        c = cfg.get('partial')
        if c:
            args.append('--partial')

        c = cfg.get('data')
        if c:
            args.append("--data='%s'" % json_dump(c))

        c = cfg.get('extension')
        if c:
            args.append("--extension='%s'" % c)

        c = cfg.get('bom')
        if c:
            args.append('--bom')
示例#14
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        # Change current directory
        c = cfg.get('work_dir')
        if c:
            self.workdir = expand_resource(self.group, c)
            if self.workdir is None:
                self.bld.fatal(cfg['work_dir'] + ' not found.')

        # Output
        c = cfg.get('output')
        if c:
            args.append('--output=' + c)

        # Filters
        c = make_list(cfg.get('filter'))
        if len(c):
            args.append('--filter=' + ','.join(c))

        # Counting
        c = cfg.get('counting')
        if c:
            args.append('--counting=' + c)

        # Root
        c = cfg.get('root_dir')
        if c:
            args.append('--root=' + expand_resource(self.group, c))

        # Line length
        c = cfg.get('line_length')
        if c:
            args.append('--linelength=%i' % c)

        # Extensions
        c = make_list(cfg.get('extensions', ['c', 'cpp', 'h']))
        args.append('--extensions=' + ','.join(c))
示例#15
0
    def prepare(self):
        cfg = self.conf

        types = make_list(cfg.get('font_types', ['ttf']))
        self.print_ttf = 'ttf' in types
        self.print_eot = 'eot' in types
        self.print_woff = 'woff' in types
        self.print_svg = 'svg' in types

        self.dir_url = cfg.get('font_dir_url', '').format(**self.group.\
                get_patterns())

        self.svg_id = cfg.get('font_svg_id')
示例#16
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        # Change current directory, before running pylint, helps module imports
        c = cfg.get('work_dir')
        if c:
            self.workdir = expand_resource(self.group, c)
            if self.workdir is None:
                self.bld.fatal(cfg['work_dir'] + ' not found.')

        # Specify a configuration file
        c = cfg.get('config_file')
        if c:
            args.append("--rcfile='%s'" % expand_resource(self.group, c))

        # Set the output format. Available formats are text,
        # parseable, colorized, msvs (visual studio) and html.
        # You can also give a reporter class, eg
        # mypackage.mymodule.MyReporterClass. [current: text]
        c = cfg.get('reporter', None)
        if c:
            args.append("--output-format='%s'" % c)

        # In error mode, checkers without error messages are
        # disabled and for others, only the ERROR messages are
        # displayed, and no reports are done by default
        c = cfg.get('error_only', False)
        if c:
            args.append('--errors-only')

        # Tells whether to display a full report or only the
        # messages [current: yes]
        c = cfg.get('full_report', False)
        if c:
            args.append('--reports=y')
        else:
            args.append('--reports=n')

        # Plugins
        plugins = make_list(cfg.get('plugins'))
        if len(plugins):
            args.append('--load-plugins=%s' % ','.join(plugins))
示例#17
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        # Change current directory, before running pylint, helps module imports
        c = cfg.get('work_dir')
        if c:
            self.workdir = expand_resource(self.group, c)
            if self.workdir is None:
                self.bld.fatal(cfg['work_dir'] + ' not found.')

        # Specify a configuration file
        c = cfg.get('config_file')
        if c:
            args.append("--rcfile='%s'" % expand_resource(self.group, c))

        # Set the output format. Available formats are text,
        # parseable, colorized, msvs (visual studio) and html.
        # You can also give a reporter class, eg
        # mypackage.mymodule.MyReporterClass. [current: text]
        c = cfg.get('reporter', None)
        if c:
            args.append("--output-format='%s'" % c)

        # In error mode, checkers without error messages are
        # disabled and for others, only the ERROR messages are
        # displayed, and no reports are done by default
        c = cfg.get('error_only', False)
        if c:
            args.append('--errors-only')

        # Tells whether to display a full report or only the
        # messages [current: yes]
        c = cfg.get('full_report', False)
        if c:
            args.append('--reports=y')
        else:
            args.append('--reports=n')

        # Plugins
        plugins = make_list(cfg.get('plugins'))
        if len(plugins):
            args.append('--load-plugins=%s' % ','.join(plugins))
示例#18
0
    def prepare(self):
        bld = self.group.context
        cfg = self.conf
        args = self.args

        # Custom configuration file
        if cfg.get('config_file', None):
            args.append("--config='%s'" % bld.path.find_resource(
                cfg['config_file']).abspath())

        # Custom reporter (<PATH>|jslint|checkstyle)
        if cfg.get('reporter', None):
            args.append('--reporter=%s' % cfg['reporter'])

        # Exclude files matching the given filename pattern
        # (same as .jshintignore)
        exclude_files = make_list(cfg.get('ignore_files'))
        for exclude_file in exclude_files:
            args.append('--exclude=%s' % exclude_file)

        # Pass in custom jshintignore file path
        if cfg.get('ignore_list_file', None):
            args.append("--exclude-path='%s'" % bld.path.find_resource(
                cfg['ignore_list_file']).abspath())
示例#19
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        args.append('--error-exitcode=-1')

        # Change current directory, before running cppcheck
        c = cfg.get('work_dir')
        if c:
            self.workdir = expand_resource(self.group, c)
            if self.workdir is None:
                self.bld.fatal(cfg['work_dir'] + ' not found.')

        # Build dir
        c = cfg.get('build_dir')
        if c:
            args.append('--cppcheck-build-dir=' + expand_resource(self.group,
                    c))

        # Check library
        c = cfg.get('check_library')
        if c:
            args.append('--check-library')

        # Config exclude directory
        for path in make_list(cfg.get('config_exclude')):
            args.append('--config-exclude=' + expand_resource(self.group, path))

        # Config excludes file
        c = cfg.get('config_exclude_file')
        if c:
            args.append('--config-excludes-file=' + expand_resource(self.group,
                    c))

        # Dump
        c = cfg.get('dump')
        if c:
            args.append('--dump')

        # Defines
        for define in make_list(cfg.get('define')):
            args.append('-D' + define)

        # Undefines
        for define in make_list(cfg.get('undefine')):
            args.append('-U' + define)

        # Enable additional checks
        c = make_list(cfg.get('enable_check'))
        if len(c):
            args.append('--enable=' + ','.join(c))

        # Exit code suppressions
        for path in make_list(cfg.get('ignore_files')):
            args.append('--exitcode-suppressions=' + expand_resource(self.group,
                    path))

        # Search directory for include files
        for path in make_list(cfg.get('include_path')):
            args.append('-I ' + expand_resource(self.group, path))

        # Include
        for path in make_list(cfg.get('include')):
            args.append('--include=' + expand_resource(self.group, path))

        # Exclude
        for path in make_list(cfg.get('exclude')):
            args.append('-i ' + expand_resource(self.group, path))

        # Inconclusive, allow false positives
        c = cfg.get('inconclusive')
        if c:
            args.append('--inconclusive')

        # Inline suppression
        c = cfg.get('inline_disable', True)
        if c:
            args.append('--inline-suppr')

        # Parallel
        c = cfg.get('jobs')
        if c:
            args.append('-j %i' % c)

        # Max processor usage
        c = cfg.get('load_average')
        if c:
            args.append('-l %f' % c)

        # Programming language
        c = cfg.get('proglang')
        if c:
            args.append('--language=' + c)

        # Library
        c = cfg.get('library')
        if c:
            args.append('--library=' + expand_resource(self.group, c))

        # Project file
        c = cfg.get('project')
        if c:
            args.append('--project=' + expand_resource(self.group, c))

        # Maximum configs
        c = cfg.get('max_configs')
        if c:
            args.append('--max-configs=%i' % c)

        # Platform
        c = cfg.get('platform')
        if c:
            args.append('--platform=' + c)

        # Quiet
        c = cfg.get('quiet', True)
        if c:
            args.append('--quiet')

        # Relative paths
        c = make_list(cfg.get('relative_paths'))
        if len(c):
            args.append('--relative-paths=' + ';'.join(c))

        # Rule
        c = cfg.get('rule')
        if c:
            args.append("--rule='%s'" % c)

        # Rule file
        c = cfg.get('rule_file')
        if c:
            args.append('--rule-file=' + expand_resource(self.group, c))

        # Standard
        for std in make_list(cfg.get('standard')):
            args.append('--std=' + std)

        # Suppress
        for dis in make_list(cfg.get('disable')):
            args.append('--suppress=' + dis)

        # Suppressions list
        c = cfg.get('disable_file')
        if c:
            args.append('--suppressions-list=' + expand_resource(self.group,
                    c))

        # Template
        c = cfg.get('template')
        if c:
            args.append("--template='%s'" % c)

        # Verbose
        c = cfg.get('verbose')
        if c:
            args.append('--verbose')

        # XML
        c = cfg.get('xml')
        if c:
            args.append('--xml')

        # XML version
        c = cfg.get('xml_version')
        if c:
            args.append('--xml-version=' + c)
示例#20
0
    def prepare(self):
        args = self.args
        conf = self.conf

        for mod in make_list(conf.get('transform_module')):
            args.append("--transform '%s'" % mod)
示例#21
0
    def prepare(self):
        cfg = self.conf
        arg = self.args

        targets = make_list(cfg.get('target'))
        if len(targets):
            arg.append('/target:' + ';'.join(targets))

        properties = make_list(cfg.get('property'))
        if len(properties):
            arg.append('/property:' + ';'.join(properties))

        c = cfg.get('max_cpu_count')
        if c is not None:
            if len(c) == 0:
                arg.append('/maxcpucount')
            else:
                arg.append('/maxcpucount:%i' % int(c))

        c = cfg.get('tools_version')
        if c:
            arg.append('/toolsversion:' + c)

        c = cfg.get('verbosity')
        if c:
            arg.append('/verbosity:' + c)

        params = make_list(cfg.get('console_logger_parameters'))
        if len(params):
            arg.append('/consoleloggerparameters:' + ';'.join(params))

        c = cfg.get('no_console_logger')
        if c:
            arg.append('/noconsolelogger')

        c = cfg.get('file_logger')
        if c:
            arg.append('/fileLogger')

        for n in range(1, 10):
            c = cfg.get('file_logger%i' % n)
            if c:
                arg.append('/fileLogger%i' % n)

        params = make_list(cfg.get('file_logger_parameters'))
        if len(params):
            arg.append('/fileloggerparameters:' + ';'.join(params))

        for n in range(1, 10):
            params = make_list(cfg.get('file_logger_parameters%i' % n))
            if len(params):
                arg.append('/fileloggerparameters%i:%s' % (n, ';'.join(params)))

        loggers = make_list(cfg.get('distributed_logger'))
        for logger in loggers:
            arg.append('/distributedlogger:' + logger)

        c = cfg.get('distributed_file_logger')
        if c:
            arg.append('/distributedFileLogger')

        loggers = make_list(cfg.get('logger'))
        for logger in loggers:
            arg.append('/logger:' + logger)

        c = cfg.get('validate')
        if c is not None:
            if len(c):
                arg.append('/validate:' + c)
            else:
                arg.append('/validate')

        c = make_list(cfg.get('ignore_project_extensions'))
        if c:
            arg.append('/ignoreprojectextensions:' + ';'.join(c))

        c = cfg.get('node_reuse')
        if c is not None:
            if c:
                arg.append('/nodeReuse:true')
            else:
                arg.append('/nodeReuse:false')

        c = cfg.get('preprocess')
        if c:
            arg.append('/preprocess:' + c)

        c = cfg.get('detailed_summary')
        if c:
            arg.append('/detailedsummary')

        files = make_list(cfg.get('response_file'))
        for file_ in files:
            arg.append('@' + file_)

        c = cfg.get('no_auto_response')
        if c:
            arg.append('/noautoresponse')

        c = cfg.get('no_logo')
        if c:
            arg.append('/nologo')
示例#22
0
    def prepare(self):
        cfg = self.conf
        arg = self.args

        c = cfg.get('require_consent')
        if c:
            arg.append('-RequireConsent')

        c = cfg.get('project_to_project_timeout')
        if c:
            arg.append('-Project2ProjectTimeOut')
            arg.append('%i' % int(c))

        c = cfg.get('packages_directory')
        if c:
            arg.append('-PackagesDirectory')
            arg.append(c.format(**self.group.get_patterns()))

        c = cfg.get('solution_directory')
        if c:
            arg.append('-SolutionDirectory')
            arg.append(c.format(**self.group.get_patterns()))

        c = cfg.get('msbuild_version')
        if c:
            arg.append('-MSBuildVersion')
            arg.append('%i' % int(c))

        c = cfg.get('msbuild_path')
        if c:
            path = expand_resource(self.group, c)
            if path is None:
                self.bld.fatal('msbuild_path not found: ' + c)
            arg.append('-MSBuildPath')
            arg.append(path)

        c = cfg.get('recursive')
        if c:
            arg.append('-Recursive')

        sources = make_list(cfg.get('source'))
        for source in sources:
            path = expand_resource(self.group, source)
            if path is None:
                self.bld.fatal('source not found: ' + c)
            arg.append('-Source')
            arg.append(path)

        sources = make_list(cfg.get('fallback_source'))
        for source in sources:
            path = expand_resource(self.group, source)
            if path is None:
                self.bld.fatal('fallback_source not found: ' + c)
            arg.append('-FallbackSource')
            arg.append(path)

        c = cfg.get('no_cache')
        if c:
            arg.append('-NoCache')

        c = cfg.get('direct_download')
        if c:
            arg.append('-DirectDownload')

        c = cfg.get('disable_parallel_processing')
        if c:
            arg.append('-DisableParallelProcessing')

        c = cfg.get('package_save_mode')
        if c:
            arg.append('-PackageSaveMode')
            arg.append(c)

        c = cfg.get('verbosity')
        if c:
            arg.append('-Verbosity')
            arg.append(c)

        c = cfg.get('non_interactive')
        if c:
            arg.append('-NonInteractive')

        c = cfg.get('config_file')
        if c:
            path = expand_resource(self.group, c)
            if path is None:
                self.bld.fatal('config_file not found: ' + c)
            arg.append('-ConfigFile')
            arg.append(path)

        c = cfg.get('force_english_output')
        if c:
            arg.append('-ForceEnglishOutput')
示例#23
0
    def prepare(self):
        cfg = self.conf
        arg = self.args

        targets = make_list(cfg.get('target'))
        if len(targets):
            arg.append('/target:' + ';'.join(targets))

        properties = make_list(cfg.get('property'))
        if len(properties):
            arg.append('/property:' + ';'.join(properties))

        c = cfg.get('max_cpu_count')
        if c is not None:
            if len(c) == 0:
                arg.append('/maxcpucount')
            else:
                arg.append('/maxcpucount:%i' % int(c))

        c = cfg.get('tools_version')
        if c:
            arg.append('/toolsversion:' + c)

        c = cfg.get('verbosity')
        if c:
            arg.append('/verbosity:' + c)

        params = make_list(cfg.get('console_logger_parameters'))
        if len(params):
            arg.append('/consoleloggerparameters:' + ';'.join(params))

        c = cfg.get('no_console_logger')
        if c:
            arg.append('/noconsolelogger')

        c = cfg.get('file_logger')
        if c:
            arg.append('/fileLogger')

        for n in range(1, 10):
            c = cfg.get('file_logger%i' % n)
            if c:
                arg.append('/fileLogger%i' % n)

        params = make_list(cfg.get('file_logger_parameters'))
        if len(params):
            arg.append('/fileloggerparameters:' + ';'.join(params))

        for n in range(1, 10):
            params = make_list(cfg.get('file_logger_parameters%i' % n))
            if len(params):
                arg.append('/fileloggerparameters%i:%s' %
                           (n, ';'.join(params)))

        loggers = make_list(cfg.get('distributed_logger'))
        for logger in loggers:
            arg.append('/distributedlogger:' + logger)

        c = cfg.get('distributed_file_logger')
        if c:
            arg.append('/distributedFileLogger')

        loggers = make_list(cfg.get('logger'))
        for logger in loggers:
            arg.append('/logger:' + logger)

        c = cfg.get('validate')
        if c is not None:
            if len(c):
                arg.append('/validate:' + c)
            else:
                arg.append('/validate')

        c = make_list(cfg.get('ignore_project_extensions'))
        if c:
            arg.append('/ignoreprojectextensions:' + ';'.join(c))

        c = cfg.get('node_reuse')
        if c is not None:
            if c:
                arg.append('/nodeReuse:true')
            else:
                arg.append('/nodeReuse:false')

        c = cfg.get('preprocess')
        if c:
            arg.append('/preprocess:' + c)

        c = cfg.get('detailed_summary')
        if c:
            arg.append('/detailedsummary')

        files = make_list(cfg.get('response_file'))
        for file_ in files:
            arg.append('@' + file_)

        c = cfg.get('no_auto_response')
        if c:
            arg.append('/noautoresponse')

        c = cfg.get('no_logo')
        if c:
            arg.append('/nologo')
示例#24
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        c = cfg.get('target')
        if c is None:
            self.bld.fatal('"target" is required by %s' % tool_name)
        else:
            self.target = c.format(**self.group.get_patterns())

        c = cfg.get('work_dir')
        if c:
            self.workdir = expand_resource(self.group, c)

        self.add_bool_args(
            'verbose', 'msgs2stderr', 'quiet', 'checksum', 'archive',
            'recursive', 'relative', 'no_implied_dirs', 'backup', 'update',
            'inplace', 'append', 'append_verify', 'dirs', 'links',
            'copy_links', 'copy_unsafe_links', 'safe_links', 'munge_links',
            'copy_dirlinks', 'keep_dirlinks', 'hard_links', 'perms',
            'executability', 'acls', 'xattrs', 'owner', 'group', 'devices',
            'specials', 'times', 'omit_dir_times', 'omit_link_times', 'super',
            'fake_super', 'sparse', 'preallocate', 'dry_run', 'whole_file',
            'one_file_system', 'existing', 'ignore_existing',
            'remove_source_files', 'delete', 'delete_before', 'delete_during',
            'delete_delay', 'delete_after', 'delete_excluded',
            'ignore_missing_args', 'delete_missing_args', 'ignore-errors',
            'force', 'partial', 'delay_updates', 'prune_empty_dirs',
            'numeric_ids', 'ignore_times', 'size_only', 'fuzzy', 'compress',
            'cvs_exclude', 'from0', 'protect_args', 'blocking_io', 'stats',
            '8_bit_output', 'human_readable', 'progress', 'itemize_changes',
            'list_only', 'ipv4', 'ipv6')

        self.add_int_args('block_size', 'max_delete', 'max_size', 'min_size',
                          'timeout', 'contimeout', 'modify_window',
                          'compress_level', 'port', 'bwlimit', 'protocol',
                          'checksum_seed')

        self.add_list_args_join(',', 'skip_compress')

        self.add_list_args_multi('filter', 'exclude', 'include')

        self.add_path_args('backup_dir', 'exclude_from', 'include_from',
                           'files_from', 'password_file', 'read_batch')

        self.add_str_args('info', 'debug', 'suffix', 'chmod', 'rsh',
                          'rsync_path', 'partial_dir', 'usermap', 'groupmap',
                          'chown', 'remote_option', 'temp_dir', 'compare_dest',
                          'copy_dest', 'link_dest', 'address', 'sockopts',
                          'out_format', 'log_file', 'log_file_format',
                          'write_batch', 'only_write_batch', 'iconv')

        c = cfg.get('no_MOTD')
        if c:
            args.append('--no-motd')

        c = make_list(cfg.get('no_OPTION'))
        for option in c:
            args.append('--no-' + option)

        c = cfg.get('outbuf')
        if c:
            args.append('--outbuf=' + c[1].upper())
示例#25
0
    def prepare(self):
        c = self.conf.get('module')
        if c is None:
            self.bld.fatal('"module" option in required')
        elif os.path.sep in c:
            c = expand_resource(self.bld, c)
            dirname, basename = os.path.split(c)
            modulename, extname = os.path.splitext(basename)
            assert extname == '.py'
            self.args.append(('module_path', dirname))
            self.args.append(('module_name', modulename))
        else:
            self.args.append(('module_name', c))

        c = self.conf.get('args')
        if c:
            assert isinstance(c, dict)
            self.args.append(('complex_args', c))

        c = self.conf.get('free_form')
        if c:
            self.args.append(('module_args', c))

        c = self.conf.get('forks')
        if c:
            try:
                c = int(c)
            except ValueError:
                self.bld.fatal('"forks" option must be numeral')
            self.args.append(('forks', c))

        c = self.conf.get('connect_timeout')
        if c:
            try:
                c = int(c)
            except ValueError:
                self.bld.fatal('"timeout" option must be numeral')
            self.args.append(('timeout', c))

        c = self.conf.get('hosts_pattern', '*')
        self.args.append(('pattern', c))

        c = make_list(self.conf.get('hosts'))
        if c:
            self.args.append(('run_hosts', c))

        # do not run async
        self.args.append(('background', 0))

        ## context

        # Yaml context
        c = self.conf.get('context_yaml')
        if c:
            yaml_file = expand_resource(self.group, c)
            if yaml_file is None:
                self.bld.fatal('"context_yaml" for %s has invalid value' %\
                        tool_name.capitalize())
            with open(yaml_file, 'r') as f:
                self.context.update(yaml_load(f))

        # Python context
        c = self.conf.get('context_python')
        if c:
            python_file = expand_resource(self.group, c)
            if python_file is None:
                self.bld.fatal('"context_python" for %s has invalid value' %\
                        tool_name.capitalize())
            dirname, filename = os.path.split(python_file)
            filebase, _ = os.path.splitext(filename)
            if os.path.exists(os.path.join(dirname, '__init__.py')):
                sys.path.append(dirname)
                mod = __import__(filebase)
            else:
                try:
                    from importlib.machinery import SourceFileLoader
                    mod = SourceFileLoader('context_python',
                                           python_file).load_module()
                except ImportError:
                    import imp
                    mod = imp.load_source('context_python', python_file)
                python_export = mod.export
            self.context.update(python_export)

        self.context.update(self.conf.get('context', {}))
        self.args.append(('play_vars', self.context))

        # with_items
        c = self.conf.get('with_items')
        if isinstance(c, list):
            wi = list(c)
        elif c:
            c = c.split('.')
            wi_ctx = self.context
            for wi_idx in c:
                wi = wi_ctx[wi_idx]
            wi = make_list(wi, nodict=True)
        else:
            wi = []

        for wi_item in wi:
            if isinstance(wi_item, dict):
                self.items.append(wi_item)
            else:
                self.items.append({'item': wi_item})
示例#26
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        # Set parallelization
        c = cfg.get('parallel')
        if c is not None:
            args.append('-parallel')
            args.append(c)

        # Maximum thread count
        c = cfg.get('max_threads')
        if c is not None:
            args.append('-maxthreads')
            args.append(c)

        # Shadow copy
        c = cfg.get('no_shadow')
        if c:
            args.append('-noshadow')

        # TeamCity mode
        c = cfg.get('teamcity')
        if c:
            args.append('-teamcity')

        # AppVeyor CI mode
        c = cfg.get('appveyor')
        if c:
            args.append('-appveyor')

        # No logo
        c = cfg.get('no_logo')
        if c:
            args.append('-nologo')

        # Quiet
        c = cfg.get('quiet')
        if c:
            args.append('-quiet')

        # Serialize
        c = cfg.get('serialize')
        if c:
            args.append('-serialize')

        # Trait
        c = cfg.get('traits', {})
        for key, value in c.items():
            args.append('-trait')
            args.append('%s=%s' % (key, value))

        # No trait
        c = cfg.get('no_traits', {})
        for key, value in c.items():
            args.append('-notrait')
            args.append('%s=%s' % (key, value))

        # Methods
        for method in make_list(cfg.get('methods')):
            args.append('-method')
            args.append(method)

        # Classes
        for cls in make_list(cfg.get('classes')):
            args.append('-class')
            args.append(cls)

        # Reports
        c = cfg.get('reports', {})
        for key, value in c.items():
            if key not in ('xml', 'xmlvi', 'nunit', 'html'):
                self.bld.fatal('Unknown xunit report style: %s.' % key)

            args.append('-' + key)
            args.append(os.path.realpath(expand_wildcard(self.group, value)))
示例#27
0
    def prepare(self):
        cfg = self.conf
        args = self.args

        # Set parallelization
        c = cfg.get('parallel')
        if c is not None:
            args.append('-parallel')
            args.append(c)

        # Maximum thread count
        c = cfg.get('max_threads')
        if c is not None:
            args.append('-maxthreads')
            args.append(c)

        # Shadow copy
        c = cfg.get('no_shadow')
        if c:
            args.append('-noshadow')

        # TeamCity mode
        c = cfg.get('teamcity')
        if c:
            args.append('-teamcity')

        # AppVeyor CI mode
        c = cfg.get('appveyor')
        if c:
            args.append('-appveyor')

        # No logo
        c = cfg.get('no_logo')
        if c:
            args.append('-nologo')

        # Quiet
        c = cfg.get('quiet')
        if c:
            args.append('-quiet')

        # Serialize
        c = cfg.get('serialize')
        if c:
            args.append('-serialize')

        # Trait
        c = cfg.get('traits', {})
        for key, value in c.items():
            args.append('-trait')
            args.append('%s=%s' % (key, value))

        # No trait
        c = cfg.get('no_traits', {})
        for key, value in c.items():
            args.append('-notrait')
            args.append('%s=%s' % (key, value))

        # Methods
        for method in make_list(cfg.get('methods')):
            args.append('-method')
            args.append(method)

        # Classes
        for cls in make_list(cfg.get('classes')):
            args.append('-class')
            args.append(cls)

        # Reports
        c = cfg.get('reports', {})
        for key, value in c.items():
            if key not in ('xml', 'xmlvi', 'nunit', 'html'):
                self.bld.fatal('Unknown xunit report style: %s.' % key)

            args.append('-' + key)
            args.append(os.path.realpath(expand_wildcard(self.group, value)))