コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TsBuildAdapter"/> class.
        /// Constructor for the instance that does the work
        /// </summary>
        /// <param name="connection">the connection we use to talk to the TFS server</param>
        /// <param name="teamProjectName">our project name</param>
        /// <param name="definitionNamePattern">a pattern used to select build definitions</param>
        public TfsBuildAdapter(TfsBuildConnection connection, string teamProjectName, string definitionNamePattern)
        {
            if (connection != null)
            {
                this.Connection = connection;
            }
            else
            {
                throw new ArgumentException("Connection must be configured");
            }
            //// no-pattern means look at all build definitions
            if (definitionNamePattern != null && definitionNamePattern.Length > 0)
            {
                this.DefinitionNamePattern = definitionNamePattern;
            }

            //// this should be in it's own method
            if (teamProjectName != null)
            {
                VersionControlServer versionControlServer = (VersionControlServer)connection.TfsTeamProjects.GetService <VersionControlServer>();
                this.OurTeamProject = versionControlServer.GetTeamProject(teamProjectName);
            }
            else
            {
                throw new ArgumentException("TeamProjectName must be set");
            }
            log.Info("Created new build adapter for project " + teamProjectName + " and pattern " + definitionNamePattern);
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TsBuildAdapter"/> class. 
        /// Constructor for the instance that does the work
        /// </summary>
        /// <param name="connection">the connection we use to talk to the TFS server</param>
        /// <param name="teamProjectName">our project name</param>
        /// <param name="definitionNamePattern">a pattern used to select build definitions</param> 
        public TfsBuildAdapter(TfsBuildConnection connection, string teamProjectName, string definitionNamePattern)
        {
            if (connection != null)
            {
                this.Connection = connection;
            }
            else
            {
                throw new ArgumentException("Connection must be configured");
            }
            //// no-pattern means look at all build definitions
            if (definitionNamePattern != null && definitionNamePattern.Length > 0)
            {
                this.DefinitionNamePattern = definitionNamePattern;
            }

            //// this should be in it's own method
            if (teamProjectName != null)
            {
                VersionControlServer versionControlServer = (VersionControlServer)connection.TfsTeamProjects.GetService<VersionControlServer>();
                this.OurTeamProject = versionControlServer.GetTeamProject(teamProjectName);
            }
            else
            {
                throw new ArgumentException("TeamProjectName must be set");
            }
            log.Info("Created new build adapter for project " + teamProjectName + " and pattern " + definitionNamePattern);
        }
コード例 #3
0
 public void TestMethod2()
 {
     string tfsPath = "http://foo.bar.bat/collection";
     string userId = "b";
     string password = "******";
     string domain = "d";
     TfsBuildConnection tbc = new TfsBuildConnection(tfsPath, userId, password, domain);
 }
コード例 #4
0
 public void TestMethod1()
 {
     string tfsPath = "a";
     string userId = "b";
     string password = "******";
     string domain = "d";
     TfsBuildConnection tbc = new TfsBuildConnection(tfsPath, userId, password, domain);
 }