Skip to content

Commit

Permalink
Fix incrementalism of Blazor solution
Browse files Browse the repository at this point in the history
  • Loading branch information
rynowak committed Jul 31, 2019
1 parent 1434e23 commit b42ebf1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
13 changes: 6 additions & 7 deletions src/Components/Blazor/Build/src/ReferenceFromSource.props
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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)" />

Expand All @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<PackageTags>aspnetcore;iis</PackageTags>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NativeAssetsTargetFramework>netcoreapp3.0</NativeAssetsTargetFramework>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -44,6 +43,9 @@
</ItemGroup>

<Import Project="..\..\build\assets.props" />
<ItemGroup>
<UpToDateCheckInput Include="@(InProcessComponents)" />
</ItemGroup>

<Target Name="AddPackNativeComponents" BeforeTargets="_GetPackageFiles" Condition="$(PackNativeAssets) == 'true'">
<ItemGroup>
Expand Down

0 comments on commit b42ebf1

Please sign in to comment.