Skip to content

coverlet.collector support for netstandard2.0 and net6.0 #1578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
-->

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="CopyCoverletDataCollectorFiles" AfterTargets="ComputeFilesToPublish">
<ItemGroup>
<CoverletDataCollectorFiles Include="$(MSBuildThisFileDirectory)\*.*" />
<CoverletDataCollectorFiles Include="$(MSBuildThisFileDirectory)\**\*.*" />
<CoverletDataCollectorFiles Remove="@(ResolvedFileToPublish->'$(MSBuildThisFileDirectory)%(Filename)%(Extension)')" />
</ItemGroup>
<Copy SourceFiles="@(CoverletDataCollectorFiles)" DestinationFolder="$(PublishDir)%(RecursiveDir)" />

</Target>

<Target Name="SetXPlatDataCollectorPath" BeforeTargets="VSTest">
<PropertyGroup>
<VSTestTestAdapterPath>$(VSTestTestAdapterPath);$(MSBuildThisFileDirectory)</VSTestTestAdapterPath>
Expand Down
20 changes: 14 additions & 6 deletions src/coverlet.collector/coverlet.collector.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<AssemblyTitle>coverlet.collector</AssemblyTitle>
<DevelopmentDependency>true</DevelopmentDependency>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Expand All @@ -14,7 +14,7 @@
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs</TargetsForTfmSpecificContentInPackage>
<!-- Open issue https://github.com/NuGet/Home/issues/8941 -->
<NoWarn>$(NoWarn);NU5127</NoWarn>
<NoWarn>$(NoWarn);NU5127;NU5100</NoWarn>
<EnablePackageValidation>true</EnablePackageValidation>
<!-- disable transitive version update and use versions defined in coverlet.core -->
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
Expand Down Expand Up @@ -43,7 +43,6 @@
</ItemGroup>

<ItemGroup>
<None Update="build\**" Pack="true" PackagePath="" />
<None Include="$(MSBuildThisFileDirectory)..\..\_assets\coverlet-icon.png" Pack="true" PackagePath="\" />
<None Include="..\..\Documentation\VSTestIntegration.md" Link="VSTestIntegration.md" Pack="true" PackagePath="\">
<PackageCopyToOutput>true</PackageCopyToOutput>
Expand Down Expand Up @@ -81,11 +80,20 @@
<ProjectReference Include="$(MSBuildThisFileDirectory)..\coverlet.core\coverlet.core.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="build\coverlet.collector.targets" >
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<Target Name="PackBuildOutputs">
<ItemGroup>
<TfmSpecificPackageFile Include="$(TargetDir)\*.dll" PackagePath="build\netstandard2.0\" />
<TfmSpecificPackageFile Include="$(TargetDir)\*.pdb" PackagePath="build\netstandard2.0\" />
<TfmSpecificPackageFile Include="$(TargetDir)\*.deps.json" PackagePath="build\netstandard2.0\" />
<TfmSpecificPackageFile Include="build\coverlet.collector.targets" PackagePath="build\$(TargetFramework)" />
<TfmSpecificPackageFile Include="$(TargetPath)" PackagePath="build\$(TargetFramework)" />
<TfmSpecificPackageFile Include="$(ProjectDepsFilePath)" PackagePath="build\$(TargetFramework)" />
<TfmSpecificPackageFile Include="@(DebugSymbolsProjectOutputGroupOutput)" PackagePath="build\$(TargetFramework)" />
<TfmSpecificPackageFile Include="%(_ResolvedProjectReferencePaths.Identity)" PackagePath="build\$(TargetFramework)" />
<TfmSpecificPackageFile Include="@(ReferenceCopyLocalPaths)" Exclude="@(_ResolvedProjectReferencePaths)" PackagePath="build\$(TargetFramework)\%(ReferenceCopyLocalPaths.DestinationSubPath)" />
</ItemGroup>
</Target>
</Project>