Ejemplo n.º 1
0
        /// <summary>
        /// Log errors for missing dependencies.
        /// </summary>
        internal static async Task LogAsync(IEnumerable <IRestoreTargetGraph> graphs, RemoteWalkContext context, CancellationToken token)
        {
            var tasks = graphs.SelectMany(graph => graph.Unresolved.Select(e =>
                                                                           GetMessageAsync(
                                                                               graph.TargetGraphName,
                                                                               e,
                                                                               context.FilterDependencyProvidersForLibrary(e),
                                                                               context.PackageSourceMapping.IsEnabled,
                                                                               context.RemoteLibraryProviders,
                                                                               context.CacheContext,
                                                                               context.Logger,
                                                                               token))).ToArray();

            var messages = await Task.WhenAll(tasks);

            await context.Logger.LogMessagesAsync(DiagnosticUtility.MergeOnTargetGraph(messages));
        }
Ejemplo n.º 2
0
        internal static async Task LogAsync(IList <DownloadDependencyResolutionResult> downloadDependencyResults, RemoteWalkContext context, CancellationToken token)
        {
            var messageTasks = new List <Task <RestoreLogMessage> >();

            foreach (var ddi in downloadDependencyResults)
            {
                foreach (var unresolved in ddi.Unresolved)
                {
                    messageTasks.Add(GetMessageAsync(
                                         ddi.Framework.ToString(),
                                         unresolved,
                                         context.FilterDependencyProvidersForLibrary(unresolved),
                                         context.CacheContext,
                                         context.Logger,
                                         token));
                }
            }

            var messages = await Task.WhenAll(messageTasks);

            await context.Logger.LogMessagesAsync(DiagnosticUtility.MergeOnTargetGraph(messages));
        }