Fix incrementalism of Blazor solution

This commit is contained in:
Ryan Nowak 2019-07-31 09:00:03 -07:00
parent 1434e239d6
commit b42ebf119d
3 changed files with 29 additions and 20 deletions

View File

@ -46,12 +46,11 @@
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties> <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<UndefineProperties>TargetFramework</UndefineProperties> <UndefineProperties>TargetFramework</UndefineProperties>
</ProjectReference> </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> </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> </Project>

View File

@ -1,5 +1,4 @@
<Project> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<NuspecFile>Microsoft.AspNetCore.Blazor.Templates.nuspec</NuspecFile> <NuspecFile>Microsoft.AspNetCore.Blazor.Templates.nuspec</NuspecFile>
@ -16,18 +15,31 @@
<IsProjectReferenceProvider>false</IsProjectReferenceProvider> <IsProjectReferenceProvider>false</IsProjectReferenceProvider>
</PropertyGroup> </PropertyGroup>
<Target Name="TransformTemplateConfigs" BeforeTargets="CoreBuild" DependsOnTargets="SetTemplateJsonSymbolReplacements"> <ItemGroup>
<!-- <UpToDateCheckInput Include="content\**\.template.config.src\**\*.*" />
For each template, copy its '.template.config.src' directory to '.template.config', </ItemGroup>
removing any earlier output at that location
--> <Target Name="PrepareFileLists" AfterTargets="PrepareForBuild">
<ItemGroup> <ItemGroup>
<_TemplateConfigMainFile Include="content\**\.template.config.src\template.json" /> <_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)\**\*.*"> <_TemplateConfigFileToCopy Include="%(_TemplateConfigDir.Identity)\**\*.*">
<DestDir>$([System.IO.Path]::GetDirectoryName('%(_TemplateConfigDir.Identity)'))\.template.config\</DestDir> <DestDir>$([System.IO.Path]::GetDirectoryName('%(_TemplateConfigDir.Identity)'))\.template.config\</DestDir>
</_TemplateConfigFileToCopy> </_TemplateConfigFileToCopy>
</ItemGroup> </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)" /> <RemoveDir Directories="%(_TemplateConfigFileToCopy.DestDir)" />
<Copy SourceFiles="%(_TemplateConfigFileToCopy.Identity)" DestinationFolder="%(_TemplateConfigFileToCopy.DestDir)" /> <Copy SourceFiles="%(_TemplateConfigFileToCopy.Identity)" DestinationFolder="%(_TemplateConfigFileToCopy.DestDir)" />
@ -49,8 +61,4 @@
<Output TaskParameter="OutputPath" ItemName="Content" /> <Output TaskParameter="OutputPath" ItemName="Content" />
</GenerateFileFromTemplate> </GenerateFileFromTemplate>
</Target> </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> </Project>

View File

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