Skip to content

Commit 63a87bf

Browse files
committed
Create a Microsoft.VisualStudio.Threading.Only package
This new package has the library, but no analyzers dependency. The analyzers dependency is retained by the original `Microsoft.VisualStudio.Threading` package, along with a new dependency on the `Microsoft.VisualStudio.Threading.Only` package. This allows consumers like StreamJsonRpc to express a dependency on `Microsoft.VisualStudio.Threading.Only` instead of `Microsoft.VisualStudio.Threading` in order to prevent its downstream users from having threading analyzers applied automatically, which they may not want.
1 parent 004d68b commit 63a87bf

File tree

4 files changed

+48
-15
lines changed

4 files changed

+48
-15
lines changed

Microsoft.VisualStudio.Threading.sln

+11
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{C1DAF484-7
5151
test\Directory.Build.targets = test\Directory.Build.targets
5252
EndProjectSection
5353
EndProject
54+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.Threading.JointPackage", "src\Microsoft.VisualStudio.Threading.JointPackage\Microsoft.VisualStudio.Threading.JointPackage.csproj", "{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}"
55+
EndProject
5456
Global
5557
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5658
Debug|Any CPU = Debug|Any CPU
@@ -137,6 +139,14 @@ Global
137139
{8CDF7526-D625-4E16-A266-BAF654ABE181}.Release|Any CPU.Build.0 = Release|Any CPU
138140
{8CDF7526-D625-4E16-A266-BAF654ABE181}.Release|NonWindows.ActiveCfg = Release|Any CPU
139141
{8CDF7526-D625-4E16-A266-BAF654ABE181}.Release|NonWindows.Build.0 = Release|Any CPU
142+
{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
143+
{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
144+
{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Debug|NonWindows.ActiveCfg = Debug|Any CPU
145+
{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Debug|NonWindows.Build.0 = Debug|Any CPU
146+
{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
147+
{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Release|Any CPU.Build.0 = Release|Any CPU
148+
{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Release|NonWindows.ActiveCfg = Release|Any CPU
149+
{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Release|NonWindows.Build.0 = Release|Any CPU
140150
EndGlobalSection
141151
GlobalSection(SolutionProperties) = preSolution
142152
HideSolutionNode = FALSE
@@ -152,6 +162,7 @@ Global
152162
{7177DEEE-D14D-4A4A-BF6E-8B0CDC26B624} = {96134B19-FB32-4FA0-A565-BD4247D1E5B2}
153163
{D5A0D627-7853-43F5-9AF4-E23D062C6ABA} = {96134B19-FB32-4FA0-A565-BD4247D1E5B2}
154164
{8CDF7526-D625-4E16-A266-BAF654ABE181} = {96134B19-FB32-4FA0-A565-BD4247D1E5B2}
165+
{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB} = {96134B19-FB32-4FA0-A565-BD4247D1E5B2}
155166
EndGlobalSection
156167
GlobalSection(ExtensibilityGlobals) = postSolution
157168
SolutionGuid = {E2124DFF-970E-4BA1-9E50-3ADB0AABF347}

src/LibraryNuspecProperties.props

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project>
2+
<PropertyGroup>
3+
<TargetFrameworks>netstandard2.0;net8.0;net472</TargetFrameworks>
4+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net8.0-windows</TargetFrameworks>
5+
6+
<Description>Async synchronization primitives, async collections, TPL and dataflow extensions.
7+
The JoinableTaskFactory allows synchronously blocking the UI thread for async work. This
8+
package is applicable to any .NET application (not just Visual Studio).
9+
</Description>
10+
<PackageTags>Threading Async Lock Synchronization Threadsafe</PackageTags>
11+
</PropertyGroup>
12+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\LibraryNuspecProperties.props" />
3+
<PropertyGroup>
4+
<PackageId>Microsoft.VisualStudio.Threading</PackageId>
5+
<IncludeBuildOutput>false</IncludeBuildOutput>
6+
<IncludeSymbols>false</IncludeSymbols>
7+
<NoWarn>$(NoWarn);NU5128</NoWarn>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<None Include="..\Microsoft.VisualStudio.Threading\README.md" Pack="true" PackagePath="" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\Microsoft.VisualStudio.Threading.Analyzers.CodeFixes\Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.csproj" />
16+
<ProjectReference Include="..\Microsoft.VisualStudio.Threading\Microsoft.VisualStudio.Threading.csproj" />
17+
</ItemGroup>
18+
19+
</Project>
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\LibraryNuspecProperties.props" />
23
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;net8.0;net472</TargetFrameworks>
4-
5-
<Summary>Async synchronization primitives, async collections, TPL and dataflow extensions.</Summary>
6-
<Description>Async synchronization primitives, async collections, TPL and dataflow extensions.
7-
The JoinableTaskFactory allows synchronously blocking the UI thread for async work. This
8-
package is applicable to any .NET application (not just Visual Studio).</Description>
9-
<PackageTags>Threading Async Lock Synchronization Threadsafe</PackageTags>
10-
4+
<PackageId>Microsoft.VisualStudio.Threading.Only</PackageId>
5+
<Description>$(Description)
6+
This package contains only the library, without a dependency on the analyzers.
7+
Use the Microsoft.VisualStudio.Threading package to get the library and analyzers together.
8+
</Description>
119
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1210
</PropertyGroup>
1311
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
14-
<TargetFrameworks>$(TargetFrameworks);net8.0-windows</TargetFrameworks>
1512
<UseWPF Condition=" '$(TargetFramework)' != 'net8.0' ">true</UseWPF>
1613
</PropertyGroup>
1714
<ItemGroup>
@@ -34,11 +31,5 @@
3431
<PackageReference Include="Microsoft.Win32.Registry" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
3532
<PackageReference Include="Microsoft.Windows.CsWin32" PrivateAssets="all" />
3633
</ItemGroup>
37-
<ItemGroup>
38-
<!-- We don't consume the analyzers in this library itself,
39-
but we reference the project to add a package dependency so users of this library will
40-
automatically get the analyzers. -->
41-
<ProjectReference Include="..\Microsoft.VisualStudio.Threading.Analyzers.CodeFixes\Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.csproj" PrivateAssets="none" Condition="'$(ExcludeRestorePackageImports)' != ''" />
42-
</ItemGroup>
4334
<Import Project="OptProf.targets" Condition=" '$(TargetFramework)' == 'net472' " />
4435
</Project>

0 commit comments

Comments
 (0)