Skip to content

Commit

Permalink
Feature/dotnet5 (#8)
Browse files Browse the repository at this point in the history
* IsPackable tweaks

* add CoverageInclude

* upgrade to .net 5.0 final

* added nuget.config

* RestorePackagesWithLockFile=true

* added some more test c# 9

* privacy
  • Loading branch information
f2calv authored Nov 11, 2020
1 parent e946618 commit 0bcfb57
Show file tree
Hide file tree
Showing 14 changed files with 3,279 additions and 85 deletions.
5 changes: 4 additions & 1 deletion .azure-pipelines/azure-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ variables:
pool:
vmImage: windows-latest #require windows agent because we have a .NET Framework target

#extends:
# template: pipelines/dotnet.publish.nuget-v1.yml@sharedTemplates
steps:
- template: templates/steps.dotnet.publish.nuget-v3.yml@sharedTemplates
- template: pipelines/dotnet.publish.nuget-v1.yml@sharedTemplates
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
CoverageInclude: '[CasCap.*]*'
gitHubConnection: github.com_f2calv
12 changes: 8 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

<PropertyGroup>
<RootNamespace>CasCap</RootNamespace>
<LangVersion>latest</LangVersion>
<!-- change the default value of IsPackable from true to false, so we must be explicit in setting it -->
<IsPackable>false</IsPackable>
<LangVersion>9.0</LangVersion>
</PropertyGroup>

<PropertyGroup>
<Author>Alex Vincent</Author>
<Email>alexv@microsoft.com</Email>
</PropertyGroup>

<PropertyGroup>
<!-- https://docs.microsoft.com/en-us/dotnet/core/tools/csproj -->
<!-- default for IsPackable is true, we change this to false here so that we must be explicit in each project when creating NuGet packages -->
<IsPackable>false</IsPackable>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This repository is comprised of three .NET projects, these projects are to help
The class library multi-targets the following frameworks;
- .NET Framework 2.7.2
- .NET Standard 2.0
- .NET 5.0.
- .NET 5.0

The library includes references to both Entity Framework 6 and Entity Framework Core along with some compiler directives as an example of how to create a multi-targeted package.

Expand Down
8 changes: 8 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<!-- <add key="int.nuget.org" value="https://int.nuget.org/v3/index.json" /> -->
</packageSources>
</configuration>
5 changes: 2 additions & 3 deletions src/MyPkgLib.Tests/Class1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ public void TestMethod1()
[Fact, Trait("Category", "Performance")]
public void TestMethod2()
{
var obj = new TestClass1();
var hasFailed = false;
bool hasFailed = new();//test some c# 9.0
try
{
obj.ThrowDivideByZeroException();
TestClass1.ThrowDivideByZeroException();
}
catch
{
Expand Down
26 changes: 0 additions & 26 deletions src/MyPkgLib.Tests/MyPkgLib - Backup.Tests.csproj

This file was deleted.

3 changes: 1 addition & 2 deletions src/MyPkgLib.Tests/MyPkgLib.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<RootNamespace>CasCap.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
Expand Down
42 changes: 0 additions & 42 deletions src/MyPkgLib.Tests/coverage.cobertura.xml

This file was deleted.

Loading

0 comments on commit 0bcfb57

Please sign in to comment.