Skip to content

Commit c8a15bf

Browse files
authored
[mdoc] Multitarget net471 and net6.0 (#639)
Adds `net6.0` as a target framework to mdoc. The artifacts from the `net6.0` build will be output to `bin/$(Configuration)-net6.0`. Mono.Cecil has been bumped from `0.10.0-beta5` to `0.10.0`. This update appears to have introduced a change in behavior in F# doc generation, and the expected output in `PatternMatchingExamples.xml` has been updated to reflect that. The mdoc NuGet package has been updated to include both `net471` and `net6.0` tools. This can be considered a breaking change, as the path of mdoc.exe has been changed to include a folder named after its target framework.
1 parent 461da7b commit c8a15bf

19 files changed

+128
-52
lines changed

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<Project>
22
<PropertyGroup>
33
<NuGetVersionFSharpCore>4.3.4</NuGetVersionFSharpCore>
4-
<NuGetVersionMonoCecil>0.10.0-beta5</NuGetVersionMonoCecil>
4+
<NuGetVersionMonoCecil>0.10.0</NuGetVersionMonoCecil>
55
<NuGetVersionNUnit>3.10.1</NuGetVersionNUnit>
6-
<NuGetVersionNUnit3TestAdapter>3.13.0</NuGetVersionNUnit3TestAdapter>
6+
<NuGetVersionNUnit3TestAdapter>3.17.0</NuGetVersionNUnit3TestAdapter>
7+
<NuGetVersionMicrosoftNETTestSdk>16.11.0</NuGetVersionMicrosoftNETTestSdk>
78
<NuGetVersionQuickIONET>2.6.2.0</NuGetVersionQuickIONET>
89
<NuGetVersionSharpZipLib>1.3.3</NuGetVersionSharpZipLib>
910
<NuGetVersionSystemConfigurationConfigurationManager>6.0.0</NuGetVersionSystemConfigurationConfigurationManager>

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
MSBUILD = msbuild
21
CONFIGURATION = Release
32
BIN = bin/$(CONFIGURATION)
43
MDOC = $(BIN)/mdoc.exe
@@ -9,15 +8,15 @@ all: build
98
build: $(MDOC)
109

1110
$(MDOC):
12-
$(MSBUILD) apidoctools.sln /p:Configuration=$(CONFIGURATION);
11+
dotnet build -v:n apidoctools.sln /p:Configuration=$(CONFIGURATION)
1312

1413
prepare:
1514
git submodule update --init --recursive
16-
nuget restore apidoctools.sln
15+
dotnet restore apidoctools.sln
1716
nuget install NUnit.Console -version 3.6.0 -NoCache -o packages
1817

1918
clean:
20-
#$(MSBUILD) apidoctools.sln /t:clean
19+
dotnet build -v:n apidoctools.sln /t:clean /p:Configuration=$(CONFIGURATION)
2120
rm -rf bin/$(CONFIGURATION)
2221

2322
check: build check-monodoc check-mdoc

azure-pipelines.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,26 @@ stages:
9595
- task: NuGetToolInstaller@1
9696
displayName: Install NuGet Tool
9797

98-
- task: Bash@3
99-
displayName: Run Unit and Integration Tests
100-
inputs:
101-
targetType: 'inline'
102-
script: 'make prepare all check CONFIGURATION=$(buildConfiguration)'
103-
10498
- task: UseDotNet@2
10599
displayName: 'Use .NET Core sdk'
106100
inputs:
107101
packageType: sdk
108102
version: 2.1.x
109103
installationPath: $(Agent.ToolsDirectory)/dotnet
110104

105+
- task: UseDotNet@2
106+
displayName: 'Use .NET 6.0.x'
107+
inputs:
108+
packageType: sdk
109+
version: 6.0.x
110+
installationPath: $(Agent.ToolsDirectory)/dotnet
111+
112+
- task: Bash@3
113+
displayName: Run Unit and Integration Tests
114+
inputs:
115+
targetType: 'inline'
116+
script: 'make prepare all check CONFIGURATION=$(buildConfiguration)'
117+
111118
- task: EsrpCodeSigning@1
112119
displayName: Sign executable and dll files
113120
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))

