Esempio n. 1
0
 private IEnumerable <ProjectPropertyName> GetProjectProperties()
 {
     return(Projects
            .SelectMany(prj => ProjectConfigurations.SelectMany(cfg => cfg.Properties.Values))
            .Distinct(new DelegateEqualityComparer <IProjectProperty>(p => p.Name))
            .Where(p => PropertyGroupName.IsNotProjectSpecific(p.Name))
            .Select(p => new ProjectPropertyName(p))
            .OrderBy(item => item.GroupName.Index));
 }
Esempio n. 2
0
        public PersonController(IRepository <Person, int> repository, IOptions <ProjectConfigurations> settings)
        {
            // The constructor uses dependency injection to inject an IRepository into the controller.
            // When actually running the API, this is a "real" repository that interacts with a local database.
            // When running test cases, this is a "fake" repository that only emulates the key functions needed.
            _repository = repository;

            // Additionally, we inject IOptions<ProjectConfigurations> which uses (object relational) mapping to
            // take property values from appsettings.json and store them in the ProjectConfigurations object.
            _projectConfigurations = settings.Value;
        }
        private IEnumerable <ProjectPropertyName> GetProjectProperties()
        {
            Contract.Ensures(Contract.Result <IEnumerable <ProjectPropertyName> >() != null);

            return(_projects
                   .SelectMany(prj => ProjectConfigurations.SelectMany(cfg => cfg.Properties.Values))
                   .Select(prop => prop.Name)
                   .Distinct()
                   .Where(PropertyGrouping.IsNotProjectSpecific)
                   .Select(name => new ProjectPropertyName(name, PropertyGrouping.GetPropertyGroupName(name))));
        }
        public JsonResult AnalyzeProject(Project model)
        {
            ExtractorAnalysis     analysis  = new ExtractorAnalysis();
            ProjectConfigurations appConfig = extractorService.ProjectConfiguration(model);

            analysis.teamCount       = extractorService.GetTeamsCount(appConfig);
            analysis.IterationCount  = extractorService.GetIterationsCount(appConfig);
            analysis.WorkItemCounts  = extractorService.GetWorkItemsCount(appConfig);
            analysis.BuildDefCount   = extractorService.GetBuildDefinitionCount(appConfig);
            analysis.ReleaseDefCount = extractorService.GetReleaseDefinitionCount(appConfig);

            analysis.ErrorMessages = ExtractorService.errorMessages;
            return(Json(analysis, JsonRequestBehavior.AllowGet));
        }
        IFluentSolutionConfiguration IFluentSolutionConfiguration.ConfigureProject(string projectName, Action <IFluentProjectConfiguration> action)
        {
            if (projectName == null)
            {
                throw new ArgumentNullException(nameof(projectName));
            }
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }
            var projectConfig = new ProjectConfiguration(this, projectName);

            ProjectConfigurations.Add(projectConfig);
            action(projectConfig);
            return(this);
        }
Esempio n. 6
0
            public GenerationContext(Builder builder, string projectPath, Project project, IEnumerable <Project.Configuration> projectConfigurations)
            {
                Builder = builder;

                FileInfo fileInfo = new FileInfo(projectPath);

                ProjectPath           = fileInfo.FullName;
                ProjectDirectory      = Path.GetDirectoryName(ProjectPath);
                ProjectFileName       = Path.GetFileName(ProjectPath);
                Project               = project;
                AndroidPackageProject = (AndroidPackageProject)Project;

                ProjectDirectoryCapitalized = Util.GetCapitalizedPath(ProjectDirectory);
                ProjectSourceCapitalized    = Util.GetCapitalizedPath(Project.SourceRootPath);

                ProjectConfigurations        = VsUtil.SortConfigurations(projectConfigurations, Path.Combine(ProjectDirectoryCapitalized, ProjectFileName + ProjectExtension)).ToArray();
                DevelopmentEnvironmentsRange = new DevEnvRange(ProjectConfigurations);

                PresentPlatforms = ProjectConfigurations.Select(conf => conf.Platform).Distinct().ToDictionary(p => p, p => PlatformRegistry.Get <IPlatformVcxproj>(p));
            }
