コード例 #1
0
        public static BuildDefinitionDtoCollection GetBuildDefinitions(this TfsConfigurationServer tfsConfigurationServer, Guid teamProjectCollectionId, string teamProjectName)
        {
            if (tfsConfigurationServer == null)
            {
                throw new ArgumentNullException("tfsConfigurationServer");
            }

            TfsTeamProjectCollection tfsTeamProjectCollection = tfsConfigurationServer.GetTeamProjectCollection(teamProjectCollectionId);
            IBuildServer             buildServer = tfsTeamProjectCollection.GetService <IBuildServer>();

            IBuildDefinition[]           buildDefinitions             = buildServer.QueryBuildDefinitions(teamProjectName);
            BuildDefinitionDtoCollection buildDefinitionDtoCollection = new BuildDefinitionDtoCollection();

            foreach (IBuildDefinition buildDefinition in buildDefinitions)
            {
                BuildDefinitionDto buildDefinitionDto = new BuildDefinitionDto();
                buildDefinitionDto.TeamProjectName = buildDefinition.TeamProject;
                buildDefinitionDto.Name            = buildDefinition.Name;
                buildDefinitionDto.Id  = buildDefinition.Id;
                buildDefinitionDto.Uri = buildDefinition.Uri;
                buildDefinitionDtoCollection.Add(buildDefinitionDto);
            }

            return(buildDefinitionDtoCollection);
        }
コード例 #2
0
        public ActionResult TeamBuildDefinitions(Guid teamProjectCollectionId, string teamProjectName)
        {
            BuildDefinitionDtoCollection buildDefinitionDtoCollection = GetTfsConfigurationServer().GetBuildDefinitions(teamProjectCollectionId, teamProjectName);

            this.ViewData[ViewDataKey.TeamProjectCollectionId] = teamProjectCollectionId;
            this.ViewData[ViewDataKey.TeamProjectName]         = teamProjectName;
            return(this.View(buildDefinitionDtoCollection));
        }
コード例 #3
0
        public static BuildDefinitionDtoCollection ListTeamBuilds(Uri tfsUrl)
        {
            TfsConfigurationServer tfsConfigurationServer = TfsConfigurationServerFactory.GetConfigurationServer(tfsUrl);
            TeamProjectDtoCollection teamProjectCollections = tfsConfigurationServer.GetAllTeamProjectsInAllTeamProjectCollections();
            BuildDefinitionDtoCollection all = new BuildDefinitionDtoCollection();
            foreach (TeamProjectDto teamProjectCollection in teamProjectCollections)
            {
                BuildDefinitionDtoCollection buildDefinitionDtoCollection = tfsConfigurationServer.GetBuildDefinitions(teamProjectCollection.CollectionId, teamProjectCollection.DisplayName);
                foreach (BuildDefinitionDto buildDefinitionDto in buildDefinitionDtoCollection)
                {
                    all.Add(buildDefinitionDto);
                }
            }

            return all;
        }
コード例 #4
0
        public static BuildDefinitionDtoCollection ListTeamBuilds(Uri tfsUrl)
        {
            TfsConfigurationServer       tfsConfigurationServer = TfsConfigurationServerFactory.GetConfigurationServer(tfsUrl);
            TeamProjectDtoCollection     teamProjectCollections = tfsConfigurationServer.GetAllTeamProjectsInAllTeamProjectCollections();
            BuildDefinitionDtoCollection all = new BuildDefinitionDtoCollection();

            foreach (TeamProjectDto teamProjectCollection in teamProjectCollections)
            {
                BuildDefinitionDtoCollection buildDefinitionDtoCollection = tfsConfigurationServer.GetBuildDefinitions(teamProjectCollection.CollectionId, teamProjectCollection.DisplayName);
                foreach (BuildDefinitionDto buildDefinitionDto in buildDefinitionDtoCollection)
                {
                    all.Add(buildDefinitionDto);
                }
            }

            return(all);
        }
コード例 #5
0
        private static void ListAllTeamBuilds(Uri tfsUrl)
        {
            System.Console.WriteLine("Listing all Team Builds for all Team Projects.");
            BuildDefinitionDtoCollection buildDefinitionDtoCollection = BuildServerFacade.ListTeamBuilds(tfsUrl);
            string currentTeamProject = null;

            foreach (BuildDefinitionDto buildDefinitionDto in buildDefinitionDtoCollection)
            {
                if (buildDefinitionDto.TeamProjectName != currentTeamProject)
                {
                    System.Console.WriteLine();
                    System.Console.WriteLine("Team Project: '{0}'.", buildDefinitionDto.TeamProjectName);
                }

                System.Console.WriteLine("Team Build: '{0}'.", buildDefinitionDto.Name);
                currentTeamProject = buildDefinitionDto.TeamProjectName;
            }

            System.Console.WriteLine();
            System.Console.WriteLine("Done.");
        }
コード例 #6
0
        public static BuildDefinitionDtoCollection GetBuildDefinitions(this TfsConfigurationServer tfsConfigurationServer, Guid teamProjectCollectionId, string teamProjectName)
        {
            if (tfsConfigurationServer == null)
            {
                throw new ArgumentNullException("tfsConfigurationServer");
            }

            TfsTeamProjectCollection tfsTeamProjectCollection = tfsConfigurationServer.GetTeamProjectCollection(teamProjectCollectionId);
            IBuildServer buildServer = tfsTeamProjectCollection.GetService<IBuildServer>();
            IBuildDefinition[] buildDefinitions = buildServer.QueryBuildDefinitions(teamProjectName);
            BuildDefinitionDtoCollection buildDefinitionDtoCollection = new BuildDefinitionDtoCollection();
            foreach (IBuildDefinition buildDefinition in buildDefinitions)
            {
                BuildDefinitionDto buildDefinitionDto = new BuildDefinitionDto();
                buildDefinitionDto.TeamProjectName = buildDefinition.TeamProject;
                buildDefinitionDto.Name = buildDefinition.Name;
                buildDefinitionDto.Id = buildDefinition.Id;
                buildDefinitionDto.Uri = buildDefinition.Uri;
                buildDefinitionDtoCollection.Add(buildDefinitionDto);
            }

            return buildDefinitionDtoCollection;
        }