Просмотр исходного кода

Fix incrementalism of Blazor solution

Ryan Nowak 6 лет назад
Родитель
Сommit
b42ebf119d

+ 6 - 7
src/Components/Blazor/Build/src/ReferenceFromSource.props

@@ -46,12 +46,11 @@
       <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
       <UndefineProperties>TargetFramework</UndefineProperties>
     </ProjectReference>
+    <ProjectReference Include="$(MSBuildThisFileDirectory)..\..\DevServer\src\Microsoft.AspNetCore.Blazor.DevServer.csproj">
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+      <!-- Optimization. Do not require framework compatibility between these projects. -->
+      <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
+      <UndefineProperties>TargetFramework</UndefineProperties>
+    </ProjectReference>
   </ItemGroup>
-
-  <PropertyGroup>
-    <!-- When referencing from source, we need to disable VS's fast up-to-date check,
-         because otherwise changing the underlying Blazor library code isn't enough
-         to make it rebuild the affected library apps. -->
-    <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
-  </PropertyGroup>
 </Project>

+ 20 - 12
src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj

@@ -1,5 +1,4 @@
-<Project>
-  <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
+<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
     <NuspecFile>Microsoft.AspNetCore.Blazor.Templates.nuspec</NuspecFile>
@@ -16,18 +15,31 @@
     <IsProjectReferenceProvider>false</IsProjectReferenceProvider>
   </PropertyGroup>
 
-  <Target Name="TransformTemplateConfigs" BeforeTargets="CoreBuild" DependsOnTargets="SetTemplateJsonSymbolReplacements">
-    <!--
-      For each template, copy its '.template.config.src' directory to '.template.config',
-      removing any earlier output at that location
-    -->
+  <ItemGroup>
+    <UpToDateCheckInput Include="content\**\.template.config.src\**\*.*" />
+  </ItemGroup>
+
+  <Target Name="PrepareFileLists" AfterTargets="PrepareForBuild">
     <ItemGroup>
       <_TemplateConfigMainFile Include="content\**\.template.config.src\template.json" />
-      <_TemplateConfigDir Include="@(_TemplateConfigMainFile-&gt;'$([System.IO.Path]::GetDirectoryName('%(_TemplateConfigMainFile.FullPath)'))')" />
+      <_TemplateConfigDir Include="@(_TemplateConfigMainFile->'$([System.IO.Path]::GetDirectoryName('%(_TemplateConfigMainFile.FullPath)'))')" />
       <_TemplateConfigFileToCopy Include="%(_TemplateConfigDir.Identity)\**\*.*">
         <DestDir>$([System.IO.Path]::GetDirectoryName('%(_TemplateConfigDir.Identity)'))\.template.config\</DestDir>
       </_TemplateConfigFileToCopy>
     </ItemGroup>
+  </Target>
+
+  <Target
+    Name="TransformTemplateConfigs"
+    BeforeTargets="CoreBuild"
+    DependsOnTargets="SetTemplateJsonSymbolReplacements"
+    Inputs="@(_TemplateConfigFileToCopy)"
+    Outputs="@(_TemplateConfigFileToCopy->'%(DestDir)%(FileName)%(Extension)')">
+
+    <!--
+      For each template, copy its '.template.config.src' directory to '.template.config',
+      removing any earlier output at that location
+    -->
     <RemoveDir Directories="%(_TemplateConfigFileToCopy.DestDir)" />
     <Copy SourceFiles="%(_TemplateConfigFileToCopy.Identity)" DestinationFolder="%(_TemplateConfigFileToCopy.DestDir)" />
 
@@ -49,8 +61,4 @@
       <Output TaskParameter="OutputPath" ItemName="Content" />
     </GenerateFileFromTemplate>
   </Target>
-  <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
-  <!-- Override SDK targets. This project does not produce a .dll. -->
-  <Target Name="CoreCompile" />
-  <Target Name="GetTargetPath" />
 </Project>

+ 3 - 1
src/Servers/IIS/IIS/src/Microsoft.AspNetCore.Server.IIS.csproj

@@ -10,7 +10,6 @@
     <PackageTags>aspnetcore;iis</PackageTags>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <NativeAssetsTargetFramework>netcoreapp3.0</NativeAssetsTargetFramework>
-    <DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
   </PropertyGroup>
 
   <ItemGroup>
@@ -44,6 +43,9 @@
   </ItemGroup>
 
   <Import Project="..\..\build\assets.props" />
+  <ItemGroup>
+    <UpToDateCheckInput Include="@(InProcessComponents)" />
+  </ItemGroup>
 
   <Target Name="AddPackNativeComponents" BeforeTargets="_GetPackageFiles" Condition="$(PackNativeAssets) == 'true'">
     <ItemGroup>