This repository was archived by the owner on Dec 18, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made some changes to how DTH sees wrapped projects
- Fix up the dependencies list when returning wrapped csproj and assemblies. - Changed how unresolved dependencies were implemented. This allows a specific IDependencyProvider to say a dependency is resolved, but mark it as unresolved so that fallback does not happen. - Remove special logic from the UnresolvedDependencyProvider and made it a first class property on LibraryDescription. - Mark projects as unresolved if they do not have a compatible target framework #945
- Loading branch information
Showing
10 changed files
with
63 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 3 additions & 44 deletions
47
src/Microsoft.Framework.Runtime/DependencyManagement/UnresolvedDependencyProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,31 @@ | ||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.Versioning; | ||
using System.Text; | ||
using NuGet; | ||
|
||
namespace Microsoft.Framework.Runtime | ||
{ | ||
public class UnresolvedDependencyProvider : IDependencyProvider | ||
{ | ||
public IEnumerable<LibraryDescription> UnresolvedDependencies { get; private set; } | ||
|
||
public IEnumerable<IDependencyProvider> AttemptedProviders { get; set; } | ||
|
||
public UnresolvedDependencyProvider() | ||
{ | ||
UnresolvedDependencies = Enumerable.Empty<LibraryDescription>(); | ||
} | ||
|
||
public LibraryDescription GetDescription(Library library, FrameworkName targetFramework) | ||
{ | ||
return new LibraryDescription | ||
{ | ||
Identity = library, | ||
Dependencies = Enumerable.Empty<LibraryDependency>() | ||
Dependencies = Enumerable.Empty<LibraryDependency>(), | ||
Resolved = false | ||
}; | ||
} | ||
|
||
public void Initialize(IEnumerable<LibraryDescription> dependencies, FrameworkName targetFramework) | ||
{ | ||
UnresolvedDependencies = dependencies; | ||
} | ||
|
||
public IEnumerable<string> GetAttemptedPaths(FrameworkName targetFramework) | ||
{ | ||
return AttemptedProviders.Where(p => p != this) | ||
.SelectMany(p => p.GetAttemptedPaths(targetFramework)); | ||
} | ||
|
||
public string GetMissingDependenciesWarning(FrameworkName targetFramework) | ||
{ | ||
var sb = new StringBuilder(); | ||
|
||
// TODO: Localize messages | ||
|
||
sb.AppendFormat("Failed to resolve the following dependencies for target framework '{0}':", targetFramework.ToString()); | ||
sb.AppendLine(); | ||
|
||
foreach (var d in UnresolvedDependencies.OrderBy(d => d.Identity.Name)) | ||
{ | ||
sb.AppendLine(" " + d.Identity.ToString()); | ||
} | ||
|
||
sb.AppendLine(); | ||
sb.AppendLine("Searched Locations:"); | ||
|
||
foreach (var path in GetAttemptedPaths(targetFramework)) | ||
{ | ||
sb.AppendLine(" " + path); | ||
} | ||
|
||
sb.AppendLine(); | ||
sb.AppendLine("Try running 'kpm restore'."); | ||
|
||
return sb.ToString(); | ||
return Enumerable.Empty<string>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters