コード例 #1
0
    def build(self):
        if not self.ctx.targets or self.ctx.targets == '*':
            digraph = buildconfigutil.get_uor_digraph(self.build_config)
            self.draw_imp(digraph, 'UORs', '__all__')
            return
        elif self.ctx.targets in self.build_config.package_groups:
            group_name = self.ctx.targets
            digraph = buildconfigutil.get_package_digraph(
                self.build_config, group_name)
            self.draw_imp(digraph, group_name, group_name)
            return

        package = None
        if self.ctx.targets in self.build_config.stdalone_packages:
            package = self.build_config.stdalone_packages[self.ctx.targets]
        elif self.ctx.targets in self.build_config.inner_packages:
            package = self.build_config.inner_packages[self.ctx.targets]

        if not package or package.type_ == repounits.PackageType.PACKAGE_PLUS:
            Logs.warn('Graph target must be either empty, '
                      'a package group, or a package that is not '
                      'a + package.')
            return

        digraph = cpreproc.get_component_digraph(
            package, self.ctx.options.use_test_only == 'yes')
        prefix = package.name + '_'

        def remove_prefix(str_):
            if str_.startswith(prefix):
                return str_[len(prefix):]
            return str_

        # Remove prefix
        digraph_new = {}
        for node in digraph:
            digraph_new[remove_prefix(node)] = [
                remove_prefix(c) for c in digraph[node]
            ]

        self.draw_imp(digraph_new, package.name, package.name)
コード例 #2
0
ファイル: graphhelper.py プロジェクト: bloomberg/bde-tools
    def build(self):
        if not self.ctx.targets or self.ctx.targets == '*':
            digraph = buildconfigutil.get_uor_digraph(
                self.build_config)
            self.draw_imp(digraph, 'UORs', '__all__')
            return
        elif self.ctx.targets in self.build_config.package_groups:
            group_name = self.ctx.targets
            digraph = buildconfigutil.get_package_digraph(
                self.build_config, group_name)
            self.draw_imp(digraph, group_name, group_name)
            return

        package = None
        if self.ctx.targets in self.build_config.stdalone_packages:
            package = self.build_config.stdalone_packages[self.ctx.targets]
        elif self.ctx.targets in self.build_config.inner_packages:
            package = self.build_config.inner_packages[self.ctx.targets]

        if not package or package.type_ == repounits.PackageType.PACKAGE_PLUS:
            Logs.warn('Graph target must be either empty, '
                      'a package group, or a package that is not '
                      'a + package.')
            return

        digraph = cpreproc.get_component_digraph(
            package, self.ctx.options.use_test_only == 'yes')
        prefix = package.name + '_'

        def remove_prefix(str_):
            if str_.startswith(prefix):
                return str_[len(prefix):]
            return str_

        # Remove prefix
        digraph_new = {}
        for node in digraph:
            digraph_new[remove_prefix(node)] = [remove_prefix(c) for
                                                c in digraph[node]]

        self.draw_imp(digraph_new, package.name, package.name)
コード例 #3
0
 def verify_packages(self):
     for package in (u for u in self.repo_context.units.values()
                     if u.type_ in repounits.UnitTypeCategory.PACKAGE_CAT):
         logutil.start_msg('Verifying %s' % package.name)
         digraph = cpreproc.get_component_digraph(package, True)
         self._verify_cycles_impl(digraph)
コード例 #4
0
 def verify_packages(self):
     for package in (u for u in self.repo_context.units.values() if
                     u.type_ in repounits.UnitTypeCategory.PACKAGE_CAT):
         logutil.start_msg('Verifying %s' % package.name)
         digraph = cpreproc.get_component_digraph(package, True)
         self._verify_cycles_impl(digraph)