Skip to content

Commit e7eb94f

Browse files
authored
Bump Nerdbank.GitVersioning, and net9 compat (#107)
No behavioural changes expected here, but the .NET 9 SDK produces different surfaces, so consumers may find that as they upgrade to .NET 9, they also have to update their tests as we did in this commit.
1 parent 2fd2fef commit e7eb94f

File tree

3 files changed

+33
-20
lines changed

3 files changed

+33
-20
lines changed

ApiSurface/Test/Sample.fs

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module Sample =
5959
]
6060
|> Set.ofList
6161

62-
let allIncludingInternal =
62+
let allIncludingInternalNoDuCases =
6363
[
6464
"T:<StartupCode$ApiSurface-DocumentationSample>.$.NETStandard\,Version=v2.0.AssemblyAttributes"
6565
"T:<StartupCode$ApiSurface-DocumentationSample>.$ApiSurface.DocumentationSample.AssemblyInfo"
@@ -72,14 +72,8 @@ module Sample =
7272
"M:ApiSurface.DocumentationSample.ConsumingModule.somethingElse``2(ApiSurface.DocumentationSample.SomeGenericType{``0,``1},``1)"
7373
"M:ApiSurface.DocumentationSample.ConsumingModule.somethingGeneric``2"
7474
"T:ApiSurface.DocumentationSample.DuWithInternalConstructors"
75-
"T:ApiSurface.DocumentationSample.DuWithInternalConstructors.Bar"
76-
"T:ApiSurface.DocumentationSample.DuWithInternalConstructors.Foo"
7775
"T:ApiSurface.DocumentationSample.DuWithPrivateConstructors"
78-
"T:ApiSurface.DocumentationSample.DuWithPrivateConstructors.Bar"
79-
"T:ApiSurface.DocumentationSample.DuWithPrivateConstructors.Foo"
8076
"T:ApiSurface.DocumentationSample.EnumLikeDu"
81-
"T:ApiSurface.DocumentationSample.EnumLikeDu.Bar"
82-
"T:ApiSurface.DocumentationSample.EnumLikeDu.Foo"
8377
"T:ApiSurface.DocumentationSample.GenericClassWithMethod`1"
8478
"M:ApiSurface.DocumentationSample.GenericClassWithMethod`1.ArrayByRef(`0[]@)"
8579
"M:ApiSurface.DocumentationSample.GenericClassWithMethod`1.IEnumerableByRef(System.Collections.Generic.IEnumerable{`0}@)"
@@ -95,22 +89,15 @@ module Sample =
9589
"P:ApiSurface.DocumentationSample.IndexedProperties`2.Overloaded(System.String,System.Int32)"
9690
"T:ApiSurface.DocumentationSample.ModuleWithType"
9791
"T:ApiSurface.DocumentationSample.ModuleWithType.DU"
98-
"T:ApiSurface.DocumentationSample.ModuleWithType.DU.Case1"
99-
"T:ApiSurface.DocumentationSample.ModuleWithType.DU.Case2"
10092
"T:ApiSurface.DocumentationSample.ModuleWithType.NestedClass`1"
10193
"M:ApiSurface.DocumentationSample.ModuleWithType.NestedClass`1.MethodOnANestedClass(ApiSurface.DocumentationSample.ModuleWithType.NestedClass{`0})"
10294
"M:ApiSurface.DocumentationSample.ModuleWithType.thing``1(ApiSurface.DocumentationSample.ModuleWithType.DU)"
10395
"T:ApiSurface.DocumentationSample.MomentActionsId"
104-
"T:ApiSurface.DocumentationSample.MomentActionsId.MomentActionsIdConstructor"
10596
"T:ApiSurface.DocumentationSample.MyDu"
106-
"T:ApiSurface.DocumentationSample.MyDu.AnotherCase"
107-
"T:ApiSurface.DocumentationSample.MyDu.Fieldless"
108-
"T:ApiSurface.DocumentationSample.MyDu.SomeCase"
10997
"P:ApiSurface.DocumentationSample.MyDu.SomeProperty"
11098
"P:ApiSurface.DocumentationSample.MyDuModule.x"
11199
"P:ApiSurface.DocumentationSample.MyGenericType.myValue"
112100
"T:ApiSurface.DocumentationSample.MyGenericType`1"
113-
"T:ApiSurface.DocumentationSample.MyGenericType`1.SomeCase"
114101
"T:ApiSurface.DocumentationSample.MyModule"
115102
"P:ApiSurface.DocumentationSample.MyModule.myValue"
116103
// Note, for example, that an internal method is visible in the toString. However, it will be ignored
@@ -122,10 +109,7 @@ module Sample =
122109
"T:ApiSurface.DocumentationSample.MyOperators"
123110
"M:ApiSurface.DocumentationSample.MyOperators.op_TwiddleTwiddle(System.Int32)"
124111
"T:ApiSurface.DocumentationSample.MyTinyType"
125-
"T:ApiSurface.DocumentationSample.MyTinyType.MyTinyType"
126112
"T:ApiSurface.DocumentationSample.PrivateDu"
127-
"T:ApiSurface.DocumentationSample.PrivateDu.Bar"
128-
"T:ApiSurface.DocumentationSample.PrivateDu.Foo"
129113
"T:ApiSurface.DocumentationSample.PrivateRecord"
130114
"P:ApiSurface.DocumentationSample.PrivateRecord.PrivateField"
131115
"T:ApiSurface.DocumentationSample.SomeActivePatterns"
@@ -134,7 +118,6 @@ module Sample =
134118
"T:ApiSurface.DocumentationSample.SomeExceptionTypeWithArgs"
135119
"T:ApiSurface.DocumentationSample.SomeGenericType`2"
136120
"M:ApiSurface.DocumentationSample.SomeGenericType`2.SomeGenericMethod``1(`0,ApiSurface.DocumentationSample.SomeGenericType{`0,``0})"
137-
"T:ApiSurface.DocumentationSample.SomeGenericType`2.SomeGenericType"
138121
"T:ApiSurface.DocumentationSample.SomeModule"
139122
"P:ApiSurface.DocumentationSample.SomeModule.Bar"
140123
"P:ApiSurface.DocumentationSample.SomeModule.Foo"
@@ -161,6 +144,30 @@ module Sample =
161144
]
162145
|> Set.ofList
163146

