Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,43 @@

<PropertyGroup>
<IsPackable Condition="'$(DotNetBuildSourceOnly)' != 'true'">true</IsPackable>
<NuspecFile>Microsoft.TestPlatform.VsTestConsole.TranslationLayer.nuspec</NuspecFile>
<NuspecBasePath>$(OutputPath)</NuspecBasePath>
<PackageId>Microsoft.TestPlatform.TranslationLayer</PackageId>
<PackageTags>vstest visual-studio unittest testplatform mstest microsoft test testing</PackageTags>
<PackageDescription>
C# SDK for the test platform protocol. This SDK can be used in IDE or Editors to use test platform for discovery and execution of tests.
</PackageDescription>
<PackageReadmeFile>README.md</PackageReadmeFile>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);IncludeBundledAssembliesInPackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<ItemGroup Label="NuGet">
<NuspecProperty Include="NewtonsoftJsonVersion=$(NewtonsoftJsonVersion)" />
<NuspecProperty Include="SrcPackageFolder=$(SrcPackageFolder)" />
<ItemGroup>
<!-- ObjectModel ships as its own NuGet package, so it stays a real dependency. -->
<ProjectReference Include="..\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" />
<!-- These assemblies are bundled into this package (they are not separate NuGet packages), so suppress them as dependencies. -->
<ProjectReference Include="..\Microsoft.TestPlatform.Common\Microsoft.TestPlatform.Common.csproj" PrivateAssets="all" />
<ProjectReference Include="..\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" PrivateAssets="all" />
<ProjectReference Include="..\Microsoft.TestPlatform.CommunicationUtilities\Microsoft.TestPlatform.CommunicationUtilities.csproj" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.TestPlatform.Common\Microsoft.TestPlatform.Common.csproj" />
<ProjectReference Include="..\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" />
<ProjectReference Include="..\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" />
<ProjectReference Include="..\Microsoft.TestPlatform.CommunicationUtilities\Microsoft.TestPlatform.CommunicationUtilities.csproj" />
<None Include="README.md" Pack="true" PackagePath="" />
<None Include="$(SrcPackageFolder)ThirdPartyNotices.txt" Pack="true" PackagePath="" />
</ItemGroup>

<!-- Bundle Common and CommunicationUtilities DLLs plus satellite resources (including CoreUtilities resources) into the package. -->
<Target Name="IncludeBundledAssembliesInPackage">
<ItemGroup>
<!-- The XML doc is emitted into the intermediate output, so include it explicitly (pack does not auto-pick it up). -->
<TfmSpecificPackageFile Include="$(OutputPath)Microsoft.TestPlatform.VsTestConsole.TranslationLayer.XML" PackagePath="lib/$(TargetFramework)/" />
Comment thread
azat-msft marked this conversation as resolved.
Resolved
<TfmSpecificPackageFile Include="$(OutputPath)Microsoft.VisualStudio.TestPlatform.Common.dll" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutputPath)Microsoft.TestPlatform.CommunicationUtilities.dll" PackagePath="lib/$(TargetFramework)/" />
<!-- Satellite resources for bundled assemblies -->
<TfmSpecificPackageFile Include="$(OutputPath)**/Microsoft.VisualStudio.TestPlatform.Common.resources.dll" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutputPath)**/Microsoft.TestPlatform.CommunicationUtilities.resources.dll" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutputPath)**/Microsoft.TestPlatform.CoreUtilities.resources.dll" PackagePath="lib/$(TargetFramework)/" />
</ItemGroup>
</Target>

<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '$(NetFrameworkMinimum)'))">
<Reference Include="System.Xml" />
<Reference Include="System.Runtime.Serialization" />
Expand Down

This file was deleted.

43 changes: 37 additions & 6 deletions src/package/Microsoft.CodeCoverage/Microsoft.CodeCoverage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@

<PropertyGroup>
<IsPackable Condition="'$(DotNetBuildSourceOnly)' != 'true'">true</IsPackable>
<NuspecFile>Microsoft.CodeCoverage.nuspec</NuspecFile>
<NuspecBasePath>$(OutputPath)</NuspecBasePath>
<PackageId>Microsoft.CodeCoverage</PackageId>
<PackageTags>vstest visual-studio unittest testplatform mstest microsoft test testing codecoverage code-coverage</PackageTags>
<PackageDescription>
Microsoft.CodeCoverage package brings infra for collecting code coverage from vstest.console.exe and "dotnet test".
</PackageDescription>
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);NU1702</NoWarn>
<PackageReadmeFile>README.md</PackageReadmeFile>
<!-- This package ships only build/ tooling and a bundled content tree, not its own assembly,
and declares no NuGet dependencies. -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<!-- NU5128: empty dependency groups; NU5100/NU5109/NU5118/NU5127: assemblies/content ship under
build\ and the root rather than lib\, which is intentional for this tooling package. -->
<NoWarn>$(NoWarn);NU1702;NU5128;NU5100;NU5109;NU5118;NU5127</NoWarn>
<!-- The bundled Microsoft.Internal.CodeCoverage content tree is added per-TFM (its package path
property is only defined in the inner build), gated to a single TFM so it ships once. -->
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);IncludeInternalCodeCoverageContent</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<ItemGroup>
Expand All @@ -45,4 +50,30 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<!-- Package contents (previously authored in the .nuspec). -->
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="" />

