コード例 #1
0
        private ChangedFileList PrepareChangedFile(Options options)
        {
            ChangedFileList fileList       = new ChangedFileList();
            var             changeFilelist = GitCommandHelper.CompareBranch(options.OriginRepository, options.NewRepository, options.GitWorkPath);

            fileList.AddRange(changeFilelist);
            return(fileList);
        }
コード例 #2
0
        public IList <ProjectDescription> Analysis(ChangedFileList list)
        {
            //分析项目文件
            var projectFile   = list.Where(p => p.EndsWith(".csproj"));
            var projectParser = ProjectParserFactory.Create(AnalysisFileType.CSPROJ);

            foreach (var item in projectFile)
            {
                if (!projectFiler.IsValid(item))
                {
                    continue;
                }

                var      filePath = $"{PathService.GitRootDirectory}\\{item}";
                FileInfo file     = new FileInfo(filePath);

                if (!file.FullName.StartsWith(options.GitWorkPath))
                {
                    continue;
                }

                var description = projectParser.Parser(filePath);

                description.Name      = file.Name;
                description.Location  = file.Directory;
                description.IsChanged = true;
                description.FullName  = file.FullName;

                //check file
                ProjectDiffer.Diff(description);

                PackContext.ProjectsDescription.Add(description);
            }


            list.Except(projectFile).ToList().ForEach(p => Analysis(p));
            //restore nuget files
            PrepareNugetFiles();

            return(PackContext.ProjectsDescription);
        }