147+
let duCaseTypes =
148+
[
149+
"T:ApiSurface.DocumentationSample.SomeGenericType`2.SomeGenericType"
150+
"T:ApiSurface.DocumentationSample.MyGenericType`1.SomeCase"
151+
"T:ApiSurface.DocumentationSample.MyTinyType.MyTinyType"
152+
"T:ApiSurface.DocumentationSample.PrivateDu.Bar"
153+
"T:ApiSurface.DocumentationSample.PrivateDu.Foo"
154+
"T:ApiSurface.DocumentationSample.DuWithInternalConstructors.Bar"
155+
"T:ApiSurface.DocumentationSample.DuWithInternalConstructors.Foo"
156+
"T:ApiSurface.DocumentationSample.DuWithPrivateConstructors.Bar"
157+
"T:ApiSurface.DocumentationSample.DuWithPrivateConstructors.Foo"
158+
"T:ApiSurface.DocumentationSample.EnumLikeDu.Bar"
159+
"T:ApiSurface.DocumentationSample.EnumLikeDu.Foo"
160+
"T:ApiSurface.DocumentationSample.ModuleWithType.DU.Case1"
161+
"T:ApiSurface.DocumentationSample.ModuleWithType.DU.Case2"
162+
"T:ApiSurface.DocumentationSample.MomentActionsId.MomentActionsIdConstructor"
163+
"T:ApiSurface.DocumentationSample.MyDu.AnotherCase"
164+
"T:ApiSurface.DocumentationSample.MyDu.Fieldless"
165+
"T:ApiSurface.DocumentationSample.MyDu.SomeCase"
166+
]
167+
|> Set.ofList
168+
169+
let allIncludingInternal = Set.union allIncludingInternalNoDuCases duCaseTypes
170+
164171
let publicDocumentedSurface =
165172
[
166173
"T:ApiSurface.DocumentationSample.Class1"

ApiSurface/Test/TestDocCoverage.fs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ module TestDocCoverage =
2323
|> String.concat "\n"
2424
|> failwithf "Unexpectedly received members: %s"
2525

26-
expectedButAbsent |> shouldBeEmpty
26+
// I speculate *wildly* that https://github.com/dotnet/fsharp/pull/17439
27+
// caused DU case types to no longer appear on the API surface.
28+
// In .NET 9, it's fine to for them not to appear; in .NET 8, it's fine for them
29+
// to appear.
30+
// Consumers will see this as a breaking change in the library under test when
31+
// they move to .NET 9, which is correct.
32+
Set.isSubset expectedButAbsent Sample.duCaseTypes |> shouldEqual true
2733

2834
[<Test>]
2935
let ``Test ofAssemblyXml`` () =

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<OtherFlags>$(OtherFlags) --test:GraphBasedChecking --test:ParallelOptimization --test:ParallelIlxGen --warnaserror-:75 --nowarn:75 --parallelreferenceresolution</OtherFlags>
1717
</PropertyGroup>
1818
<ItemGroup>
19-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115" PrivateAssets="all" />
19+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.8.38-alpha" PrivateAssets="all" />
2020
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
2121
<SourceLinkGitHubHost Include="github.com" ContentUrl="https://raw.githubusercontent.com" />
2222
</ItemGroup>

0 commit comments

Comments
 (0)