Skip to content

Commit

Permalink
Net6 support (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed May 27, 2021
1 parent 17cce6e commit 2855145
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitattributes
@@ -1,5 +1,6 @@
# Auto detect text files and perform LF normalization
* text eol=crlf
*.json -text

# Custom for Visual Studio
*.cs diff=csharp
Expand Down
2 changes: 1 addition & 1 deletion src/ApprovalTests.MSTest/ApprovalTests.MSTest.csproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net48;net6</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Fody" Version="6.5.1" PrivateAssets="all" />
Expand Down
2 changes: 1 addition & 1 deletion src/ApprovalTests.Tests/ApprovalTests.Tests.csproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net48;net6</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Fody" Version="6.5.1" PrivateAssets="all" />
Expand Down
3 changes: 2 additions & 1 deletion src/ApprovalTests.Tests/Email/EmailTest.cs
Expand Up @@ -28,6 +28,7 @@ public void Testname()
}
}

#if(NET48)
[Test]
public void TestAttachment()
{
Expand All @@ -43,13 +44,13 @@ public void TestAttachment()
EmailApprovals.Verify(message);
}
}
#endif

[Test]
public void TestCollectBoundaries()
{
var text = @"Content-Type: multipart/mixed; boundary=--boundary_1_f3c617c1-4388-492c-8e07-0ef9bdb8af93
----boundary_1_f3c617c1-4388-492c-8e07-0ef9bdb8af93
Content-Type: multipart/alternative; boundary=--boundary_0_283b02d8-4af3-4d14-83bd-6d7181499f83
Expand Down
2 changes: 2 additions & 0 deletions src/ApprovalTests.Tests/RunMaintenance.cs
Expand Up @@ -3,6 +3,7 @@

namespace ApprovalTests.Tests
{
#if(NET48)
[TestFixture]
public class RunMaintenance
{
Expand All @@ -23,4 +24,5 @@ public void EnsureNoAbandonedFiles()
);
}
}
#endif
}
2 changes: 1 addition & 1 deletion src/ApprovalTests.Xunit2/ApprovalTests.Xunit2.csproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net48;net6</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Fody" Version="6.5.1" PrivateAssets="all" />
Expand Down
6 changes: 4 additions & 2 deletions src/ApprovalUtilities.Tests/ApprovalUtilities.Tests.csproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net48;net5;net6</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Fody" Version="6.5.1" PrivateAssets="all" />
Expand All @@ -11,9 +11,11 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<ProjectReference Include="..\ApprovalTests\ApprovalTests.csproj" />
<ProjectReference Include="..\ApprovalUtilities\ApprovalUtilities.csproj" />
<Reference Include="System.Windows.Forms" />
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'net48'">
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) != 'net48'">
<Compile Remove="Reflection\*.*" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/AssembliesExistInBin/AssembliesExistInBin.csproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6</TargetFrameworks>
<!-- no CopyLocalLockFileAssemblies=false. So approvalTests.dll is resolved from bin dir -->
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/AssembliesExistInNuget/AssembliesExistInNuget.csproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6</TargetFrameworks>
<!-- do not copy reference assemblies to bin. So approvalTests.dll is resolved from nuget cache dir -->
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
</PropertyGroup>
Expand Down
29 changes: 22 additions & 7 deletions src/appveyor.yml
@@ -1,10 +1,25 @@
image: Visual Studio 2019
image:
- Visual Studio 2019
#- macOS
#- Ubuntu
build_script:
- ps: >-
dotnet build src\ApprovalUtilities\ApprovalUtilities.csproj --configuration Debug
dotnet build src\ApprovalTests\ApprovalTests.csproj --configuration Debug
dotnet build src --configuration Debug
# https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
- pwsh: |
if ($isWindows) {
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1"
./dotnet-install.ps1 -JSonFile src/global.json -Architecture x64 -InstallDir 'C:\Program Files\dotnet'
}
else {
Invoke-WebRequest "https://dot.net/v1/dotnet-install.sh" -OutFile "./dotnet-install.sh"
sudo chmod u+x dotnet-install.sh
if ($isMacOS) {
sudo ./dotnet-install.sh --jsonfile src/global.json --architecture x64 --install-dir '/usr/local/share/dotnet'
} else {
sudo ./dotnet-install.sh --jsonfile src/global.json --architecture x64 --install-dir '/usr/share/dotnet'
}
}
- dotnet build src --configuration Debug
- dotnet test src --configuration Debug --no-build --no-restore
test: off
artifacts:
- path: nuget_packages\*.nupkg
7 changes: 7 additions & 0 deletions src/global.json
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "6.0.100-preview.4.21255.9",
"allowPrerelease": true,
"rollForward": "latestFeature"
}
}

0 comments on commit 2855145

Please sign in to comment.