Пример #1
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
Пример #2
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)
Пример #3
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,
                        build_manager.instance,
                        kwargs)
        self._process_resources(resources)
        self.data['source_encoding'] = source_encoding
        if warnings is not None:
            self.data['warnings'] = var_to_list(warnings)
Пример #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)
Пример #5
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,
                        build_manager.instance,
                        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]
Пример #6
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,
                        build_manager.instance,
                        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]
Пример #7
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
Пример #8
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,
                        build_manager.instance, kwargs)

        self._process_test_data(testdata)
Пример #9
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,
                        build_manager.instance, kwargs)

        self._set_go_package()
        self._init_go_environment()
Пример #10
0
    def __init__(self, name, type, srcs, deps, extra_goflags, kwargs):
        """Init the go target. """
        srcs = var_to_list(srcs)
        deps = var_to_list(deps)
        extra_goflags = ' '.join(var_to_list(extra_goflags))

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

        self._set_go_package()
        self._init_go_environment()
        self.data['extra_goflags'] = extra_goflags
Пример #11
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:
            self.error_exit(
                'Invalid type %s. Types supported by the package are %s' %
                (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
Пример #12
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,
                        build_manager.instance,
                        kwargs)

        self._process_test_data(testdata)
Пример #13
0
    def __init__(self, name, srcs, deps, outs, cmd, cmd_name, generate_hdrs,
                 heavy, 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)
        self.data['cmd_name'] = cmd_name
        if generate_hdrs is not None:
            self.data['generate_hdrs'] = generate_hdrs
        self.data['heavy'] = heavy
Пример #14
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'
Пример #15
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, None, 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 = {}
        self.java_jar_dep_source_list = []
        self.java_classpath_list = []
Пример #16
0
 def __init__(self, name, id, classifier, transitive):
     Target.__init__(self, name, 'maven_jar', [], [], None,
                     build_manager.instance, {})
     self.data['id'] = id
     self.data['classifier'] = classifier
     self.data['transitive'] = transitive
Пример #17
0
 def __init__(self, name, id, classifier, transitive):
     Target.__init__(self, name, 'maven_jar', [], [], None, build_manager.instance, {})
     self.data['id'] = id
     self.data['classifier'] = classifier
     self.data['transitive'] = transitive