mdoc/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ cleanup:
6161
nunit:
6262
mono ../packages/NUnit.ConsoleRunner.3.6.0/tools/nunit3-console.exe mdoc.Test/bin/$(CONFIGURATION)/mdoc.Test.dll
6363

64+
dotnet-test:
65+
dotnet test mdoc.Test/bin/$(CONFIGURATION)-net6.0/mdoc.Test.dll
66+
6467
Test/DocTest-VB-Eii.dll:
6568
$(VBCOMPILE) -out:Test/DocTest-VB-Eii.dll Test/ClassEnumerator.vb
6669

@@ -960,5 +963,5 @@ check-doc-tools-update: check-monodocer-since-update \
960963
check-mdoc-export-msxdoc-update \
961964
check-mdoc-validate-update
962965

963-
check: nunit check-doc-tools
966+
check: nunit dotnet-test check-doc-tools
964967
@echo "mdoc Tests Complete!"

mdoc/Mono.Documentation/Updater/Frameworks/MDocResolver.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,10 @@ static string GetCurrentMonoGac()
564564

565565
internal AssemblyDefinition GetAssemblyInGac(AssemblyNameReference reference, ReaderParameters parameters)
566566
{
567+
#if NETCOREAPP
568+
return null;
569+
#endif //NETCOREAPP
570+
567571
if (reference.PublicKeyToken == null || reference.PublicKeyToken.Length == 0)
568572
return null;
569573

mdoc/Test/en.expected-fsharp/PatternMatching/PatternMatchingExamples.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@
161161
</Docs>
162162
</Member>
163163
<Member MemberName="detectZeroTuple">
164-
<MemberSignature Language="C#" Value="public static void detectZeroTuple (int point_0, int point_1);" />
165-
<MemberSignature Language="ILAsm" Value=".method public static void detectZeroTuple(int32 point_0, int32 point_1) cil managed" />
166-
<MemberSignature Language="F#" Value="PatternMatching.PatternMatchingExamples.detectZeroTuple : int * int -&gt; unit" Usage="PatternMatching.PatternMatchingExamples.detectZeroTuple (point_0, point_1)" />
164+
<MemberSignature Language="C#" Value="public static void detectZeroTuple (int var1, int var2);" />
165+
<MemberSignature Language="ILAsm" Value=".method public static void detectZeroTuple(int32 var1, int32 var2) cil managed" />
166+
<MemberSignature Language="F#" Value="PatternMatching.PatternMatchingExamples.detectZeroTuple : int * int -&gt; unit" Usage="PatternMatching.PatternMatchingExamples.detectZeroTuple (var1, var2)" />
167167
<MemberType>Method</MemberType>
168168
<AssemblyInfo>
169169
<AssemblyVersion>1.0.0.0</AssemblyVersion>
@@ -172,12 +172,12 @@
172172
<ReturnType>System.Void</ReturnType>
173173
</ReturnValue>
174174
<Parameters>
175-
<Parameter Name="point_0" Type="System.Int32" />
176-
<Parameter Name="point_1" Type="System.Int32" />
175+
<Parameter Name="var1" Type="System.Int32" />
176+
<Parameter Name="var2" Type="System.Int32" />
177177
</Parameters>
178178
<Docs>
179-
<param name="point_0">To be added.</param>
180-
<param name="point_1">To be added.</param>
179+
<param name="var1">To be added.</param>
180+
<param name="var2">To be added.</param>
181181
<summary>To be added.</summary>
182182
<remarks>To be added.</remarks>
183183
</Docs>
@@ -226,9 +226,9 @@
226226
</Docs>
227227
</Member>
228228
<Member MemberName="function1">
229-
<MemberSignature Language="C#" Value="public static void function1 (int x_0, int x_1);" />
230-
<MemberSignature Language="ILAsm" Value=".method public static void function1(int32 x_0, int32 x_1) cil managed" />
231-
<MemberSignature Language="F#" Value="PatternMatching.PatternMatchingExamples.function1 : int * int -&gt; unit" Usage="PatternMatching.PatternMatchingExamples.function1 (x_0, x_1)" />
229+
<MemberSignature Language="C#" Value="public static void function1 (int var1, int var2);" />
230+
<MemberSignature Language="ILAsm" Value=".method public static void function1(int32 var1, int32 var2) cil managed" />
231+
<MemberSignature Language="F#" Value="PatternMatching.PatternMatchingExamples.function1 : int * int -&gt; unit" Usage="PatternMatching.PatternMatchingExamples.function1 (var1, var2)" />
232232
<MemberType>Method</MemberType>
233233
<AssemblyInfo>
234234
<AssemblyVersion>1.0.0.0</AssemblyVersion>
@@ -237,12 +237,12 @@
237237
<ReturnType>System.Void</ReturnType>
238238
</ReturnValue>
239239
<Parameters>
240-
<Parameter Name="x_0" Type="System.Int32" />
241-
<Parameter Name="x_1" Type="System.Int32" />
240+
<Parameter Name="var1" Type="System.Int32" />
241+
<Parameter Name="var2" Type="System.Int32" />
242242
</Parameters>
243243
<Docs>
244-
<param name="x_0">To be added.</param>
245-
<param name="x_1">To be added.</param>
244+
<param name="var1">To be added.</param>
245+
<param name="var2">To be added.</param>
246246
<summary>To be added.</summary>
247247
<remarks>To be added.</remarks>
248248
</Docs>

mdoc/Test/en.expected-fsharp/index.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
<Attribute>
3636
<AttributeName>System.Reflection.AssemblyTrademark("")</AttributeName>
3737
</Attribute>
38-
<Attribute>
39-
<AttributeName>System.Reflection.AssemblyVersion("1.0.0.0")</AttributeName>
40-
</Attribute>
4138
<Attribute>
4239
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
4340
</Attribute>

mdoc/mdoc.Test/CppCxFormatterMembersTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
using mdoc.Test.SampleClasses;
22
using Mono.Documentation.Updater.Formatters.CppFormatters;
3-
using Mono_DocTest;
43
using NUnit.Framework;
4+
#if !NETCOREAPP
5+
using Mono_DocTest;
56
using Cpp = Mono_DocTest_Generic;
7+
#endif // !NETCOREAPP
68

79
namespace mdoc.Test
810
{
11+
#if !NETCOREAPP
912
[TestFixture]
1013
[Category("CppCx")]
1114
public class CppCxFormatterMembersTests : BasicFormatterTests<CppCxFullMemberFormatter>
@@ -194,6 +197,7 @@ public void NoSupport_GenericMethodInUwp()
194197
TestMethodSignature(typeof(Cpp.GenericBase<>), null, "BaseMethod2");
195198
}
196199
}
200+
#endif //!NETCOREAPP
197201