<!-- Third party notices: at the package root and alongside the build tooling. -->
<None Include="ThirdPartyNoticesCodeCoverage.txt" Pack="true" PackagePath="ThirdPartyNotices.txt" />
<None Include="ThirdPartyNoticesCodeCoverage.txt" Pack="true" PackagePath="build\netstandard2.0\ThirdPartyNotices.txt" />

<!-- MSBuild integration. -->
<None Include="Microsoft.CodeCoverage.props" Pack="true" PackagePath="build\netstandard2.0\" />
<None Include="Microsoft.CodeCoverage.targets" Pack="true" PackagePath="build\netstandard2.0\" />
</ItemGroup>

<!-- The code coverage tooling, instrumentation engines and shims come pre-laid-out as a
build\ + lib\ content tree in the Microsoft.Internal.CodeCoverage package; ship it at the root.
This runs in the inner (per-TFM) build because the package path property is only defined there,
and is gated to a single TFM so the content is added exactly once. PackagePath=%(RecursiveDir)
preserves the folder structure. -->
<Target Name="IncludeInternalCodeCoverageContent" Condition="'$(TargetFramework)' == 'net462'" Returns="@(TfmSpecificPackageFile)">
<ItemGroup>
<TfmSpecificPackageFile Include="$(PkgMicrosoft_Internal_CodeCoverage)\contentFiles\Microsoft.CodeCoverage\**\*">
<PackagePath>%(RecursiveDir)</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
</Target>
</Project>
25 changes: 0 additions & 25 deletions src/package/Microsoft.CodeCoverage/Microsoft.CodeCoverage.nuspec

This file was deleted.

70 changes: 51 additions & 19 deletions src/package/Microsoft.NET.Test.Sdk/Microsoft.NET.Test.Sdk.csproj
Original file line number Diff line number Diff line change
@@ -1,42 +1,74 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<!-- Multi-target so that pack emits per-framework dependency groups (net8.0 and net462). -->
<TargetFrameworks>net8.0;net462</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<IsPackable Condition="'$(DotNetBuildSourceOnly)' != 'true'">true</IsPackable>
<NuspecFile>Microsoft.NET.Test.Sdk.nuspec</NuspecFile>
<NuspecBasePath>$(OutputPath)</NuspecBasePath>
<PackageId>Microsoft.NET.Test.Sdk</PackageId>
<PackageTags>vstest visual-studio unittest testplatform mstest microsoft test testing</PackageTags>
<PackageDescription>
The MSbuild targets and properties for building .NET test projects.
</PackageDescription>
<PackageReadmeFile>README.md</PackageReadmeFile>
<!-- This is a build/targets-only package: it ships MSBuild props/targets and _._ lib stubs,
not its own assembly. -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<!-- The package's assembly has no sources of its own. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
</PropertyGroup>

<ItemGroup>
<Compile Remove="netcoreapp\Microsoft.NET.Test.Sdk.Program.cs" />
<None Include="netcoreapp\Microsoft.NET.Test.Sdk.Program.cs" />
</ItemGroup>

<!-- Package dependencies, expressed per target framework via references to the sibling packable projects.
net8.0 depends on TestHost and CodeCoverage; net462 depends on CodeCoverage only
(TestHost gets shipped with vstest.console on .NET Framework).
PrivateAssets="none" so the generated nuspec dependency does not exclude the Build (and Analyzers)
assets: consumers must import TestHost's and CodeCoverage's MSBuild props/targets (e.g. the
Microsoft.TestPlatform.TestHost.props that deploys the testhost.exe apphost). This matches the
hand-written nuspec, whose dependencies carried no exclude. By default pack emits
exclude="Build,Analyzers" for a ProjectReference, which would suppress those props. -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<ProjectReference Include="..\Microsoft.TestPlatform.TestHost\Microsoft.TestPlatform.TestHost.csproj" PrivateAssets="none" />
</ItemGroup>
<ItemGroup>
<None Include="netcoreapp\Microsoft.NET.Test.Sdk.Program.cs" />
<ProjectReference Include="..\Microsoft.CodeCoverage\Microsoft.CodeCoverage.csproj" PrivateAssets="none" />
</ItemGroup>

<!-- README.md is referenced by PackageReadmeFile. -->
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>

