Exemplo n.º 1
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 prebuilt,
                 blade,
                 kwargs):
        """Init method.

        Init the java jar target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self,
                        name,
                        'java_jar',
                        srcs,
                        deps,
                        blade,
                        kwargs)

        if prebuilt:
            self.data['type'] = 'prebuilt_java_jar'
        self.java_jar_cmd_list = []
        self.cmd_var_list = []
        self.java_jar_after_dep_source_list = []
        self.targets_dependency_map = {}
        self.java_jar_dep_vars = {}
        self.java_jars_map = self.blade.get_java_jars_map()
        self.sources_dependency_map = self.blade.get_sources_explict_dependency_map()
Exemplo n.º 2
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 type,
                 out,
                 shell,
                 blade,
                 kwargs):
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self,
                        name,
                        'package',
                        [],
                        deps,
                        None,
                        blade,
                        kwargs)

        if type not in _package_types:
            console.error_exit('%s: Invalid type %s. Types supported '
                               'by the package are %s' % (
                               self.fullname, type, ', '.join(sorted(_package_types))))
        self.data['type'] = type
        self.data['sources'], self.data['locations'] = [], []
        self._process_srcs(srcs)

        if not out:
            out = '%s.%s' % (name, type)
        self.data['out'] = out
        self.data['shell'] = shell
Exemplo n.º 3
0
    def __init__(self, name, target_type, srcs, deps, warning, defs, incs,
                 export_incs, optimize, extra_cppflags, extra_linkflags, blade,
                 kwargs):
        """Init method.

        Init the cc target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        defs = var_to_list(defs)
        incs = var_to_list(incs)
        export_incs = var_to_list(export_incs)
        opt = var_to_list(optimize)
        extra_cppflags = var_to_list(extra_cppflags)
        extra_linkflags = var_to_list(extra_linkflags)

        Target.__init__(self, name, target_type, srcs, deps, blade, kwargs)

        self.data['warning'] = warning
        self.data['defs'] = defs
        self.data['incs'] = incs
        self.data['export_incs'] = export_incs
        self.data['optimize'] = opt
        self.data['extra_cppflags'] = extra_cppflags
        self.data['extra_linkflags'] = extra_linkflags

        self._check_defs()
        self._check_incorrect_no_warning()
Exemplo n.º 4
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 outs,
                 cmd,
                 blade,
                 kwargs):
        """Init method.

        Init the gen rule target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        outs = var_to_list(outs)

        Target.__init__(self,
                        name,
                        'gen_rule',
                        srcs,
                        deps,
                        None,
                        blade,
                        kwargs)

        self.data['outs'] = outs
        self.data['locations'] = []
        self.data['cmd'] = location_re.sub(self._process_location_reference, cmd)
Exemplo n.º 5
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 outs,
                 cmd,
                 blade,
                 kwargs):
        """Init method.

        Init the gen rule target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        outs = var_to_list(outs)

        Target.__init__(self,
                        name,
                        'gen_rule',
                        srcs,
                        deps,
                        blade,
                        kwargs)

        self.data['outs'] = outs
        self.data['cmd'] = cmd
Exemplo n.º 6
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 prebuilt,
                 blade,
                 kwargs):
        """Init method.

        Init the java jar target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self,
                        name,
                        'java_jar',
                        srcs,
                        deps,
                        blade,
                        kwargs)

        if prebuilt:
            self.data['type'] = 'prebuilt_java_jar'
        self.java_jar_cmd_list = []
        self.cmd_var_list = []
        self.java_jar_after_dep_source_list = []
        self.targets_dependency_map = {}
        self.java_jar_dep_vars = {}
        self.java_jars_map = self.blade.get_java_jars_map()
        self.sources_dependency_map = self.blade.get_sources_explict_dependency_map()
Exemplo n.º 7
0
    def __init__(self,
                 name,
                 type,
                 srcs,
                 deps,
                 resources,
                 source_encoding,
                 warnings,
                 kwargs):
        """Init method.

        Init the java jar target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        resources = var_to_list(resources)

        Target.__init__(self,
                        name,
                        type,
                        srcs,
                        deps,
                        None,
                        blade.blade,
                        kwargs)
        self._process_resources(resources)
        self.data['source_encoding'] = source_encoding
        if warnings is not None:
            self.data['warnings'] = var_to_list(warnings)
