Skip to content

Commit 7a2b774

Browse files
committed
Update .NET versions and project configurations
- Set `NetCurrent` to `net9.0` and `NetMinimum` to `net8.0` in `Directory.Build.props`. - Updated SDK version in `global.json` to `9.0.202`. - Changed target frameworks in `coverlet.collector.csproj`, `coverlet.console.csproj`, `coverlet.core.csproj`, and `coverlet.msbuild.tasks.csproj` to support multiple frameworks. - Modified `CoverletToolsPath` in `Directory.Build.targets` to include `netstandard2.0`. - Updated coverage file naming in `Msbuild.cs` to reflect the build target framework.
1 parent ee6d285 commit 7a2b774

File tree

8 files changed

+11
-8
lines changed

8 files changed

+11
-8
lines changed

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<Project>
33
<PropertyGroup>
44
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
5+
<NetCurrent>net9.0</NetCurrent>
6+
<NetMinimum>net8.0</NetMinimum>
7+
<FullFrameworkTFM>net472</FullFrameworkTFM>
58
<!-- enforce CamelCase case string-->
69
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
710
<!-- SourceLink Setup -->

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "8.0.113"
3+
"version": "9.0.202"
44
}
55
}

src/coverlet.collector/coverlet.collector.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netstandard2.0</TargetFramework>
3+
<TargetFrameworks>$(NetMinimum);netstandard2.0</TargetFrameworks>
44
<AssemblyTitle>coverlet.collector</AssemblyTitle>
55
<DevelopmentDependency>true</DevelopmentDependency>
66
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

src/coverlet.console/coverlet.console.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFrameworks>$(NetCurrent);$(NetMinimum)</TargetFrameworks>
66
<ToolCommandName>coverlet</ToolCommandName>
77
<PackAsTool>true</PackAsTool>
88
<AssemblyTitle>coverlet.console</AssemblyTitle>

src/coverlet.core/coverlet.core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
5+
<TargetFrameworks>$(NetMinimum);netstandard2.0</TargetFrameworks>
66
<IsPackable>false</IsPackable>
77
<NoWarn>$(NoWarn);IDE0057</NoWarn>
88
</PropertyGroup>

src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFramework>netstandard2.0</TargetFramework>
5+
<TargetFrameworks>netstandard2.0;$(NetCurrent)</TargetFrameworks>
66
<AssemblyTitle>coverlet.msbuild.tasks</AssemblyTitle>
77
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
88
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs</TargetsForTfmSpecificContentInPackage>

test/Directory.Build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
This is required when the coverlet.msbuild imports are made in their src directory
1515
(so that msbuild eval works even before they are built)
1616
so that they can still find the tooling that will be built by the build. -->
17-
<!--<CoverletToolsPath>$(RepoRoot)artifacts\bin\coverlet.msbuild.tasks\$(Configuration.ToLowerInvariant())_netstandard2.0\</CoverletToolsPath>-->
18-
<CoverletToolsPath>$(RepoRoot)artifacts\bin\coverlet.msbuild.tasks\$(Configuration.ToLower())\</CoverletToolsPath>
17+
<CoverletToolsPath>$(RepoRoot)artifacts\bin\coverlet.msbuild.tasks\$(Configuration.ToLowerInvariant())_netstandard2.0\</CoverletToolsPath>
18+
<!--<CoverletToolsPath>$(RepoRoot)artifacts\bin\coverlet.msbuild.tasks\$(Configuration.ToLower())\</CoverletToolsPath>-->
1919
</PropertyGroup>
2020
</When>
2121
</Choose>

test/coverlet.integration.tests/Msbuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void TestMsbuild()
4646
Assert.Equal(0, result);
4747
Assert.Contains("Passed!", standardOutput, StringComparison.Ordinal);
4848
Assert.Contains("| coverletsamplelib.integration.template | 100% | 100% | 100% |", standardOutput, StringComparison.Ordinal);
49-
string coverageFileName = $"coverage.json";
49+
string coverageFileName = $"coverage.{_buildTargetFramework}.json";
5050
Assert.True(File.Exists(Path.Combine(clonedTemplateProject.ProjectRootPath, coverageFileName)));
5151
AssertCoverage(clonedTemplateProject, coverageFileName);
5252
}

0 commit comments

Comments
 (0)