예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseMultiFormatIssueProviderSettings{TIssueProvider, TSettings}"/> class
        /// for a log file content in memoy.
        /// </summary>
        /// <param name="logFileContent">Content of the log file.
        /// The log file needs to be in the format as defined by the <paramref name="format"/> parameter.</param>
        /// <param name="format">Format of the provided log file.</param>
        public BaseMultiFormatIssueProviderSettings(byte[] logFileContent, ILogFileFormat <TIssueProvider, TSettings> format)
            : base(logFileContent)
        {
            format.NotNull(nameof(format));

            this.Format = format;
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseMultiFormatIssueProviderSettings{TIssueProvider, TSettings}"/> class
        /// for reading a log file on disk.
        /// </summary>
        /// <param name="logFilePath">Path to the log file.
        /// The log file needs to be in the format as defined by the <paramref name="format"/> parameter.</param>
        /// <param name="format">Format of the provided log file.</param>
        public BaseMultiFormatIssueProviderSettings(FilePath logFilePath, ILogFileFormat <TIssueProvider, TSettings> format)
            : base(logFilePath)
        {
            format.NotNull(nameof(format));

            this.Format = format;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MsBuildIssuesSettings"/> class.
        /// </summary>
        /// <param name="logFileContent">Content of the the MsBuild log file.
        /// The log file needs to be in the format as defined by the <paramref name="format"/> parameter.</param>
        /// <param name="format">Format of the provided MsBuild log file.</param>
        protected MsBuildIssuesSettings(string logFileContent, ILogFileFormat format)
        {
            logFileContent.NotNullOrWhiteSpace(nameof(logFileContent));
            format.NotNull(nameof(format));

            this.LogFileContent = logFileContent;
            this.Format         = format;
        }
        public static ICodeAnalysisProvider MsBuildIssuesFromContent(
            this ICakeContext context,
            string logFileContent,
            ILogFileFormat format)
        {
            context.NotNull(nameof(context));
            logFileContent.NotNullOrWhiteSpace(nameof(logFileContent));
            format.NotNull(nameof(format));

            return(context.MsBuildIssues(MsBuildIssuesSettings.FromContent(logFileContent, format)));
        }
        public static ICodeAnalysisProvider MsBuildIssuesFromFilePath(
            this ICakeContext context,
            FilePath logFilePath,
            ILogFileFormat format)
        {
            context.NotNull(nameof(context));
            logFilePath.NotNull(nameof(logFilePath));
            format.NotNull(nameof(format));

            return(context.MsBuildIssues(MsBuildIssuesSettings.FromFilePath(logFilePath, format)));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MsBuildIssuesSettings"/> class.
        /// </summary>
        /// <param name="logFilePath">Path to the the MsBuild log file.
        /// The log file needs to be in the format as defined by the <paramref name="format"/> parameter.</param>
        /// <param name="format">Format of the provided MsBuild log file.</param>
        protected MsBuildIssuesSettings(FilePath logFilePath, ILogFileFormat format)
        {
            logFilePath.NotNull(nameof(logFilePath));
            format.NotNull(nameof(format));

            this.Format = format;

            using (var stream = new FileStream(logFilePath.FullPath, FileMode.Open, FileAccess.Read))
            {
                using (var sr = new StreamReader(stream))
                {
                    this.LogFileContent = sr.ReadToEnd();
                }
            }
        }