Esempio n. 7
0
        public AsyncCodeConfiguration ConfigureProject(string projectFilePath, Action <IFluentProjectConfiguration> action)
        {
            if (projectFilePath == null)
            {
                throw new ArgumentNullException(nameof(projectFilePath));
            }
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }
            if (!File.Exists(projectFilePath))
            {
                throw new FileNotFoundException($"Project not found. Path:'{projectFilePath}'");
            }
            var solutionConfig = ProjectConfigurations.FirstOrDefault(o => o.Path == projectFilePath);

            if (solutionConfig == null)
            {
                solutionConfig = new ProjectConfiguration(projectFilePath);
                ProjectConfigurations.Add(solutionConfig);
            }
            action(solutionConfig);
            return(this);
        }
        //Analyze the selected project to know what all the artifacts it has
        public static ProjectConfigurations ProjectConfiguration(Project model)
        {
            string repoVersion                  = System.Configuration.ConfigurationManager.AppSettings["RepoVersion"];
            string buildVersion                 = System.Configuration.ConfigurationManager.AppSettings["BuildVersion"];
            string releaseVersion               = System.Configuration.ConfigurationManager.AppSettings["ReleaseVersion"];
            string wikiVersion                  = System.Configuration.ConfigurationManager.AppSettings["WikiVersion"];
            string boardVersion                 = System.Configuration.ConfigurationManager.AppSettings["BoardVersion"];
            string workItemsVersion             = System.Configuration.ConfigurationManager.AppSettings["WorkItemsVersion"];
            string releaseHost                  = System.Configuration.ConfigurationManager.AppSettings["ReleaseHost"];
            string defaultHost                  = System.Configuration.ConfigurationManager.AppSettings["DefaultHost"];
            string extensionHost                = System.Configuration.ConfigurationManager.AppSettings["ExtensionHost"];
            string getReleaseVersion            = System.Configuration.ConfigurationManager.AppSettings["GetRelease"];
            string agentQueueVersion            = System.Configuration.ConfigurationManager.AppSettings["AgentQueueVersion"];
            string extensionVersion             = System.Configuration.ConfigurationManager.AppSettings["ExtensionVersion"];
            string endpointVersion              = System.Configuration.ConfigurationManager.AppSettings["EndPointVersion"];
            string queriesVersion               = System.Configuration.ConfigurationManager.AppSettings["QueriesVersion"];
            ProjectConfigurations projectConfig = new ProjectConfigurations();

            projectConfig.AgentQueueConfig = new Configuration()
            {
                UriString = defaultHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id, VersionNumber = wikiVersion
            };
            projectConfig.WorkItemConfig = new Configuration()
            {
                UriString = defaultHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id, VersionNumber = wikiVersion
            };
            projectConfig.BuildDefinitionConfig = new Configuration()
            {
                UriString = defaultHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id, VersionNumber = buildVersion
            };
            projectConfig.ReleaseDefinitionConfig = new Configuration()
            {
                UriString = releaseHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id, VersionNumber = releaseVersion
            };
            projectConfig.RepoConfig = new Configuration()
            {
                UriString = defaultHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id, VersionNumber = repoVersion
            };
            projectConfig.BoardConfig = new Configuration()
            {
                UriString = defaultHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id, VersionNumber = boardVersion
            };
            projectConfig.Config = new Configuration()
            {
                UriString = defaultHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id
            };
            projectConfig.GetReleaseConfig = new Configuration()
            {
                UriString = releaseHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id, VersionNumber = getReleaseVersion
            };
            projectConfig.ExtensionConfig = new Configuration()
            {
                UriString = extensionHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id, VersionNumber = extensionVersion
            };
            projectConfig.EndpointConfig = new Configuration()
            {
                UriString = defaultHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id, VersionNumber = endpointVersion
            };
            projectConfig.QueriesConfig = new Configuration()
            {
                UriString = defaultHost + model.accountName + "/", PersonalAccessToken = model.accessToken, Project = model.ProjectName, AccountName = model.accountName, Id = model.id, VersionNumber = queriesVersion
            };

            return(projectConfig);
        }