Skip to content

Commit

Permalink
Do not include the shared framework in the packages (#24816)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
pranavkm authored Aug 25, 2020
1 parent 70ea49f commit b0530a6
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand All @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions src/Tools/dotnet-watch/src/DotnetToolSettings.xml
Original file line number Diff line number Diff line change
@@ -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>
31 changes: 14 additions & 17 deletions src/Tools/dotnet-watch/src/dotnet-watch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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"
Expand Down Expand Up @@ -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>
8 changes: 8 additions & 0 deletions src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -14,6 +21,7 @@

<ItemGroup>
<ProjectReference Include="..\src\dotnet-watch.csproj" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit b0530a6

Please sign in to comment.