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:
-rw-r--r--mdoc/Mono.Documentation/MDocUpdater.cs12
-rw-r--r--mdoc/Mono.Documentation/Updater/Frameworks/FrameworkEntry.cs7
-rw-r--r--mdoc/Mono.Documentation/Updater/Frameworks/FrameworkTypeEntry.cs11
-rw-r--r--mdoc/mdoc.Test/XmlUpdateTests.cs7
4 files changed, 24 insertions, 13 deletions
diff --git a/mdoc/Mono.Documentation/MDocUpdater.cs b/mdoc/Mono.Documentation/MDocUpdater.cs
index 53ed393d..fe4d1efd 100644
--- a/mdoc/Mono.Documentation/MDocUpdater.cs
+++ b/mdoc/Mono.Documentation/MDocUpdater.cs
@@ -341,7 +341,7 @@ namespace Mono.Documentation
foreach (var type in assembly.GetTypes())
{
- var t = a.ProcessType(type);
+ var t = a.ProcessType(type, assembly);
foreach (var member in type.GetMembers().Where(i => !DocUtils.IsIgnored(i)))
t.ProcessMember(member);
}
@@ -702,7 +702,7 @@ namespace Mono.Documentation
foreach (TypeDefinition type in docEnum.GetDocumentationTypes(assembly, typenames))
{
- var typeEntry = frameworkEntry.ProcessType(type);
+ var typeEntry = frameworkEntry.ProcessType(type, assembly);
string relpath = DoUpdateType(assemblySet, assembly, type, typeEntry, basepath, dest);
if (relpath == null)
@@ -905,7 +905,7 @@ namespace Mono.Documentation
else
{
// Stub
- XmlElement td = StubType (set, assembly, type, output, typeEntry.Framework.Importers, typeEntry.Framework.Id, typeEntry.Framework.Version);
+ XmlElement td = StubType (set, assembly, type, typeEntry, output, typeEntry.Framework.Importers, typeEntry.Framework.Id, typeEntry.Framework.Version);
if (td == null)
return null;
}
@@ -1108,7 +1108,7 @@ namespace Mono.Documentation
if (!DocUtils.IsPublic (type) || typename.IndexOfAny (InvalidFilenameChars) >= 0)
continue;
- var typeEntry = frameworkEntry.ProcessType (type);
+ var typeEntry = frameworkEntry.ProcessType (type, assembly);
string reltypepath = DoUpdateType (assemblySet, assembly, type, typeEntry, source, dest);
if (reltypepath == null)
@@ -1984,7 +1984,7 @@ namespace Mono.Documentation
// CREATE A STUB DOCUMENTATION FILE
- public XmlElement StubType (AssemblySet set, AssemblyDefinition assembly, TypeDefinition type, string output, IEnumerable<DocumentationImporter> importers, string Id, string Version)
+ public XmlElement StubType (AssemblySet set, AssemblyDefinition assembly, TypeDefinition type, FrameworkTypeEntry typeEntry, string output, IEnumerable<DocumentationImporter> importers, string Id, string Version)
{
string typesig = typeFormatters[0].GetDeclaration (type);
if (typesig == null) return null; // not publicly visible
@@ -1993,8 +1993,6 @@ namespace Mono.Documentation
XmlElement root = doc.CreateElement ("Type");
doc.AppendChild (root);
- var frameworkEntry = frameworks.StartProcessingAssembly (set, assembly, importers, Id, Version);
- var typeEntry = frameworkEntry.ProcessType (type);
DoUpdateType2 ("New Type", doc, type, typeEntry, output, true);
statisticsCollector.AddMetric (typeEntry.Framework.Name, StatisticsItem.Types, StatisticsMetrics.Added);
diff --git a/mdoc/Mono.Documentation/Updater/Frameworks/FrameworkEntry.cs b/mdoc/Mono.Documentation/Updater/Frameworks/FrameworkEntry.cs
index dbf78562..ec11252d 100644
--- a/mdoc/Mono.Documentation/Updater/Frameworks/FrameworkEntry.cs
+++ b/mdoc/Mono.Documentation/Updater/Frameworks/FrameworkEntry.cs
@@ -219,7 +219,7 @@ namespace Mono.Documentation.Updater.Frameworks
public static readonly FrameworkEntry Empty = new EmptyFrameworkEntry () { Name = "Empty" };
- public virtual FrameworkTypeEntry ProcessType (TypeDefinition type)
+ public virtual FrameworkTypeEntry ProcessType (TypeDefinition type, AssemblyDefinition source)
{
FrameworkTypeEntry entry;
@@ -232,7 +232,8 @@ namespace Mono.Documentation.Updater.Frameworks
typeMap.Add (Str (entry.Name), entry);
}
-
+ entry.NoteAssembly(type.Module.Assembly, source);
+ entry.NoteAssembly(source, source);
entry.TimesProcessed++;
return entry;
}
@@ -259,7 +260,7 @@ namespace Mono.Documentation.Updater.Frameworks
class EmptyFrameworkEntry : FrameworkEntry
{
public EmptyFrameworkEntry () : base (null, 1, null) { }
- public override FrameworkTypeEntry ProcessType (TypeDefinition type) { return FrameworkTypeEntry.Empty; }
+ public override FrameworkTypeEntry ProcessType (TypeDefinition type, AssemblyDefinition source) { return FrameworkTypeEntry.Empty; }
}
diff --git a/mdoc/Mono.Documentation/Updater/Frameworks/FrameworkTypeEntry.cs b/mdoc/Mono.Documentation/Updater/Frameworks/FrameworkTypeEntry.cs
index 9f7d4129..197b126b 100644
--- a/mdoc/Mono.Documentation/Updater/Frameworks/FrameworkTypeEntry.cs
+++ b/mdoc/Mono.Documentation/Updater/Frameworks/FrameworkTypeEntry.cs
@@ -20,6 +20,17 @@ namespace Mono.Documentation.Updater.Frameworks
public int TimesProcessed { get; set; }
+ public Dictionary<string, bool> AssembliesMemberOf = new Dictionary<string, bool>();
+
+ public void NoteAssembly(AssemblyDefinition noting, AssemblyDefinition source)
+ {
+ bool isForward = noting.Name.Name == source.Name.Name;
+ if (!AssembliesMemberOf.ContainsKey(noting.Name.Name))
+ {
+ AssembliesMemberOf.Add(noting.Name.Name, isForward);
+ }
+ }
+
/// <summary>
/// Returns a list of all corresponding type entries,
/// which have already been processed.
diff --git a/mdoc/mdoc.Test/XmlUpdateTests.cs b/mdoc/mdoc.Test/XmlUpdateTests.cs
index c3bcaa6d..a7746c47 100644
--- a/mdoc/mdoc.Test/XmlUpdateTests.cs
+++ b/mdoc/mdoc.Test/XmlUpdateTests.cs
@@ -8,6 +8,7 @@ using Mono.Cecil;
using System.Collections.Generic;
using Mono.Documentation.Updater.Frameworks;
using Mono.Documentation.Updater;
+using System.Runtime.InteropServices;
namespace mdoc.Test
{
@@ -184,7 +185,7 @@ namespace mdoc.Test
foreach (var it in fx.Frameworks)
{
- var t = it.ProcessType(theType);
+ var t = it.ProcessType(theType, theType.Module.Assembly);
foreach(var m in theType.Methods)
{
t.ProcessMember(m);
@@ -832,7 +833,7 @@ namespace mdoc.Test
{
if (indexCheck(i) || forceAlignment)
{
- var t = f.ProcessType (type);
+ var t = f.ProcessType (type, type.Module.Assembly);
t.ProcessMember (method);
var aset = new AssemblySet (new[] { "one.dll" });
@@ -840,7 +841,7 @@ namespace mdoc.Test
}
else {
- var t = f.ProcessType (type2);
+ var t = f.ProcessType (type2, type2.Module.Assembly);
t.ProcessMember (method2);
}
i++;