Skip to content

Commit

Permalink
Exclude CollectionsExtensions class from Microsoft.Extensions.Depende… (
Browse files Browse the repository at this point in the history
#709)

…ncyModel.dll (#708)

* Apply workaround to exclude one type from one dll

* update
  • Loading branch information
huangmin-ms authored Aug 29, 2024
2 parents c3d713f + 3944f3b commit 97940aa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion mdoc/Consts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Mono.Documentation
{
public static class Consts
{
public static string MonoVersion = "5.9.3.4";
public static string MonoVersion = "5.9.3.5";
public const string DocId = "DocId";
public const string CppCli = "C++ CLI";
public const string CppCx = "C++ CX";
Expand Down
17 changes: 3 additions & 14 deletions mdoc/Mono.Documentation/MDocUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,15 +409,9 @@ public override void Run (IEnumerable<string> args)
{
var a = cacheIndex.StartProcessingAssembly(assemblySet, assembly, assemblySet.Importers, assemblySet.Id, assemblySet.Version);

foreach (var type in assembly.GetTypes().Where(t => DocUtils.IsPublic(t)))
foreach (var type in assembly.GetTypes().Where(t => DocUtils.IsPublic(t) && !DocUtils.IsIgnored(t)))
{
var t = a.ProcessType(type, assembly);

// Workaround for https://dev.azure.com/ceapex/Engineering/_workitems/edit/990897
if (t.Name == "System.Collections.Generic.CollectionExtensions" && assembly.MainModule.Name == "Microsoft.Extensions.DependencyModel.dll")
{
continue;
}
foreach (var member in type.GetMembers().Where(i => !DocUtils.IsIgnored(i) && IsMemberNotPrivateEII(i)))
t.ProcessMember(member);
}
Expand Down Expand Up @@ -838,7 +832,7 @@ public string DoUpdateType (AssemblySet set, AssemblyDefinition assembly, TypeDe
if (type.Namespace == null)
Warning ("warning: The type `{0}' is in the root namespace. This may cause problems with display within monodoc.",
type.FullName);
if (!DocUtils.IsPublic (type))
if (!DocUtils.IsPublic (type) || DocUtils.IsIgnored(type))
return null;

if (type.HasCustomAttributes && CustomAttributeNamesToSkip.All(x => type.CustomAttributes.Any(y => y.AttributeType.FullName == x)))
Expand Down Expand Up @@ -1133,16 +1127,11 @@ private void DoUpdateAssembly (AssemblySet assemblySet, AssemblyDefinition assem
foreach (TypeDefinition type in docEnum.GetDocumentationTypes (assembly, null))
{
string typename = GetTypeFileName (type);
if (!DocUtils.IsPublic (type) || typename.IndexOfAny (InvalidFilenameChars) >= 0)
if (!DocUtils.IsPublic (type) || DocUtils.IsIgnored(type) || typename.IndexOfAny (InvalidFilenameChars) >= 0)
continue;

var typeEntry = frameworkEntry.ProcessType (type, assembly);

// Workaround for https://dev.azure.com/ceapex/Engineering/_workitems/edit/990897
if (typeEntry.Name == "System.Collections.Generic.CollectionExtensions" && assembly.MainModule.Name == "Microsoft.Extensions.DependencyModel.dll")
{
continue;
}
string reltypepath = DoUpdateType (assemblySet, assembly, type, typeEntry, source, dest);
if (reltypepath == null)
continue;
Expand Down
6 changes: 6 additions & 0 deletions mdoc/Mono.Documentation/Updater/DocUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,12 @@ public static string GetStringForXPath(string input)
return input;
}

public static bool IsIgnored(TypeDefinition type)
{
// Workaround for https://dev.azure.com/ceapex/Engineering/_workitems/edit/990897
return type.FullName == "System.Collections.Generic.CollectionExtensions" && type.Module.Name == "Microsoft.Extensions.DependencyModel.dll";
}

/// <summary>
/// No documentation for property/event accessors.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion mdoc/mdoc.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>mdoc</id>
<version>5.9.3.4</version>
<version>5.9.3.5</version>
<title>mdoc</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
Expand Down

0 comments on commit 97940aa

Please sign in to comment.