Skip to content

Commit 99c619a

Browse files
authored
housekeeping: add .net core 3.0 support (#349)
1 parent 1a00028 commit 99c619a

30 files changed

+1375
-16
lines changed

azure-pipelines.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ resources:
1616
endpoint: reactiveui
1717

1818
jobs:
19-
- template: Azure/azure-pipelines.yml@templates # Template reference
19+
- template: Azure/azure-pipelines.yml@templates # Template reference
20+
parameters:
21+
dotNetVersion: '3.0.100-preview6-012264'
22+
runMacBuild: false
23+

build.cake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#load nuget:https://www.myget.org/F/reactiveui/api/v2?package=ReactiveUI.Cake.Recipe&prerelease
1+
#load nuget:https://www.myget.org/F/reactiveui?package=ReactiveUI.Cake.Recipe&prerelease
22

33
Environment.SetVariableNames();
44

@@ -33,6 +33,6 @@ BuildParameters.SetParameters(context: Context,
3333
artifactsDirectory: "./artifacts",
3434
sourceDirectory: "./src");
3535

36-
ToolSettings.SetToolSettings(context: Context);
36+
ToolSettings.SetToolSettings(context: Context, usePrereleaseMsBuild: true);
3737

3838
Build.Run();

src/Directory.build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</PropertyGroup>
3737

3838
<ItemGroup Condition="$(IsTestProject)">
39-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
39+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
4040
<PackageReference Include="xunit" Version="2.4.1" />
4141
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
4242
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
@@ -68,8 +68,8 @@
6868

6969
<ItemGroup>
7070
<PackageReference Include="stylecop.analyzers" Version="1.1.118" PrivateAssets="all" />
71+
<PackageReference Include="Roslynator.Analyzers" Version="2.1.0" PrivateAssets="All" />
7172
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" PrivateAssets="all" />
72-
<PackageReference Include="Roslynator.Analyzers" Version="2.1.0-rc" PrivateAssets="All" />
7373
<PackageReference Condition="'$(OS)' == 'Windows_NT'" Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.3" PrivateAssets="all" />
7474
</ItemGroup>
7575
<ItemGroup>

src/Directory.build.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<DefineConstants>$(DefineConstants);NET_45;XAML</DefineConstants>
88
</PropertyGroup>
99
<PropertyGroup Condition="$(TargetFramework.StartsWith('uap'))">
10+
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
1011
<DefineConstants>$(DefineConstants);NETFX_CORE;XAML;WINDOWS_UWP</DefineConstants>
1112
</PropertyGroup>
1213
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.iOS'))">

src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
55
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net472</TargetFrameworks>
66

77
<IsPackable>false</IsPackable>

src/Splat.DryIoc.Tests/Splat.DryIoc.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
55
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net472</TargetFrameworks>
66
<NoWarn>$(NoWarn);1591;CA1707;SA1633</NoWarn>
77
</PropertyGroup>

src/Splat.SimpleInjector.Tests/Splat.SimpleInjector.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
55
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net472</TargetFrameworks>
66
<NoWarn>$(NoWarn);1591;CA1707;SA1633</NoWarn>
77
</PropertyGroup>

src/Splat.Tests/API/ApiApprovalTests.SplatProject.netcoreapp3.0.approved.txt

Lines changed: 893 additions & 0 deletions
Large diffs are not rendered by default.

src/Splat.Tests/API/ApiApprovalTests.cs

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// See the LICENSE file in the project root for full license information.
55

66
using System;
7+
using System.Diagnostics;
78
using System.Diagnostics.CodeAnalysis;
89
using System.IO;
910
using System.Linq;
@@ -42,14 +43,45 @@ private static void CheckApproval(Assembly assembly, [CallerMemberName]string me
4243
var approvedFileName = Path.Combine(sourceDirectory, $"ApiApprovalTests.{memberName}.{targetFrameworkName}.approved.txt");
4344
var receivedFileName = Path.Combine(sourceDirectory, $"ApiApprovalTests.{memberName}.{targetFrameworkName}.received.txt");
4445

45-
var approvedPublicApi = File.ReadAllText(approvedFileName);
46+
string approvedPublicApi = string.Empty;
47+
48+
if (File.Exists(approvedFileName))
49+
{
50+
approvedPublicApi = File.ReadAllText(approvedFileName);
51+
}
4652

4753
var receivedPublicApi = Filter(ApiGenerator.GeneratePublicApi(assembly));
4854

4955
if (!string.Equals(receivedPublicApi, approvedPublicApi, StringComparison.InvariantCulture))
5056
{
5157
File.WriteAllText(receivedFileName, receivedPublicApi);
52-
ShouldlyConfiguration.DiffTools.GetDiffTool().Open(receivedFileName, approvedFileName, true);
58+
try
59+
{
60+
ShouldlyConfiguration.DiffTools.GetDiffTool().Open(receivedFileName, approvedFileName, true);
61+
}
62+
catch (ShouldAssertException)
63+
{
64+
var process = new Process
65+
{
66+
StartInfo = new ProcessStartInfo
67+
{
68+
Arguments = $"\"{approvedFileName}\" \"{receivedFileName}\"",
69+
UseShellExecute = false,
70+
RedirectStandardOutput = true,
71+
CreateNoWindow = true
72+
}
73+
};
74+
#if NET_461
75+
process.StartInfo.FileName = "FC";
76+
#else
77+
process.StartInfo.FileName = "diff";
78+
#endif
79+
process.Start();
80+
string output = process.StandardOutput.ReadToEnd();
81+
process.WaitForExit();
82+
83+
throw new Exception("Invalid API configuration: " + Environment.NewLine + output);
84+
}
5385
}
5486

5587
Assert.Equal(approvedPublicApi, receivedPublicApi);

src/Splat.Tests/Splat.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.1;MonoAndroid81</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.0;MonoAndroid81</TargetFrameworks>
55
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net472</TargetFrameworks>
66
<NoWarn>$(NoWarn);1591;CA1707;SA1633</NoWarn>
77
</PropertyGroup>

0 commit comments

Comments
 (0)