コード例 #1
0
        private void AddMessage(IAssetsLogMessage message)
        {
            var logToMsBuild = true;
            var targetGraphs = message.GetTargetGraphs(LockFile);

            targetGraphs = targetGraphs.Any() ? targetGraphs : new LockFileTarget[] { null };

            foreach (var target in targetGraphs)
            {
                var targetLib = message.LibraryId == null ? null : target?.GetTargetLibrary(message.LibraryId);

                _diagnostics.Add(
                    message.Code.ToString(),
                    message.Message,
                    message.FilePath,
                    FromLogLevel(message.Level),
                    message.StartLineNumber,
                    message.StartColumnNumber,
                    message.EndLineNumber,
                    message.EndColumnNumber,
                    target?.Name,
                    targetLib == null ? null : $"{targetLib.Name}/{targetLib.Version.ToNormalizedString()}",
                    logToMsBuild);

                logToMsBuild = false; // only write first instance of this diagnostic to msbuild
            }
        }
コード例 #2
0
        private void AddMessage(IAssetsLogMessage message)
        {
            var targetGraphs = message.GetTargetGraphs(LockFile);

            targetGraphs = targetGraphs.Any() ? targetGraphs : new LockFileTarget[] { null };

            foreach (var target in targetGraphs)
            {
                var targetLib = message.LibraryId == null ? null : target?.GetTargetLibrary(message.LibraryId);

                _diagnostics.Add(
                    message.Code.ToString(),
                    message.Message,
                    message.FilePath,
                    FromLogLevel(message.Level),
                    message.StartLineNumber,
                    message.StartColumnNumber,
                    message.EndLineNumber,
                    message.EndColumnNumber,
                    target?.Name,
                    targetLib == null ? null : $"{targetLib.Name}/{targetLib.Version.ToNormalizedString()}");
            }
        }