Skip to content

Commit eb934bc

Browse files
authored
Merge pull request #559 from mono/develop
🚢 5.8.3
2 parents 24ba59f + d9e2cd4 commit eb934bc

129 files changed

Lines changed: 3475 additions & 459 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
512 Bytes
Binary file not shown.
1.15 MB
Binary file not shown.

mdoc/Consts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Mono.Documentation
33
{
44
public static class Consts
55
{
6-
public static string MonoVersion = "5.8.2";
6+
public static string MonoVersion = "5.8.3";
77
public const string DocId = "DocId";
88
public const string CppCli = "C++ CLI";
99
public const string CppCx = "C++ CX";

mdoc/Makefile

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ Test/DocTest-enumerations.dll:
139139
Test/DocTest-embedded-type.dll:
140140
$(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -debug -optimize -target:library -out:$@ Test/DocTest-embedded-type.cs
141141

142+
Test/DocTest-differentTypeDefinitions-First.dll:
143+
rm -f $@
144+
$(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -debug -optimize -target:library -out:$@ Test/DocTest-differentTypeDefinitions.cs /define:FIRST
145+
146+
Test/DocTest-differentTypeDefinitions-Second.dll:
147+
rm -f $@
148+
$(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -debug -optimize -target:library -out:$@ Test/DocTest-differentTypeDefinitions.cs /define:SECOND
149+
142150
Test/DocTest-typeForwards-First.dll:
143151
rm -f $@
144152
$(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -debug -optimize -target:library -out:$@ Test/DocTest-typeForwards.cs /define:FIRST
@@ -199,6 +207,20 @@ Test/FrameworkTestData-fx-inheritance: Test/DocTest-framework-inheritance-one.dl
199207
cp Test/DocTest-framework-inheritance-three.dll Test/FrameworkTestData-fx-inheritance/Three/
200208
$(MONO) $(PROGRAM) fx-bootstrap Test/FrameworkTestData-fx-inheritance
201209

210+
.PHONY: check-monodocer-differentTypeDefinitions
211+
check-monodocer-differentTypeDefinitions : Test/DocTest-differentTypeDefinitions-First.dll Test/DocTest-differentTypeDefinitions-Second.dll
212+
-rm -Rf Test/en.actual
213+
214+
-rm -Rf Test/FrameworkTestData-fx-differentTypeDefinitions
215+
mkdir Test/FrameworkTestData-fx-differentTypeDefinitions
216+
mkdir Test/FrameworkTestData-fx-differentTypeDefinitions/One
217+
cp Test/DocTest-differentTypeDefinitions-First.dll Test/FrameworkTestData-fx-differentTypeDefinitions/One
218+
cp Test/DocTest-differentTypeDefinitions-Second.dll Test/FrameworkTestData-fx-differentTypeDefinitions/One
219+
$(MONO) $(PROGRAM) fx-bootstrap Test/FrameworkTestData-fx-differentTypeDefinitions
220+
221+
$(MONO) $(PROGRAM) update -o Test/en.actual -frameworks Test/FrameworkTestData-fx-differentTypeDefinitions
222+
$(DIFF) Test/en.expected.differentTypeDefinitions Test/en.actual
223+
202224
.PHONY: check-monodocer-typeForwards
203225
check-monodocer-typeForwards : Test/DocTest-typeForwards-First.dll Test/DocTest-typeForwards-Second.dll Test/DocTest-typeForwards-Third.dll
204226
-rm -Rf Test/en.actual
@@ -726,6 +748,9 @@ check-monodocer-attached-entities:
726748
Test/TestClass.dll:
727749
$(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -debug -optimize -target:library -out:$@ mdoc.Test/SampleClasses/Test*.cs
728750

751+
Test/GuidClass.dll:
752+
$(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -debug -optimize -target:library -out:$@ mdoc.Test/SampleClasses/GuidClass.cs
753+
729754
.PHONY: check-monodocer-operators-work
730755
check-monodocer-operators-work: Test/TestClass.dll
731756
rm -Rf Test/en.actual
@@ -742,6 +767,11 @@ check-monodocer-operators-update: check-monodocer-operators-work
742767
rm -Rf Test/en.expected-operators
743768
mv Test/en.actual Test/en.expected-operators
744769

770+
check-monodocer-guid: Test/GuidClass.dll
771+
rm -Rf Test/en.actual
772+
$(MONO) $(PROGRAM) update -o Test/en.actual Test/GuidClass.dll -lang c++/cx -lang c++/winrt
773+
$(DIFF) Test/en.expected-guid Test/en.actual
774+
745775
check-mdoc-export-html-update:
746776
find Test/html.expected -name \*.html -exec rm "{}" \;
747777
$(MONO) $(PROGRAM) export-html -o Test/html.expected \
@@ -827,6 +857,7 @@ run-test-local: check-doc-tools
827857
run-test-update : check-doc-tools-update
828858

829859
check-doc-tools: \
860+
check-monodocer-differentTypeDefinitions \
830861
check-monodocer-typeForwards \
831862
check-monodocer-nestedType-typeForwards \
832863
check-monodocer-Eii-importslashdoc \
@@ -856,6 +887,7 @@ check-doc-tools: \
856887
check-monodocer-frameworks-inheritance \
857888
check-monodocer-docid \
858889
check-monodocer-operators \
890+
check-monodocer-guid \
859891
check-monodocer-fx-statistics-remove \
860892
check-overwrite-attribute \
861893
check-monodocer-vbnet \
@@ -887,5 +919,5 @@ check-doc-tools-update: check-monodocer-since-update \
887919
check-mdoc-export-msxdoc-update \
888920
check-mdoc-validate-update
889921

890-
check: nunit check-doc-tools
922+
check: nunit check-doc-tools
891923
@echo "mdoc Tests Complete!"

mdoc/Mono.Documentation/MDocUpdater.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ public override void Run (IEnumerable<string> args)
320320
if (File.Exists(typeMapPath))
321321
{
322322
Console.WriteLine($"Loading typemap file at {typeMapPath}");
323+
if (!Directory.Exists(srcPath))
324+
Directory.CreateDirectory(srcPath);
325+
File.Copy(typeMapPath, Path.Combine(srcPath, "TypeMap.xml"), true);
323326
TypeMap map = TypeMap.FromXml(typeMapPath);
324327
this.TypeMap = map;
325328
FormatterManager.UpdateTypeMap(map);
@@ -2451,7 +2454,6 @@ private void UpdateMember (DocsNodeInfo info, FrameworkTypeEntry typeEntry, Dict
24512454

24522455
info.Node = WriteElement (me, "Docs");
24532456
MakeDocNode (info, typeEntry.Framework.Importers, typeEntry);
2454-
24552457

24562458
foreach (MemberFormatter f in FormatterManager.MemberFormatters)
24572459
{
@@ -3870,9 +3872,22 @@ public static void MakeAttributes(
38703872
NormalizeWhitespace(e);
38713873
}
38723874

3875+
private bool ProcessedMoreThanOnce(FrameworkTypeEntry typeEntry)
3876+
{
3877+
if (typeEntry.TimesProcessed <= 1)
3878+
{
3879+
return false;
3880+
}
3881+
else
3882+
{
3883+
var assemblies = this.assemblies.Where(a => a.Name == typeEntry.Framework.Name).ToList();
3884+
return assemblies.Any(a => a.IsTypeForwardingTo(typeEntry));
3885+
}
3886+
}
3887+
38733888
public void MakeParameters (XmlElement root, MemberReference member, IList<ParameterDefinition> parameters, FrameworkTypeEntry typeEntry, ref bool fxAlternateTriggered, bool shouldDuplicateWithNew = false)
38743889
{
3875-
if (typeEntry.TimesProcessed > 1)
3890+
if (ProcessedMoreThanOnce(typeEntry))
38763891
return;
38773892

38783893
XmlElement e = WriteElement (root, "Parameters");
@@ -4407,9 +4422,9 @@ private static string GetDocTypeName (TypeReference type, bool useTypeProjection
44074422
return docTypeFormatter.GetName (type, useTypeProjection: useTypeProjection);
44084423
}
44094424

4410-
internal static string GetDocTypeFullName (TypeReference type, bool useTypeProjection = true)
4425+
internal static string GetDocTypeFullName (TypeReference type, bool useTypeProjection = true, bool isTypeofOperator = false)
44114426
{
4412-
return DocTypeFullMemberFormatter.Default.GetName (type, useTypeProjection: useTypeProjection);
4427+
return DocTypeFullMemberFormatter.Default.GetName (type, useTypeProjection: useTypeProjection, isTypeofOperator: isTypeofOperator);
44134428
}
44144429

44154430
internal static string GetXPathForMember (DocumentationMember member)

mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/ApplePlatformEnumFormatter.cs

Lines changed: 0 additions & 95 deletions
This file was deleted.

mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
using Mono.Documentation.Util;
33
using System;
44
using System.Collections.Generic;
5-
using System.IO;
65
using System.Linq;
76

87
namespace Mono.Documentation.Updater.Formatters
98
{
109
public class AttributeFormatter
1110
{
11+
private AttributeValueFormatter valueFormatter = new AttributeValueFormatter();
12+
1213
public virtual string PrefixBrackets { get; } = "";
1314
public virtual string SurfixBrackets { get; } = "";
1415
public virtual string Language { get; } = "";
@@ -119,37 +120,9 @@ protected virtual string MakeNamedArgumentString(string name, string value)
119120
return $"{name}={value}";
120121
}
121122

122-
public virtual string MakeAttributesValueString(object v, TypeReference valueType)
123+
public virtual string MakeAttributesValueString(object argumentValue, TypeReference argumentType)
123124
{
124-
var formatters = new[] {
125-
new AttributeValueFormatter (),
126-
new ApplePlatformEnumFormatter (),
127-
new StandardFlagsEnumFormatter (),
128-
new DefaultAttributeValueFormatter (),
129-
};
130-
131-
ResolvedTypeInfo type = new ResolvedTypeInfo(valueType);
132-
133-
if (valueType is ArrayType && v is CustomAttributeArgument[])
134-
{
135-
ArrayType atype = valueType as ArrayType;
136-
CustomAttributeArgument[] args = v as CustomAttributeArgument[];
137-
var returnvalue = $"new {atype.FullName}{(atype.FullName.EndsWith("[]") ? "" : "[]")} {{ { string.Join(", ", args.Select(a => MakeAttributesValueString(a.Value, a.Type)).ToArray()) } }}";
138-
return returnvalue;
139-
}
140-
141-
foreach (var formatter in formatters)
142-
{
143-
string formattedValue;
144-
if (formatter.TryFormatValue(v, type, out formattedValue))
145-
{
146-
return formattedValue;
147-
}
148-
}
149-
150-
// this should never occur because the DefaultAttributeValueFormatter will always
151-
// successfully format the value ... but this is needed to satisfy the compiler :)
152-
throw new InvalidDataException(string.Format("Unable to format attribute value ({0})", v.ToString()));
125+
return valueFormatter.Format(argumentType, argumentValue);
153126
}
154127

155128
private bool IsIgnoredAttribute(CustomAttribute customAttribute)

0 commit comments

Comments
 (0)