/// <summary> /// Initializes a new instance of the <see cref="TfsPullRequestSystem"/> class. /// Connects to the TFS server using NTLM authentication. /// </summary> /// <param name="log">The Cake log context.</param> /// <param name="settings">Settings for accessing TFS.</param> public TfsPullRequestSystem(ICakeLog log, TfsPullRequestSystemSettings settings) : base(log) { settings.NotNull(nameof(settings)); this.settings = settings; if (settings.CheckCommitId) { this.AddCapability(new TfsCheckingCommitIdCapability(log, this)); this.Log.Information("Commit ID check capability is enabled."); } else { this.Log.Information("Commit ID check capability is disabled."); } if (settings.ManageDiscussionThreadStatus) { this.AddCapability(new TfsDiscussionThreadsCapability(log, this)); this.Log.Information("Discussion thread status management capability is enabled."); } else { this.Log.Information("Discussion thread status management capability is disabled."); } // Filtering by modified files is always required as we otherwise no longer can compare issues // in a subsequent run as we lose information about file and line. // See https://github.com/cake-contrib/Cake.Issues.PullRequests.Tfs/issues/46#issuecomment-419149355 this.AddCapability(new TfsFilteringByModifiedFilesCapability(log, this)); this.tfsPullRequest = new TfsPullRequest(log, settings); }
public static IPullRequestSystem TfsPullRequests( this ICakeContext context, TfsPullRequestSystemSettings settings) { context.NotNull(nameof(context)); settings.NotNull(nameof(settings)); return(new TfsPullRequestSystem(context.Log, settings)); }