Esempio n. 1
0
        /// <summary>
        /// Creates a report from a list of issues.
        /// </summary>
        /// <param name="issueProviders">Issue providers which should be used to get the issues.</param>
        /// <param name="reportFormat">Report format to use.</param>
        /// <returns>Path to the created report or <c>null</c> if report could not be created.</returns>
        public FilePath CreateReport(IEnumerable <IIssueProvider> issueProviders, IIssueReportFormat reportFormat)
        {
            issueProviders.NotNullOrEmptyOrEmptyElement(nameof(issueProviders));
            reportFormat.NotNull(nameof(reportFormat));

            var issuesReader = new IssuesReader(this.log, issueProviders, this.settings);
            var issues       = issuesReader.ReadIssues(IssueCommentFormat.PlainText);

            return(this.CreateReport(issues, reportFormat));
        }
        /// <summary>
        /// Creates a report from a list of issues.
        /// </summary>
        /// <param name="issueProviders">Issue providers which should be used to get the issues.</param>
        /// <param name="reportFormat">Report format to use.</param>
        /// <param name="settings">Settings to use.</param>
        /// <returns>Path to the created report or <c>null</c> if report could not be created.</returns>
        public FilePath CreateReport(
            IEnumerable <IIssueProvider> issueProviders,
            IIssueReportFormat reportFormat,
            ICreateIssueReportFromIssueProviderSettings settings)
        {
            issueProviders.NotNullOrEmptyOrEmptyElement(nameof(issueProviders));
            reportFormat.NotNull(nameof(reportFormat));
            settings.NotNull(nameof(settings));

            var issuesReader = new IssuesReader(this.log, issueProviders, settings);
            var issues       = issuesReader.ReadIssues();

            return(this.CreateReport(issues, reportFormat, settings));
        }
        public static FilePath CreateIssueReport(
            this ICakeContext context,
            IEnumerable <IIssueProvider> issueProviders,
            IIssueReportFormat reportFormat,
            ICreateIssueReportFromIssueProviderSettings settings)
        {
            context.NotNull(nameof(context));
            reportFormat.NotNull(nameof(reportFormat));

            // ReSharper disable once PossibleMultipleEnumeration
            issueProviders.NotNullOrEmptyOrEmptyElement(nameof(issueProviders));

            var issueReportCreator = new IssueReportCreator(context.Log);

            // ReSharper disable once PossibleMultipleEnumeration
            return(issueReportCreator.CreateReport(issueProviders, reportFormat, settings));
        }
Esempio n. 4
0
        public static FilePath CreateIssueReport(
            this ICakeContext context,
            IIssueProvider issueProvider,
            IIssueReportFormat reportFormat,
            CreateIssueReportSettings settings)
        {
            context.NotNull(nameof(context));
            reportFormat.NotNull(nameof(reportFormat));

            issueProvider.NotNull(nameof(issueProvider));

            var issueReportCreator = new IssueReportCreator(context.Log, settings);

            return(issueReportCreator.CreateReport(new List <IIssueProvider> {
                issueProvider
            }, reportFormat));
        }
Esempio n. 5
0
        /// <summary>
        /// Creates a report from a list of issues.
        /// </summary>
        /// <param name="issues">Issues for which the report should be created.</param>
        /// <param name="reportFormat">Report format to use.</param>
        /// <returns>Path to the created report or <c>null</c> if report could not be created.</returns>
        public FilePath CreateReport(IEnumerable <IIssue> issues, IIssueReportFormat reportFormat)
        {
            issues.NotNullOrEmptyElement(nameof(issues));
            reportFormat.NotNull(nameof(reportFormat));

            var reportFormatName = reportFormat.GetType().Name;

            this.log.Verbose("Initialize report format {0}...", reportFormatName);
            if (!reportFormat.Initialize(this.settings))
            {
                this.log.Warning("Error initializing report format {0}.", reportFormatName);
                return(null);
            }

            this.log.Verbose("Creating report {0}...", reportFormatName);
            return(reportFormat.CreateReport(issues));
        }
        public static FilePath CreateIssueReport(
            this ICakeContext context,
            IIssueProvider issueProvider,
            IIssueReportFormat reportFormat,
            DirectoryPath repositoryRoot,
            FilePath outputFilePath)
        {
            context.NotNull(nameof(context));

            issueProvider.NotNull(nameof(issueProvider));

            reportFormat.NotNull(nameof(reportFormat));
            repositoryRoot.NotNull(nameof(repositoryRoot));
            outputFilePath.NotNull(nameof(outputFilePath));

            return
                (context.CreateIssueReport(
                     issueProvider,
                     reportFormat,
                     new CreateIssueReportFromIssueProviderSettings(repositoryRoot, outputFilePath)));
        }
        public static FilePath CreateIssueReport(
            this ICakeContext context,
            IEnumerable <IIssue> issues,
            IIssueReportFormat reportFormat,
            DirectoryPath repositoryRoot,
            FilePath outputFilePath)
        {
            context.NotNull(nameof(context));

            // ReSharper disable once PossibleMultipleEnumeration
            issues.NotNullOrEmptyElement(nameof(issues));

            reportFormat.NotNull(nameof(reportFormat));
            repositoryRoot.NotNull(nameof(repositoryRoot));
            outputFilePath.NotNull(nameof(outputFilePath));

            // ReSharper disable once PossibleMultipleEnumeration
            return
                (context.CreateIssueReport(
                     issues,
                     reportFormat,
                     new CreateIssueReportSettings(repositoryRoot, outputFilePath)));
        }