Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/api-doc-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Martinez <joelmartinez@gmail.com>2017-12-16 00:42:27 +0300
committerJoel Martinez <joelmartinez@gmail.com>2017-12-16 01:03:46 +0300
commit48549a76a762522bd6bcdbc7e221fe7ddb6cad03 (patch)
treefa58a90239128d786a03f72d973b40ed4a3c9e41
parent455b037f6ea0870490a249af7490b10989df97c3 (diff)
mdoc: mdoc's resolver will now prefer supplied dependencies over installed libraries for assemblies with a 'zero' version
-rw-r--r--mdoc/Mono.Documentation/MDocUpdater.cs12
-rw-r--r--mdoc/Mono.Documentation/Updater/Frameworks/MDocResolver.cs11
2 files changed, 16 insertions, 7 deletions
diff --git a/mdoc/Mono.Documentation/MDocUpdater.cs b/mdoc/Mono.Documentation/MDocUpdater.cs
index 424d8cd5..004c7494 100644
--- a/mdoc/Mono.Documentation/MDocUpdater.cs
+++ b/mdoc/Mono.Documentation/MDocUpdater.cs
@@ -2156,11 +2156,15 @@ namespace Mono.Documentation
var explicitTypeName = DocUtils.GetExplicitTypeName(mi);
// find one member wich is pocessed by the explicitly mentioned type
- var explicitlyImplemented = implementedMembers.First(i => i.DeclaringType.GetElementType().FullName == explicitTypeName);
- implementedMembers = new List<MemberReference>
+ var explicitlyImplemented = implementedMembers.FirstOrDefault(i => i.DeclaringType.GetElementType().FullName == explicitTypeName);
+
+ if (explicitlyImplemented != null)
{
- explicitlyImplemented
- };
+ implementedMembers = new List<MemberReference>
+ {
+ explicitlyImplemented
+ };
+ }
}
if (!implementedMembers.Any())
diff --git a/mdoc/Mono.Documentation/Updater/Frameworks/MDocResolver.cs b/mdoc/Mono.Documentation/Updater/Frameworks/MDocResolver.cs
index bf0bd278..8844e468 100644
--- a/mdoc/Mono.Documentation/Updater/Frameworks/MDocResolver.cs
+++ b/mdoc/Mono.Documentation/Updater/Frameworks/MDocResolver.cs
@@ -101,6 +101,7 @@ namespace Mono.Documentation.Updater.Frameworks
.Select (a => new
{
Assembly = a,
+ SuppliedDependency = namedPaths.Any (np => np == a.MainModule.FileName),
VersionSort = aggregateVersion (a.Name.Version),
VersionDiff = aggregateVersion (a.Name.Version) - aggregateVersion (name.Version),
MajorMatches = a.Name.Version.Major == name.Version.Major
@@ -109,9 +110,13 @@ namespace Mono.Documentation.Updater.Frameworks
// If the assembly has all zeroes, just grab the latest assembly
if (IsZero(name.Version)) {
- var highestMatch = applicableVersions
- .OrderByDescending (v => v.VersionSort)
- .FirstOrDefault ();
+ var possibleSet = applicableVersions;
+ if (applicableVersions.Any (s => s.SuppliedDependency))
+ possibleSet = applicableVersions.Where (av => av.SuppliedDependency).ToArray ();
+
+ var sorted = possibleSet.OrderByDescending (v => v.VersionSort).ToArray ();
+
+ var highestMatch = sorted.FirstOrDefault ();
if (highestMatch != null)
return highestMatch.Assembly;
}