Exemplo n.º 8
0
    def __init__(self,
                 name,
                 type,
                 srcs,
                 deps,
                 base,
                 visibility,
                 kwargs):
        """Init method. """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self,
                        name,
                        type,
                        srcs,
                        deps,
                        visibility,
                        blade.blade,
                        kwargs)

        if base:
            if not base.startswith('//'):
                console.error_exit('%s: Invalid base directory %s. Option base should '
                                   'be a directory starting with \'//\' from BLADE_ROOT directory.' %
                                   (self.fullname, base))
            self.data['python_base'] = base[2:]
        self.data['python_sources'] = [self._source_file_path(s) for s in srcs]
Exemplo n.º 9
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 prebuilt,
                 blade,
                 kwargs):
        """Init method.

        Init the java jar target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self,
                        name,
                        'java_jar',
                        srcs,
                        deps,
                        blade,
                        kwargs)

        if prebuilt:
            self.type = 'prebuilt_java_jar'
            self.data['jar_class_path'] = self._prebuilt_java_jar_src_path()
        self.data['java_jars'] = []
        self.java_jar_cmd_list = []
        self.cmd_var_list = []
        self.java_jar_after_dep_source_list = []
        self.targets_dependency_map = {}
        self.java_jar_dep_vars = {}
Exemplo n.º 10
0
    def __init__(self,
                 name,
                 target_type,
                 srcs,
                 deps,
                 warning,
                 defs,
                 incs,
                 export_incs,
                 optimize,
                 extra_cppflags,
                 extra_linkflags,
                 blade,
                 kwargs):
        """Init method.

        Init the cc target.

        """
        srcs_list = var_to_list(srcs)
        srcs = []
        for item in srcs_list:
            if (';' in item):
                # file list expanded with asterisk wildcard
                file_name_array = string.split(item, ';')
                for file_name in file_name_array:
                    srcs.append(file_name)
            else:
                srcs.append(item)
        deps = var_to_list(deps)
        defs = var_to_list(defs)
        incs = var_to_list(incs)
        export_incs = var_to_list(export_incs)
        opt = var_to_list(optimize)
        extra_cppflags = var_to_list(extra_cppflags)
        extra_linkflags = var_to_list(extra_linkflags)

        Target.__init__(self,
                        name,
                        target_type,
                        srcs,
                        deps,
                        blade,
                        kwargs)

        self.data['warning'] = warning
        self.data['defs'] = defs
        # add by zxy([email protected]) 20140929 support absolute include path (/common/gsl/include)
        for index, item in enumerate(incs):
            if (item.startswith('/')):
                incs[index] = find_relative_path(self.path, item)
        #end
        self.data['incs'] = incs
        self.data['export_incs'] = export_incs
        self.data['optimize'] = opt
        self.data['extra_cppflags'] = extra_cppflags
        self.data['extra_linkflags'] = extra_linkflags

        self._check_defs()
        self._check_incorrect_no_warning()
Exemplo n.º 11
0
    def __init__(self,
                 name,
                 type,
                 srcs,
                 deps,
                 resources,
                 source_encoding,
                 warnings,
                 kwargs):
        """Init method.

        Init the java jar target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        resources = var_to_list(resources)

        Target.__init__(self,
                        name,
                        type,
                        srcs,
                        deps,
                        None,
                        blade.blade,
                        kwargs)
        self._process_resources(resources)
        self.data['source_encoding'] = source_encoding
        if warnings is not None:
            self.data['warnings'] = var_to_list(warnings)
Exemplo n.º 12
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 type,
                 out,
                 blade,
                 kwargs):
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self,
                        name,
                        'package',
                        [],
                        deps,
                        None,
                        blade,
                        kwargs)

        if type not in _package_types:
            console.error_exit('%s: Invalid type %s. Types supported '
                               'by the package are %s' % (
                               self.fullname, type, ', '.join(sorted(_package_types))))
        self.data['type'] = type
        self.data['sources'], self.data['locations'] = [], []
        self._process_srcs(srcs)

        if not out:
            out = '%s.%s' % (name, type)
        self.data['out'] = out
