Skip to content

Commit be263ea

Browse files
authored
Merge pull request #355 from tonerdo/target-framework-fix
Target framework fix
2 parents 5f1bb22 + 7597cf4 commit be263ea

File tree

7 files changed

+12
-31
lines changed

7 files changed

+12
-31
lines changed

build.proj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@
33
<PropertyGroup>
44
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
55
<OutputPath>$(MSBuildThisFileDirectory)build\$(Configuration)</OutputPath>
6-
7-
<!-- AppVeyor workaround for https://github.com/dotnet/sdk/issues/335 -->
8-
<TargetFrameworkOverride Condition="'$(APPVEYOR_BUILD_WORKER_IMAGE)' == 'Ubuntu'">-f netcoreapp2.0</TargetFrameworkOverride>
96
</PropertyGroup>
107

118
<Target Name="BuildAllProjects">
129
<RemoveDir Directories="$(OutputPath)" Condition="Exists('$(MSBuildThisFileDirectory)\build')" />
13-
<Exec Command="dotnet build &quot;$(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj&quot; -c $(Configuration) $(TargetFrameworkOverride)" />
10+
<Exec Command="dotnet build &quot;$(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj&quot; -c $(Configuration)" />
1411
<Exec Command="dotnet build &quot;$(MSBuildThisFileDirectory)src\coverlet.console\coverlet.console.csproj&quot; -c $(Configuration)" />
1512
</Target>
1613

1714
<Target Name="PublishMSBuildTaskProject" AfterTargets="BuildAllProjects">
18-
<Exec Command="dotnet publish &quot;$(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj&quot; -c $(Configuration) -f netcoreapp2.0 -o &quot;$(OutputPath)\netcoreapp2.0&quot;" />
15+
<Exec Command="dotnet publish &quot;$(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj&quot; -c $(Configuration) -o &quot;$(OutputPath)&quot;" />
1916
</Target>
2017

2118
<Target Name="CopyMSBuildScripts" AfterTargets="PublishMSBuildTaskProject">
@@ -31,6 +28,7 @@
3128
</Target>
3229

3330
<Target Name="CreateNuGetPackage" AfterTargets="RunTests" Condition="$(Configuration) == 'Release'">
31+
<Exec Command="dotnet pack &quot;$(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj&quot; -c $(Configuration) -o $(OutputPath)" />
3432
<Exec Command="dotnet pack &quot;$(MSBuildThisFileDirectory)src\coverlet.console\coverlet.console.csproj&quot; -c $(Configuration) -o $(OutputPath)" />
3533
</Target>
3634

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>netcoreapp2.1</TargetFramework>
5+
<TargetFramework>netcoreapp2.2</TargetFramework>
66
<ToolCommandName>coverlet</ToolCommandName>
77
<PackAsTool>true</PackAsTool>
88
<AssemblyTitle>coverlet.console</AssemblyTitle>

src/coverlet.core/coverlet.core.csproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>netcoreapp2.0;net472</TargetFrameworks>
5+
<TargetFramework>netstandard2.0</TargetFramework>
66
<AssemblyVersion>4.1.1</AssemblyVersion>
77
</PropertyGroup>
88

99
<ItemGroup>
1010
<PackageReference Include="Mono.Cecil" Version="0.10.1" />
1111
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
12-
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="2.0.1" />
13-
</ItemGroup>
14-
15-
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
1612
<PackageReference Include="System.Reflection.Metadata" Version="1.6.0" />
13+
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="2.0.1" />
1714
</ItemGroup>
1815

1916
<ItemGroup>

src/coverlet.msbuild.tasks/coverlet.msbuild.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,5 @@
1414
<Threshold Condition="$(Threshold) == ''">0</Threshold>
1515
<ThresholdType Condition="$(ThresholdType) == ''">line,branch,method</ThresholdType>
1616
<ThresholdStat Condition="$(ThresholdStat) == ''">minimum</ThresholdStat>
17-
18-
<CoverletBuildTaskPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)net472\</CoverletBuildTaskPath>
19-
<CoverletBuildTaskPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)netcoreapp2.0\</CoverletBuildTaskPath>
2017
</PropertyGroup>
2118
</Project>

