Do not include the shared framework in the packages (#24816)

* Do not include the shared framework in the packages

DevServer and dotnet-watch include binaries from the ASP.NET Core shared framework
as part of the package. This change compiles these projects against the most recently built
version of the shared framework which ensures build and publish work as normals. Individual
projects from the runtime can be referenced to pick up new runtime features when necessary

* More hacks!

* Ensure shared runtime is built before running tests

* Delete dotnet-watch.nuspec
This commit is contained in:
Pranav K 2020-08-25 10:03:58 -07:00 committed by GitHub
parent 70ea49fd8a
commit b0530a68c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 53 additions and 40 deletions

View File

@ -11,17 +11,26 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Set this to false because assemblies should not reference this assembly directly, (except for tests, of course). -->
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
<!--
This project compiles against Microsoft.AspNetCore.App from the SDK.
This ensures that it's packaging output is correct and does not include local artifacts.
-->
<UseAspNetCoreSharedRuntime>true</UseAspNetCoreSharedRuntime>
<DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>true</DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNetCore" />
<Reference Include="Microsoft.AspNetCore.Diagnostics" />
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
<Reference Include="Microsoft.AspNetCore.Components.Server" />
<Reference Include="Microsoft.AspNetCore.ResponseCompression" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<ProjectReference
Include="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj"
PrivateAssets="All"
ReferenceOutputAssembly="false"
SkipGetTargetFrameworkProperties="true" />
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
<Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
<Reference Include="Microsoft.Extensions.Hosting" />
</ItemGroup>
<!-- Pack settings -->
@ -36,19 +45,5 @@
<NuspecProperty Include="PackageThirdPartyNoticesFile=$(PackageThirdPartyNoticesFile)" />
</ItemGroup>
<Target Name="_FixupRuntimeConfig" BeforeTargets="_GenerateRuntimeConfigurationFilesInputCache">
<ItemGroup>
<_RuntimeFramework Include="@(RuntimeFramework)" />
<RuntimeFramework Remove="@(RuntimeFramework)" />
<RuntimeFramework Include="Microsoft.AspNetCore.App" FrameworkName="Microsoft.AspNetCore.App" Version="5.0.0-preview" />
</ItemGroup>
</Target>
<Target Name="_UndoRuntimeConfigWorkarounds" AfterTargets="GenerateBuildRuntimeConfigurationFiles">
<ItemGroup>
<RuntimeFramework Remove="@(RuntimeFramework)" />
<RuntimeFramework Include="@(_RuntimeFramework)" />
</ItemGroup>
</Target>
</Project>

View File

@ -12,13 +12,18 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNetCore" />
<Reference Include="Microsoft.AspNetCore.Cors" />
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
<Reference Include="Selenium.Support" />
<Reference Include="Selenium.WebDriver" />
<ProjectReference Include="..\..\..\WebAssembly\DevServer\src\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj" />
<ProjectReference Include="..\TestApp\Wasm.Performance.TestApp.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\WebAssembly\DevServer\src\Server\*.cs" />
</ItemGroup>
<Target Name="_AddTestProjectMetadataAttributes" BeforeTargets="BeforeCompile">
<ItemGroup>
<AssemblyAttribute

View File

@ -41,7 +41,6 @@
<ProjectReference Include="..\..\WebAssembly\testassets\HostedInAspNet.Client\HostedInAspNet.Client.csproj" />
<ProjectReference Include="..\..\WebAssembly\testassets\HostedInAspNet.Server\HostedInAspNet.Server.csproj" />
<ProjectReference Include="..\..\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj" />
<ProjectReference Include="..\..\WebAssembly\DevServer\src\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj" />
<ProjectReference Include="..\testassets\BasicTestApp\BasicTestApp.csproj" />
<ProjectReference Include="..\testassets\TestServer\Components.TestServer.csproj" />
<ProjectReference Include="..\..\WebAssembly\testassets\Wasm.Authentication.Server\Wasm.Authentication.Server.csproj" />

View File

@ -22,10 +22,13 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\WebAssembly\DevServer\src\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj" />
<ProjectReference Include="..\BasicTestApp\BasicTestApp.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\WebAssembly\DevServer\src\Server\*.cs" />
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>Microsoft.AspNetCore.Testing.BasicTestApp.ContentRoot</_Parameter1>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<DotNetCliTool Version="1">
<Commands>
<Command Name="dotnet-watch" EntryPoint="dotnet-watch.dll" Runner="dotnet" />
</Commands>
</DotNetCliTool>

View File

@ -10,6 +10,13 @@
<!-- This package is for internal use only. It contains a CLI which is bundled in the .NET Core SDK. -->
<IsShippingPackage>false</IsShippingPackage>
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
<!--
This project compiles against Microsoft.AspNetCore.App from the SDK.
This ensures that it's packaging output is correct and does not include local artifacts.
-->
<UseAspNetCoreSharedRuntime>true</UseAspNetCoreSharedRuntime>
<DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>true</DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>
</PropertyGroup>
<ItemGroup>
@ -20,8 +27,13 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNetCore" />
<Reference Include="Microsoft.AspNetCore.WebSockets" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<ProjectReference
Include="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj"
PrivateAssets="All"
ReferenceOutputAssembly="false"
SkipGetTargetFrameworkProperties="true" />
<Reference
Include="Microsoft.AspNetCore.Watch.BrowserRefresh"
@ -53,19 +65,4 @@
</ItemGroup>
</Target>
<Target Name="_FixupRuntimeConfig" BeforeTargets="_GenerateRuntimeConfigurationFilesInputCache">
<ItemGroup>
<_RuntimeFramework Include="@(RuntimeFramework)" />
<RuntimeFramework Remove="@(RuntimeFramework)" />
<RuntimeFramework Include="Microsoft.AspNetCore.App" FrameworkName="Microsoft.AspNetCore.App" Version="5.0.0-preview" />
</ItemGroup>
</Target>
<Target Name="_UndoRuntimeConfigWorkarounds" AfterTargets="GenerateBuildRuntimeConfigurationFiles">
<ItemGroup>
<RuntimeFramework Remove="@(RuntimeFramework)" />
<RuntimeFramework Include="@(_RuntimeFramework)" />
</ItemGroup>
</Target>
</Project>

View File

@ -5,6 +5,13 @@
<AssemblyName>Microsoft.DotNet.Watcher.Tools.Tests</AssemblyName>
<DefaultItemExcludes>$(DefaultItemExcludes);TestProjects\**\*</DefaultItemExcludes>
<TestGroupName>DotNetWatcherToolsTests</TestGroupName>
<!--
This project compiles against Microsoft.AspNetCore.App from the SDK.
This ensures that it's packaging output is correct and does not include local artifacts.
-->
<UseAspNetCoreSharedRuntime>true</UseAspNetCoreSharedRuntime>
<DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>true</DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>
</PropertyGroup>
<ItemGroup>
@ -14,6 +21,7 @@
<ItemGroup>
<ProjectReference Include="..\src\dotnet-watch.csproj" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>