<!-- Ship the MSBuild props/targets into the build and buildMultiTargeting folders.
The root .props goes to every TFM folder; the .targets vary by TFM:
- net8.0 uses netcoreapp\Microsoft.NET.Test.Sdk.targets and the Program.* launcher files
- net462 uses netfx\Microsoft.NET.Test.Sdk.targets
- netcoreapp2.0 / netstandard2.0 use the root Microsoft.NET.Test.Sdk.targets (incompatibility shim) -->
<ItemGroup>
<None Update="_._">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Microsoft.NET.Test.Sdk.props">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Microsoft.NET.Test.Sdk.targets">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="netcoreapp\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="netfx\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<!-- props (same file for all frameworks) -->
<None Include="Microsoft.NET.Test.Sdk.props" Pack="true" PackagePath="build\net8.0\;build\net462\;build\netcoreapp2.0\;build\netstandard2.0\;buildMultiTargeting\net8.0\;buildMultiTargeting\net462\;buildMultiTargeting\netcoreapp2.0\;buildMultiTargeting\netstandard2.0\" />

<!-- net8.0 targets + launcher program files -->
<None Include="netcoreapp\Microsoft.NET.Test.Sdk.targets" Pack="true" PackagePath="build\net8.0\" />
<None Include="netcoreapp\Microsoft.NET.Test.Sdk.Program.cs" Pack="true" PackagePath="build\net8.0\" />
<None Include="netcoreapp\Microsoft.NET.Test.Sdk.Program.fs" Pack="true" PackagePath="build\net8.0\" />
<None Include="netcoreapp\Microsoft.NET.Test.Sdk.Program.vb" Pack="true" PackagePath="build\net8.0\" />

<!-- net462 targets -->
<None Include="netfx\Microsoft.NET.Test.Sdk.targets" Pack="true" PackagePath="build\net462\" />

<!-- netcoreapp2.0 / netstandard2.0 incompatibility-shim targets (root targets file) -->
<None Include="Microsoft.NET.Test.Sdk.targets" Pack="true" PackagePath="build\netcoreapp2.0\;build\netstandard2.0\;buildMultiTargeting\netcoreapp2.0\;buildMultiTargeting\netstandard2.0\" />

<!-- Empty lib stubs (no assembly is shipped). lib/native/_._ marks the package compatible with
native (C++) test projects. Note: the previous nuspec also declared an empty native0.0
dependency group; MSBuild pack only emits dependency groups for real build TFMs, so that empty
group is dropped. This is behaviorally equivalent since the group carried no dependencies. -->
<None Include="_._" Pack="true" PackagePath="lib\net8.0\;lib\net462\;lib\native\" />
</ItemGroup>
</Project>
54 changes: 0 additions & 54 deletions src/package/Microsoft.NET.Test.Sdk/Microsoft.NET.Test.Sdk.nuspec

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,43 @@
<IsPackable Condition="'$(DotNetBuildSourceOnly)' != 'true'">true</IsPackable>
<!-- This is an internal package not meant to be published outside -->
<IsShippingPackage>false</IsShippingPackage>
<NuspecFile>Microsoft.TestPlatform.Internal.Uwp.nuspec</NuspecFile>
<NuspecBasePath>$(OutputPath)</NuspecBasePath>
<!-- This is a packaging-only container: it ships bundled DLLs, not its own assembly or NuGet dependencies. -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<!-- This package ships only bundled DLLs with no dependencies; suppress the empty-dependency-group warning. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<PackageId>Microsoft.TestPlatform.Internal.Uwp</PackageId>
<PackageTags>vstest visual-studio unittest testplatform mstest microsoft test testing</PackageTags>
<PackageDescription>
Internal Microsoft Test Platform libraries for UWP runner.
</PackageDescription>
<PackageReadmeFile>README.md</PackageReadmeFile>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);IncludeBundledAssembliesInPackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" />
<ProjectReference Include="..\..\Microsoft.TestPlatform.CrossPlatEngine\Microsoft.TestPlatform.CrossPlatEngine.csproj" />
<ProjectReference Include="..\..\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" PrivateAssets="all" />
<ProjectReference Include="..\..\Microsoft.TestPlatform.CrossPlatEngine\Microsoft.TestPlatform.CrossPlatEngine.csproj" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>

<!-- Bundle the test platform DLLs (ObjectModel, CrossPlatEngine and their dependencies) plus the
ObjectModel and CoreUtilities satellite resources into lib/netstandard2.0. -->
<Target Name="IncludeBundledAssembliesInPackage">
<ItemGroup>
<TfmSpecificPackageFile Include="$(OutputPath)Microsoft.VisualStudio.TestPlatform.ObjectModel.dll" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutputPath)Microsoft.TestPlatform.CoreUtilities.dll" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutputPath)Microsoft.TestPlatform.CrossPlatEngine.dll" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutputPath)Microsoft.TestPlatform.CommunicationUtilities.dll" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutputPath)Microsoft.TestPlatform.Utilities.dll" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutputPath)Microsoft.VisualStudio.TestPlatform.Common.dll" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutputPath)Microsoft.TestPlatform.PlatformAbstractions.dll" PackagePath="lib/$(TargetFramework)/" />
<!-- Only ObjectModel and CoreUtilities satellite resources are shipped. -->
<TfmSpecificPackageFile Include="$(OutputPath)**/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutputPath)**/Microsoft.TestPlatform.CoreUtilities.resources.dll" PackagePath="lib/$(TargetFramework)/" />
</ItemGroup>
</Target>
</Project>
Loading
Loading