예제 #1
0
            #if not checker.has_errors():
            from_proj = parser.get_assembly_name()
            to_proj = None
            for to_proj in IndividualModuleResolver().calc_resolved_modules(from_proj, parser.get_project_references()):
                print "%s,%s,PR" % (from_proj, to_proj)
            for to_proj in parser.get_assembly_references():
                print "%s,%s,AR" % (from_proj, to_proj)
            if to_proj == None:                        
                print "%s,None,None" % (from_proj)
                self.__logger.info("Assembly %s has no references (project file %s)" % (from_proj, filename))
                    
            print list(parser.get_source_files())
        except ExpatError, exc:
            self.__logger.error("Unparsable file %s: %s" % (filename, exc))
            
    def parse_files(self, filenames):
        for filename in filenames:
            self.parse_file(filename)

if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    configurator = Configurator()
    configurator.default()
    cs_proj_processor = configurator.create_instance(CSProjProcessor)
    if len(sys.argv) > 1:
        logging.info("Processing %i files to process specified as cmdline arguments" % (len(sys.argv)-1))
        cs_proj_processor.parse_files(sys.argv[1:])
    else:
        logging.info("Reading list of files to process from stdin")
        cs_proj_processor.parse_files(x.strip() for x in sys.stdin)
예제 #2
0
def main(show_combined_graph):
    logging.basicConfig(stream=sys.stderr, level=logging.INFO)
    configurator = Configurator()
    configurator.default()

    dependency_filter_config_class = Configurator().get_concrete_adapter(
        DependencyFilterConfiguration)
    dep_filter_config = dependency_filter_config_class()
    file_to_module_map_supply = OnTheFlyHeaderExceptionOnlyFileToModuleMapSupply(
    )

    link_deps_supply = OnTheFlyModuleLinkDepsSupply(dep_filter_config)

    link_deps_graph = link_deps_supply.get_module_link_deps_graph()
    full_include_graph = OnTheFlyModuleIncludeDepsSupply(
        outputter_config=NullDependencyFilterConfiguration(),
        file_to_module_map_supply=file_to_module_map_supply
    ).get_module_include_deps_graph()
    module_grouper = config_module_grouper(
        modules=full_include_graph.node_names())

    include_deps_graph = DependencyFilterHelper.filter_graph(
        dependency_filter_configuration=dep_filter_config,
        graph=full_include_graph)
    ec = ConsistencyChecker(
        link_deps_graph,
        include_deps_graph,
        node_group_conf=config_node_group_conf(module_grouper))

    report_filename = os.path.join(config_basic.get_results_directory(),
                                   "IncludeDeps",
                                   "include_link_dep_consistency_report.txt")
    report_output = configurator.create_instance(
        cls=ConsistencyCheckerReportOutputter,
        file_to_module_map_supply=file_to_module_map_supply,
        module_grouper=module_grouper,
        report_filename=report_filename)
    report_output.print_all(
        missing_link_deps_graph=ec.get_missing_link_deps_graph(),
        irregular_link_deps_graph=ec.get_irregular_link_deps_graph())

    IncludeDepsGraphOutputter(
        module_grouper=module_grouper).output_include_deps_graph(
            ec.get_module_include_deps_graph())

    result_output = configurator.create_instance(
        cls=ConsistencyCheckerGraphOutputter,
        file_to_module_map_supply=file_to_module_map_supply,
        module_grouper=module_grouper)

    result_output.output_combined_graph(
        show_combined_graph,
        ec.get_combined_graph(),
        ec.get_overview_combined_graph(),
    )

    if '--focus_on_each_group' in sys.argv:
        PerGroupOutputter.output_focus_on_each_group(
            module_grouper=module_grouper,
            full_graph=full_include_graph,
            base_name=FileModuleIncludeDepsSupply(
            ).get_module_include_deps_basename(),
            base_description=IncludeDepsGraphOutputter.BASE_DESCRIPTION,
            dependency_filter_config_class=dependency_filter_config_class)
예제 #3
0
            for to_proj in parser.get_assembly_references():
                print "%s,%s,AR" % (from_proj, to_proj)
            if to_proj == None:
                print "%s,None,None" % (from_proj)
                self.__logger.info(
                    "Assembly %s has no references (project file %s)" %
                    (from_proj, filename))

            print list(parser.get_source_files())
        except ExpatError, exc:
            self.__logger.error("Unparsable file %s: %s" % (filename, exc))

    def parse_files(self, filenames):
        for filename in filenames:
            self.parse_file(filename)


if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    configurator = Configurator()
    configurator.default()
    vcxproj_processor = configurator.create_instance(VCXProjProcessor)
    if len(sys.argv) > 1:
        logging.info(
            "Processing %i files to process specified as cmdline arguments" %
            (len(sys.argv) - 1))
        vcxproj_processor.parse_files(sys.argv[1:])
    else:
        logging.info("Reading list of files to process from stdin")
        vcxproj_processor.parse_files(x.strip() for x in sys.stdin)