|
1 | 1 | <Project Sdk="Microsoft.NET.Sdk"> |
2 | 2 |
|
3 | 3 | <PropertyGroup> |
4 | | - <TargetFrameworks>net8.0;net9.0</TargetFrameworks> |
| 4 | + <TargetFrameworks>$(NetMinimum);netstandard2.0</TargetFrameworks> |
5 | 5 | <AssemblyTitle>Coverlet.MTP</AssemblyTitle> |
6 | 6 | <DevelopmentDependency>true</DevelopmentDependency> |
7 | 7 | <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> |
8 | 8 | <ImplicitUsings>enable</ImplicitUsings> |
9 | 9 | <Nullable>enable</Nullable> |
10 | | - <NoWarn>$(NoWarn)</NoWarn> |
11 | | - <EnablePackageValidation>true</EnablePackageValidation> |
12 | | - <IsTestProject>true</IsTestProject> |
| 10 | + <NoWarn>$(NoWarn)</NoWarn> |
| 11 | + <IncludeBuildOutput>false</IncludeBuildOutput> |
| 12 | + |
| 13 | + <SuppressDependenciesWhenPacking>false</SuppressDependenciesWhenPacking> |
| 14 | + <TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);CopyProjectReferencesToPackage</TargetsForTfmSpecificContentInPackage> |
| 15 | + |
| 16 | + <EnablePackageValidation>false</EnablePackageValidation> |
| 17 | + <!--<IsTestProject>true</IsTestProject>--> |
13 | 18 | <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport> |
14 | 19 | <IsPackable>true</IsPackable> |
15 | | - <GeneratePackageOnBuild>true</GeneratePackageOnBuild> |
| 20 | + <NoPackageAnalysis>true</NoPackageAnalysis> |
| 21 | + <!-- disable transitive version update and use versions defined in coverlet.core --> |
| 22 | + <CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled> |
16 | 23 | </PropertyGroup> |
17 | 24 |
|
18 | 25 | <PropertyGroup> |
|
46 | 53 | </ItemGroup> |
47 | 54 |
|
48 | 55 | <ItemGroup> |
49 | | - <ProjectReference Include="$(MSBuildThisFileDirectory)..\coverlet.core\coverlet.core.csproj" /> |
| 56 | + <ProjectReference Include="$(MSBuildThisFileDirectory)..\coverlet.core\coverlet.core.csproj" PrivateAssets="all" /> |
50 | 57 | </ItemGroup> |
51 | 58 |
|
52 | 59 | <!-- NuGet package layout --> |
|
67 | 74 | <InternalsVisibleTo Include="coverlet.MTP.unit.tests" Key="0024000004800000940000000602000000240000525341310004000001000100d568d35e41a0829ae24628d27cc43572aa77a3d2f5ac0a6b7554a92d979a72ec0e084c38f83f1ccfc3d26bbeca74131f611a7600a6f218ffc0cbb5758c4e6da50b07fd499d96bdc4e8eb1e10a38231aefd3cde5a69cbade511129588352843950b489b9295a9fb7259b00f18f3a571bdca19b13ccda89cc2a4690f69ee2367b8" /> |
68 | 75 | </ItemGroup> |
69 | 76 |
|
| 77 | + <Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences"> |
| 78 | + <ItemGroup> |
| 79 | + <!-- 1. Main assembly, deps.json, and PDB --> |
| 80 | + <TfmSpecificPackageFile Include="$(TargetPath);$(ProjectDepsFilePath);@(DebugSymbolsProjectOutputGroupOutput)" PackagePath="lib\$(TargetFramework)" /> |
| 81 | + |
| 82 | + <!-- 2. coverlet.core.dll --> |
| 83 | + <TfmSpecificPackageFile Include="%(_ResolvedProjectReferencePaths.Identity)" PackagePath="lib\$(TargetFramework)" /> |
| 84 | + |
| 85 | + <!-- 3. ALL transitive dependencies (System.*.dll, etc.) EXCEPT framework references --> |
| 86 | + <TfmSpecificPackageFile Include="@(ReferenceCopyLocalPaths)" |
| 87 | + Exclude="@(_ResolvedProjectReferencePaths)" |
| 88 | + PackagePath="lib\$(TargetFramework)\%(ReferenceCopyLocalPaths.DestinationSubDirectory)" |
| 89 | + Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != 'Microsoft.Testing.Platform' AND '%(ReferenceCopyLocalPaths.NuGetPackageId)' != 'Microsoft.Extensions.DependencyInjection'" /> |
| 90 | + </ItemGroup> |
| 91 | + <!-- Print batches for debug purposes --> |
| 92 | + <Message Text="Batch for .nupkg: ReferenceCopyLocalPaths = @(_ReferenceCopyLocalPaths), ReferenceCopyLocalPaths.DestinationSubDirectory = %(_ReferenceCopyLocalPaths.DestinationSubDirectory) Filename = %(_ReferenceCopyLocalPaths.Filename) Extension = %(_ReferenceCopyLocalPaths.Extension)" Importance="High" Condition="'@(_ReferenceCopyLocalPaths)' != ''" /> |
| 93 | + |
| 94 | + </Target> |
| 95 | + |
70 | 96 | </Project> |
0 commit comments