Ejemplo n.º 1
0
        private void DoAnalyzeProject(VCProject vcProject)
        {
            ts.TraceInformation("DoAnalyzeProject " + vcProject.Name);
            ts.TraceInformation("DoAnalyzeProject #files " + _report.SolutionCurrent.ProjectCurrent.Files.Count);
            OutputPaneWriteln("Analyzing project " + vcProject.Name +
                              " " + _report.SolutionCurrent.ProjectCurrent.Files.Count + " files to analyze");

            OnStartProject();

            ts.TraceInformation("DoAnalyzeProject " + vcProject.Name + " getting vc conf");
            _vcConfiguration = DTE2Utils.GetVcConfiguratioForVcProject(vcProject);
            if (_vcConfiguration == null)
            {
                ts.TraceInformation("DoAnalyzeProject cannot get c++ project configuration" + vcProject.Name);
                OnStopProject(true);
                return;
            }

            ts.TraceInformation("DoAnalyzeProject " + vcProject.Name + " create file queue");
            _vcProject   = vcProject;
            _vcFileQueue = DTE2Utils.CreateFileQueue(vcProject);
            ts.TraceInformation("DoAnalyzeProject " + vcProject.Name + " file queue created");

            if (_vcFileQueue.Count == 0)
            {
                ts.TraceInformation("DoAnalyzeProject no c++ file in project " + vcProject.Name);
                OnStopProject(false);
                return;
            }

            AnalyseNextFile();
        }
Ejemplo n.º 2
0
        static public Queue <VCFile> CreateFileQueue(VCProject vcProject)
        {
            ts.TraceInformation("CreateFileQueue");
            Queue <VCFile> fileQueue        = new Queue <VCFile>();
            var            vcFileCollection = (IVCCollection)vcProject.Files;

            if (vcFileCollection == null)
            {
                ts.TraceData(TraceEventType.Verbose, 1, "CreateFileList cannot get vc file collection");
                return(null);
            }

            ts.TraceInformation("CreateFileQueue #vcFileCollection " + vcFileCollection.Count);
            foreach (VCFile vcFile in vcFileCollection)
            {
                try
                {
                    VCFileConfiguration vcFileConfiguration = DTE2Utils.GetVcFileConfiguration(
                        vcFile,
                        DTE2Utils.GetVcConfiguratioForVcProject(vcProject));

                    if (vcFileConfiguration != null)
                    {
                        if ((vcFileConfiguration.ExcludedFromBuild == false) && (vcFile.FileType == eFileType.eFileTypeCppCode))
                        {
                            ts.TraceData(TraceEventType.Verbose, 1, "CreateFileList add " + vcFile.FullPath);
                            fileQueue.Enqueue(vcFile);
                        }
                        else
                        {
                            ts.TraceData(TraceEventType.Verbose, 1, "CreateFileList exclude " + vcFile.FullPath);
                        }
                    }
                }
                catch (Exception exception)
                {
                    ts.TraceData(TraceEventType.Verbose, 1, "CreateFileList exception  " + exception.Message);
                }
            }

            ts.TraceInformation("CreateFileList project " + vcProject.Name + " #files " + fileQueue.Count);
            return(fileQueue);
        }