Skip to content

Commit

Permalink
Remove depprojs in favor of PackageReferences (#35606)
Browse files Browse the repository at this point in the history
- Remove depprojs which currently binplace external references into the RefPath folders in favor of PackageReference and PackageDownload items.
- Build all configurations by default when building an individual project (either on the CLI or inside VS) same as with the official SDK. This enables .NETFramework Test Explorer support.
- Centrally define libraries that compose the shared framework instead of in each Directory.Build.props file to be able to build the targeting pack first and consume it in the OOB libraries.
- Use ProjectReferences to reference OOB projects. Compile against the reference assembly but use the implementation assembly app-local during runtime.
- Remove OOBs from the testhost and remove the testhost folder for .NETFramework as it isn't required anymore.
- Only binplace for $(NetCoreAppCurrent) to compose a) the targeting pack, b) the runtime pack, c) the testhost, d) a full closure for the shims.
- Use Targeting Packs for OOB projects (with their implicit assembly references) but still explicitly define granular references for .NETCoreApp configurations (DisableImplicitAssemblyReferences switch). Use the implicit targeting pack references in some Microsoft.Extensions.* cases.
- Remove placeholder configurations as they aren't needed anymore with explicit P2Ps vs Targeting Pack references.
- Remove implicit assembly references (ie for .NETFramework, mscorlib)
- Remove AssemblySearchPath hacks that were introduced with b7c4cb7 as the targeting pack is now used by default.
- Reduce unnecessary .NETFramework configurations that were added to run tests in favor of the already existing ref&src configurations.
- Stop hardcoding the paths for wasm assemblies and use the returned TargetPath of the ProjectReferences.
- Addressed formatting (ItemGroups, References at the bottom of the project file, ordering of references, use LibrariesProjectRoot instead of a relative path, unnecessary AssemblyName and RootNamespace properties which are identical to the project name, ordering of tfms)
- Revert "fix clean (#33758)"
  • Loading branch information
ViktorHofer authored Jul 23, 2020
1 parent 25d14c3 commit a79f297
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions ref/System.Net.WebSockets.WebSocketProtocol.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.Net.WebSockets.WebSocketProtocol.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Memory" />
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
</ItemGroup>
</Project>
23 changes: 12 additions & 11 deletions src/System.Net.WebSockets.WebSocketProtocol.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>System.Net.WebSockets.WebSocketProtocol</AssemblyName>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;netcoreapp2.1;net461;$(NetFrameworkCurrent)</TargetFrameworks>
<ExcludeCurrentFullFrameworkFromPackage>true</ExcludeCurrentFullFrameworkFromPackage>
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;netcoreapp2.1;net461</TargetFrameworks>
<ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -21,27 +19,30 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' Or $(TargetFramework.StartsWith('net4'))">
<Compile Include="System\Net\WebSockets\ManagedWebSocketExtensions.netstandard.cs" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Memory" />
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)' or
'$(TargetFramework)' == 'netcoreapp2.1'">
<Reference Include="Microsoft.Win32.Primitives" />
<Reference Include="System.Security.Cryptography.Algorithms" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Buffers" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Memory" />
<Reference Include="System.Net.WebSockets" />
<Reference Include="System.Numerics.Vectors" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Security.Cryptography.Algorithms" />
<Reference Include="System.Text.Encoding.Extensions" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Threading.Tasks.Extensions" />
<Reference Include="System.Threading.Timer" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
<Reference Include="mscorlib" />
<Reference Include="System" />
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or
$(TargetFramework.StartsWith('net4'))">
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
<PackageReference Include="System.Numerics.Vectors" Version="$(SystemNumericsVectorsVersion)" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="$(SystemThreadingTasksExtensionsVersion)" />
</ItemGroup>
</Project>
5 changes: 4 additions & 1 deletion tests/System.Net.WebSockets.WebSocketProtocol.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkCurrent)</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);net48</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonTestPath)System\Net\WebSockets\WebSocketCreateTest.cs"
Expand All @@ -13,4 +13,7 @@
Link="Common\System\Net\HttpKnownHeaderNames.cs" />
<Compile Include="WebSocketProtocolTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\System.Net.WebSockets.WebSocketProtocol.csproj" />
</ItemGroup>
</Project>

0 comments on commit a79f297

Please sign in to comment.