Exemplo n.º 13
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 outs,
                 cmd,
                 blade,
                 kwargs):
        """Init method.

        Init the gen rule target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        outs = var_to_list(outs)

        Target.__init__(self,
                        name,
                        'gen_rule',
                        srcs,
                        deps,
                        None,
                        blade,
                        kwargs)

        self.data['outs'] = outs
        self.data['locations'] = []
        self.data['cmd'] = location_re.sub(self._process_location_reference, cmd)
Exemplo n.º 14
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 outs,
                 cmd,
                 blade,
                 kwargs):
        """Init method.

        Init the gen rule target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        outs = var_to_list(outs)

        Target.__init__(self,
                        name,
                        'gen_rule',
                        srcs,
                        deps,
                        blade,
                        kwargs)

        self.data['outs'] = outs
        self.data['cmd'] = cmd
Exemplo n.º 15
0
Arquivo: file.py Projeto: jaredly/pbj
 def __init__(self, fname, *args, **kwargs):
     self.pass_filename = kwargs.get('pass_filename', False)
     if 'pass_filename' in kwargs:
         del kwargs['pass_filename']
     Target.__init__(self, *args, **kwargs)
     if self.pass_filename:
         self.passes = 1
     self.filename = fname
Exemplo n.º 16
0
    def __init__(self, name, srcs, deps, prebuilt, blade, kwargs):
        """Init method. """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self, name, 'py_binary', srcs, deps, blade, kwargs)

        if prebuilt:
            self.data['type'] = 'prebuilt_py_binary'
Exemplo n.º 17
0
    def __init__(self, name, srcs, deps, testdata, kwargs):
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        testdata = var_to_list(testdata)

        Target.__init__(self, name, 'sh_test', srcs, deps, None, blade.blade,
                        kwargs)

        self._process_test_data(testdata)
Exemplo n.º 18
0
    def __init__(self, name, srcs, deps, prebuilt, blade, kwargs):
        """Init method. """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self, name, 'py_egg', srcs, deps, None, blade, kwargs)

        if prebuilt:
            self.type = 'prebuilt_py_egg'
Exemplo n.º 19
0
    def __init__(self, name, type, srcs, deps, prebuilt, blade, kwargs):
        """Init method.

        Init the java jar target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self, name, type, srcs, deps, blade, kwargs)
Exemplo n.º 20
0
    def __init__(self, name, type, srcs, deps, kwargs):
        """Init the go target. """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self, name, type, srcs, deps, None, blade.blade,
                        kwargs)

        self._set_go_package()
        self._init_go_environment()
Exemplo n.º 21
0
    def __init__(self, name, srcs, deps, prebuilt, blade, kwargs):
        """Init method. """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self, name, 'py_binary', srcs, deps, blade, kwargs)

        self.blade = blade
        options = blade.get_options()
        setattr(options, 'generate_dynamic', True)

        if prebuilt:
            self.type = 'prebuilt_py_binary'
Exemplo n.º 22
0
    def __init__(self,
                 name,
                 target_type,
                 srcs,
                 deps,
                 warning,
                 defs,
                 incs,
                 export_incs,
                 optimize,
                 extra_cppflags,
                 extra_linkflags,
                 install_dir,
                 extra_cmds,
                 blade,
                 kwargs):
        """Init method.

        Init the cc target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        defs = var_to_list(defs)
        incs = var_to_list(incs)
        export_incs = var_to_list(export_incs)
        opt = var_to_list(optimize)
        extra_cppflags = var_to_list(extra_cppflags)
        extra_linkflags = var_to_list(extra_linkflags)
        extra_cmds = var_to_list(extra_cmds)
        
        Target.__init__(self,
                        name,
                        target_type,
                        srcs,
                        deps,
                        blade,
                        kwargs)

        self.data['warning'] = warning
        self.data['defs'] = defs
        self.data['incs'] = incs
        self.data['export_incs'] = export_incs
        self.data['optimize'] = opt
        self.data['extra_cppflags'] = extra_cppflags
        self.data['extra_linkflags'] = extra_linkflags
        self.data['install_dir'] = install_dir
        self.data['extra_cmds'] = extra_cmds

        self._check_defs()
        self._check_incorrect_no_warning()