src/coverlet.msbuild.tasks/coverlet.msbuild.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22

3-
<UsingTask TaskName="Coverlet.MSbuild.Tasks.InstrumentationTask" AssemblyFile="$(CoverletBuildTaskPath)coverlet.msbuild.tasks.dll"/>
4-
<UsingTask TaskName="Coverlet.MSbuild.Tasks.CoverageResultTask" AssemblyFile="$(CoverletBuildTaskPath)coverlet.msbuild.tasks.dll"/>
3+
<UsingTask TaskName="Coverlet.MSbuild.Tasks.InstrumentationTask" AssemblyFile="$(MSBuildThisFileDirectory)coverlet.msbuild.tasks.dll"/>
4+
<UsingTask TaskName="Coverlet.MSbuild.Tasks.CoverageResultTask" AssemblyFile="$(MSBuildThisFileDirectory)coverlet.msbuild.tasks.dll"/>
55

66
<Target Name="InstrumentModulesNoBuild" BeforeTargets="VSTest">
77
<Coverlet.MSbuild.Tasks.InstrumentationTask

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>netcoreapp2.0;net472</TargetFrameworks>
5+
<TargetFramework>netstandard2.0</TargetFramework>
66
<AssemblyVersion>2.4.1</AssemblyVersion>
77

88
<PackageId>coverlet.msbuild</PackageId>
@@ -16,18 +16,10 @@
1616
<DevelopmentDependency>true</DevelopmentDependency>
1717
<Description>Coverlet is a cross platform code coverage library for .NET Core, with support for line, branch and method coverage.</Description>
1818
<PackageTags>coverage testing unit-test lcov opencover quality</PackageTags>
19-
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
20-
21-
<!-- Items in the Content group are placed in this folder in the NuGet package. -->
22-
<ContentTargetFolders>build</ContentTargetFolders>
23-
24-
<!-- Build tasks should not be added to the lib folder. -->
25-
<IncludeBuildOutput>false</IncludeBuildOutput>
26-
<IncludeSymbols>true</IncludeSymbols>
27-
<IncludeSources>true</IncludeSources>
28-
2919
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
3020
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs</TargetsForTfmSpecificContentInPackage>
21+
<ContentTargetFolders>build\$(TargetFramework)\</ContentTargetFolders>
22+
<IncludeBuildOutput>false</IncludeBuildOutput>
3123
</PropertyGroup>
3224

3325
<ItemGroup>
@@ -52,10 +44,7 @@
5244
<TfmSpecificPackageFile Include="$(TargetPath)" PackagePath="build\$(TargetFramework)\" />
5345
<TfmSpecificPackageFile Include="$(DepsFilePath)" PackagePath="build\$(TargetFramework)\" />
5446
<TfmSpecificPackageFile Include="@(DebugSymbolsProjectOutputGroupOutput)" PackagePath="build\$(TargetFramework)\" />
55-
<!--<TfmSpecificPackageFile Include="@(SatelliteDllsProjectOutputGroupDependency)" PackagePath="build\$(TargetFramework)\%(SatelliteDllsProjectOutputGroupDependency.DestinationSubDirectory)" />-->
56-
<!--<TfmSpecificPackageFile Include="@(SatelliteDllsProjectOutputGroupOutput->'%(FinalOutputPath)')" PackagePath="build\$(TargetFramework)\%(SatelliteDllsProjectOutputGroupOutput.Culture)\" />-->
5747
<TfmSpecificPackageFile Include="%(_ResolvedProjectReferencePaths.Identity)" PackagePath="build\$(TargetFramework)\" />
58-
5948
<TfmSpecificPackageFile Include="@(ReferenceCopyLocalPaths)" Exclude="@(_ResolvedProjectReferencePaths)" PackagePath="build\$(TargetFramework)\%(ReferenceCopyLocalPaths.DestinationSubPath)" />
6049
</ItemGroup>
6150
</Target>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.0;net472</TargetFrameworks>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
</PropertyGroup>
66

77
</Project>

0 commit comments

Comments
 (0)