198202
}
199203

mdoc/mdoc.Test/CppCxFormatterTypesTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
using System;
22
using Mono.Cecil;
33
using Mono.Documentation.Updater.Formatters.CppFormatters;
4+
#if !NETCOREAPP
45
using Mono_DocTest;
56
using Mono_DocTest_Generic;
7+
#endif //!NETCOREAPP
68
using NUnit.Framework;
79

810
namespace mdoc.Test
911
{
12+
#if !NETCOREAPP
13+
1014
[TestFixture]
1115
[Category("CppCx")]
1216
public class CppCxFormatterTypesTests : BasicFormatterTests<CppCxMemberFormatter>
@@ -259,5 +263,8 @@ public void TearDown()
259263
moduleCash.Clear();
260264
}
261265
}
266+
267+
#endif //!NETCOREAPP
268+
262269
}
263270

mdoc/mdoc.Test/CppFormatterTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
using Mono.Cecil;
33
using NUnit.Framework;
44
using Mono.Documentation.Updater.Formatters.CppFormatters;
5+
#if !NETCOREAPP
56
using Mono_DocTest_Generic;
67
using Mono_DocTest;
8+
#endif //!NETCOREAPP
79

810
namespace mdoc.Test
911
{
12+
#if !NETCOREAPP
1013
public class CppFormatterTests : BasicFormatterTests<CppMemberFormatter>
1114
{
1215
#region Types
@@ -191,4 +194,6 @@ protected override TypeDefinition GetType(Type type)
191194
}
192195

193196
}
197+
#endif //!NETCOREAPP
198+
194199
}

0 commit comments

Comments
 (0)