Exemple #1
0
        public void Execute()
        {
            DetermineClassDeps  dcd = new DetermineClassDeps();
            TypeDependencyGraph tdg = new TypeDependencyGraph(false);

            dcd.AssemblyFile      = AssemblyFileName;
            dcd.IgnoreOutsideRefs = false;
            dcd.Execute();
            tdg.LoadClassDependencies(dcd, true);
            this._graph = tdg.CondenseGraph();

            WritePDBasXML pdbxmlWritterTask = new WritePDBasXML();

            pdbxmlWritterTask.AssemblyName = new TaskItem(this.AssemblyFileName);

            if (pdbxmlWritterTask.Execute())
            {
                this._pDBDataFile = pdbxmlWritterTask.PDBAsXmlFile.ItemSpec;
                pdbXPathDoc       = new XPathDocument(PDBDataFile);
                pdbNav            = pdbXPathDoc.CreateNavigator();
            }



            Directory.CreateDirectory(OutputDirectory);
            foreach (CondensedVertex va in Graph.Vertices)
            {
                if (va.ImutableExternalType)
                {
                    continue;
                }
                va.AssemblyName = GetAssemblyName(va);
                if (va.AssemblyName.StartsWith("<"))
                {
                    continue;
                }

                va.AssemblyGUID = Guid.NewGuid();
                va.ProjectFile  = va.AssemblyName + ".csproj"; // );//Path.Combine(OutputDirectory,
            }

            foreach (CondensedVertex vassem in Graph.Vertices)
            {
                CreateProjectFile(vassem);
            }

            CreateSolutionFile();
        }
        public void Execute()
        {
            DetermineClassDeps dcd = new DetermineClassDeps();
            TypeDependencyGraph tdg = new TypeDependencyGraph(false);
            dcd.AssemblyFile = AssemblyFileName;
            dcd.IgnoreOutsideRefs = false;
            dcd.Execute();
            tdg.LoadClassDependencies(dcd, true);
            this._graph = tdg.CondenseGraph();

            WritePDBasXML pdbxmlWritterTask = new WritePDBasXML();
            pdbxmlWritterTask.AssemblyName = new TaskItem(this.AssemblyFileName);

            if (pdbxmlWritterTask.Execute())
            {
                this._pDBDataFile = pdbxmlWritterTask.PDBAsXmlFile.ItemSpec;
                pdbXPathDoc = new XPathDocument(PDBDataFile);
                pdbNav = pdbXPathDoc.CreateNavigator();
            }

            Directory.CreateDirectory(OutputDirectory);
            foreach (CondensedVertex va in Graph.Vertices)
            {
                if (va.ImutableExternalType) continue;
                va.AssemblyName =  GetAssemblyName(va);
                if (va.AssemblyName.StartsWith("<"))
                    continue;

                va.AssemblyGUID = Guid.NewGuid();
                va.ProjectFile = va.AssemblyName + ".csproj"; // );//Path.Combine(OutputDirectory,
            }

            foreach (CondensedVertex vassem in Graph.Vertices)
            {
                CreateProjectFile(vassem);
            }

            CreateSolutionFile();
        }
Exemple #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string output;

            dcd.AssemblyFile      = @"..\..\..\MBUnitTests\bin\Debug\MBUnitTests.exe";
            dcd.IgnoreOutsideRefs = false;
            dcd.Execute();
            TypeDependencyGraph tdg = new TypeDependencyGraph(false);

            tdg.LoadClassDependencies(dcd, true);
            output = RenderAnalysisGraph(tdg, imageType, "tdg");

//			output = RenderAnalysisGraph(tdg, imageType, "NamespaceOutboundG");


            ////CondensedTypeGraph cond_CompNS_CondG = tdg.
            //TypeDependencyGraph Analysistdg;
            //Analysistdg = tdg.TypeDepAnalysis(new List<TypeReference>());
            //RenderAnalysisGraph(Analysistdg, imageType, "Analysistdg");
            //return;
            ////output = RenderCondGraph(cond_CompNS_CondG, imageType, "analysistNew");

            //return;
            CondensedTypeGraph condG = tdg.CondenseGraph();

            output = RenderCondGraph(condG, imageType, "condensedGraph");
            condG.CompactNS(true);
            output = RenderCondGraph(condG, imageType, "compactNS");

            foreach (CondensedVertex v in condG.Vertices)
            {
                Debug.WriteLine(v.ContainedTypes.Count.ToString());
            }

            RenderProjectFiles rpf = new RenderProjectFiles();

            //rpf.PDBDataFile = @"..\..\..\MBUnitTests\bin\Debug\MBUnitTests.pdb.xml";
            GeneratePDBXml(rpf);
            rpf.Graph           = condG;
            rpf.OutputDirectory = "Projects";
            rpf.NameHint        = "mbuTests";
            rpf.Execute();



            //CondensedTypeGraph NScompressed = condG.CompressNamespaces();
            //CondensedTypeGraph NScompressedandCondensed = NScompressed.CondenseGraph();


            //List<TypeReference> analysisList = cond_CompNS_CondG.FindBigestAssembly().ContainedTypes;
//			Analysistdg =  tdg.TypeDepAnalysis(analysisList);



            //output = RenderAnalysisGraph(tdg, imageType, "analisisRemoved");


            //output = RenderCondGraph(NScompressedandCondensed, imageType, "NS2");
            //output = RenderCondGraph(condG, imageType, "Cond");
            return;



            //CondensedTypeGraph ccc = tdg.CompressGraph();
            //CondensedTypeGraph cccNS = ccc.CompressNamespaces();
            //= cccNS.CompressGraph();



            //Debug.WriteLine(ccc.VerticesCount.ToString());
            //Debug.WriteLine(tdg.VerticesCount.ToString());
            //Debug.WriteLine(ccc.EdgesCount.ToString());



            //pictureBox1.Load(output);


            ////            return;
            //Debug.WriteLine("Render full graph");
            //return;
            //output = RenderFullGraph(tdg, imageType);
            //pictureBox3.Load(output);
        }