Exemplo n.º 23
0
    def __init__(self, name, type, srcs, deps, base, visibility, kwargs):
        """Init method. """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self, name, type, srcs, deps, visibility, blade.blade,
                        kwargs)

        if base:
            if not base.startswith('//'):
                console.error_exit(
                    '%s: Invalid base directory %s. Option base should '
                    'be a directory starting with \'//\' from BLADE_ROOT directory.'
                    % (self.fullname, base))
            self.data['python_base'] = base[2:]
        self.data['python_sources'] = [self._source_file_path(s) for s in srcs]
Exemplo n.º 24
0
    def __init__(self, name, type, srcs, deps, resources, source_encoding,
                 warnings, kwargs):
        """Init method.

        Init the scala target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        resources = var_to_list(resources)

        Target.__init__(self, name, type, srcs, deps, None,
                        build_manager.instance, kwargs)
        self._process_resources(resources)
        if source_encoding:
            self.data['source_encoding'] = source_encoding
        if warnings:
            self.data['warnings'] = warnings
Exemplo n.º 25
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 testdata,
                 kwargs):
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        testdata = var_to_list(testdata)

        Target.__init__(self,
                        name,
                        'sh_test',
                        srcs,
                        deps,
                        None,
                        blade.blade,
                        kwargs)

        self._process_test_data(testdata)
Exemplo n.º 26
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 prebuilt,
                 blade,
                 kwargs):
        """Init method. """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self,
                        name,
                        'py_binary',
                        srcs,
                        deps,
                        blade,
                        kwargs)

        if prebuilt:
            self.data['type'] = 'prebuilt_py_binary'
Exemplo n.º 27
0
    def __init__(self,
                 name,
                 type,
                 srcs,
                 deps,
                 kwargs):
        """Init the go target. """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self,
                        name,
                        type,
                        srcs,
                        deps,
                        None,
                        blade.blade,
                        kwargs)

        self._set_go_package()
        self._init_go_environment()
Exemplo n.º 28
0
    def __init__(self,
                 name,
                 srcs,
                 deps,
                 prebuilt,
                 blade,
                 kwargs):
        """Init method. """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self,
                        name,
                        'py_egg',
                        srcs,
                        deps,
                        None,
                        blade,
                        kwargs)

        if prebuilt:
            self.type = 'prebuilt_py_egg'
Exemplo n.º 29
0
    def __init__(self,
                 name,
                 type,
                 srcs,
                 deps,
                 prebuilt,
                 blade,
                 kwargs):
        """Init method.

        Init the java jar target.

        """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)

        Target.__init__(self,
                        name,
                        type,
                        srcs,
                        deps,
                        blade,
                        kwargs)
Exemplo n.º 30
0
 def __init__(self, name, command, shell=False, echo=True, cwd=None, **kwargs):
     Target.__init__(self, name, **kwargs)
     self.command = command
     self.cwd = cwd
     self.echo = echo
     self.shell = shell
Exemplo n.º 31
0
Arquivo: multi.py Projeto: jaredly/pbj
 def __init__(self, name, depends, help=''):
     Target.__init__(self, name, depends=depends, help=help)
Exemplo n.º 32
0
Arquivo: clean.py Projeto: jaredly/pbj
 def __init__(self, *files, **kwargs):
     if not files:
         raise ConfigurationError('You must specify at least one file to clean')
     self.keep = kwargs.pop('keep', [])
     Target.__init__(self, 'clean', **kwargs)
     self.files = files
Exemplo n.º 33
0
 def __init__(self, name, id, classifier, transitive):
     Target.__init__(self, name, 'maven_jar', [], [], None, blade.blade, {})
     self.data['id'] = id
     self.data['classifier'] = classifier
     self.data['transitive'] = transitive
Exemplo n.º 34
0
 def __init__(self, name, id, classifier, transitive):
     Target.__init__(self, name, 'maven_jar', [], [], None, blade.blade, {})
     self.data['id'] = id
     self.data['classifier'] = classifier
     self.data['transitive'] = transitive