Exemplo n.º 1
0
        /// <summary>
        /// Builds the changed project information model.
        /// </summary>
        /// <param name="gitPath">The git path.</param>
        /// <param name="gitBranch">The git branch.</param>
        /// <param name="startDay">The start day.</param>
        /// <param name="endDay">The end day.</param>
        /// <returns>
        /// List change project info model
        /// </returns>
        private static List <ProjectInfoModel> BuildChangedProjectInfoModel(string gitPath, string gitBranch, string startDay, string endDay)
        {
            var listProjectInfoModel = new List <ProjectInfoModel>();

            // Pull source old sprint
            var projectVersionManagement = new ProjectVersionManagement();

            projectVersionManagement.Pull(Directory.GetParent(gitPath).ToString(), gitBranch);

            // Get project nuget
            var listFileChanged = projectVersionManagement.GetListFileChanged(Directory.GetParent(gitPath).ToString(), startDay, endDay);

            // Get list file changed
            var projectScaner    = new ProjectScaner();
            var listNugetProject = projectScaner.GetListNugetProjectInfos(gitPath);

            // Get list nuget project wich was changed
            foreach (var nugetProject in listNugetProject)
            {
                var isChanged = listFileChanged.Any(f => f.Contains(nugetProject.ProjectName));
                if (isChanged)
                {
                    listProjectInfoModel.Add(nugetProject);
                }
            }

            // Read nuspecfile to build project info
            foreach (var nugetProject in listProjectInfoModel)
            {
                nugetProject.NugetVersion = ProjectHelper.GetNugetVersion(nugetProject.NuspecPath);
            }

            return(listProjectInfoModel);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Builds the project information model.
        /// </summary>
        /// <param name="gitPath">The git path.</param>
        /// <param name="gitBranch">The git branch.</param>
        /// <returns>
        /// List project info model
        /// </returns>
        private static List <ProjectInfoModel> BuildAllProjectInfoModel(string gitPath, string gitBranch)
        {
            var listProjectInfoModel = new List <ProjectInfoModel>();

            // Pull source old sprint
            var projectVersionManagement = new ProjectVersionManagement();

            projectVersionManagement.Pull(Directory.GetParent(gitPath).ToString(), gitBranch);

            // Get list file changed
            var projectScaner = new ProjectScaner();

            listProjectInfoModel = projectScaner.GetListNugetProjectInfos(gitPath).ToList();

            // Read nuspecfile to build project info
            foreach (var nugetProject in listProjectInfoModel)
            {
                nugetProject.NugetVersion = ProjectHelper.GetNugetVersion(nugetProject.NuspecPath);
            }

            return(listProjectInfoModel);
        }