Prepare for Razor Sdk to be imported by Web Sdk

This commit is contained in:
Pranav K 2018-02-08 14:18:49 -08:00
parent 6c75f29419
commit e537cdd319
2 changed files with 32 additions and 0 deletions

View File

@ -39,9 +39,23 @@ Copyright (c) .NET Foundation. All rights reserved.
--> -->
<CopyRefAssembliesToPublishDirectory Condition="'$(CopyRefAssembliesToPublishDirectory)'==''">false</CopyRefAssembliesToPublishDirectory> <CopyRefAssembliesToPublishDirectory Condition="'$(CopyRefAssembliesToPublishDirectory)'==''">false</CopyRefAssembliesToPublishDirectory>
<!--
Determines the toolset to use to compile Razor (.cshtml) files. Defaults to 'Implicit' to let the Razor Sdk determine the toolset to use.
Valid values include 'Implicit', 'RazorSdk', and 'PrecompilationTool'.
-->
<RazorCompileToolset>Implicit</RazorCompileToolset>
<!--
Set to true to allow a Razor code generation to use a persistent build server process.
-->
<UseRazorBuildServer Condition="'$(UseRazorBuildServer)'==''">false</UseRazorBuildServer> <UseRazorBuildServer Condition="'$(UseRazorBuildServer)'==''">false</UseRazorBuildServer>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(_WebSdkHeartsRazorSdk)' == 'true' AND '$(EnableDefaultItems)' == 'true' And '$(EnableDefaultContentItems)' == 'true'">
<Content Include="**\*.cshtml" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder);$(DefaultWebContentItemExcludes)" />
<None Remove="**\*.cshtml" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<!-- <!--
Defines the generic .NET Core 'Razor' capability. Defines the generic .NET Core 'Razor' capability.

View File

@ -127,6 +127,24 @@ Copyright (c) .NET Foundation. All rights reserved.
<_RazorDebugSymbolsProduced Condition="'$(DebugType)'=='embedded'">false</_RazorDebugSymbolsProduced> <_RazorDebugSymbolsProduced Condition="'$(DebugType)'=='embedded'">false</_RazorDebugSymbolsProduced>
</PropertyGroup> </PropertyGroup>
<!-- Resolve the toolset to use -->
<PropertyGroup Condition="'$(_WebSdkHeartsRazorSdk)' == 'true'">
<!-- Default value for the property 'MvcRazorCompileOnPublish' is empty. If it has been explicitly enabled, continue using precompilation. -->
<ResolvedRazorCompileToolset Condition="'$(MvcRazorCompileOnPublish)' == 'true'">PrecompilationTool</ResolvedRazorCompileToolset>
<!-- The default value for 'RazorCompileToolset' was not modified. In this case, infer the toolset to use as RazorSdk. -->
<ResolvedRazorCompileToolset Condition="'$(MvcRazorCompileOnPublish)' == '' AND '$(RazorCompileToolset)' == 'Implicit'">RazorSdk</ResolvedRazorCompileToolset>
<ResolvedRazorCompileToolset Condition="'$(MvcRazorCompileOnPublish)' == '' AND '$(RazorCompileToolset)' == 'PrecompilationTool'">$(RazorCompileToolset)</ResolvedRazorCompileToolset>
<ResolvedRazorCompileToolset Condition="'$(MvcRazorCompileOnPublish)' == '' AND '$(RazorCompileToolset)' == 'RazorSdk'">$(RazorCompileToolset)</ResolvedRazorCompileToolset>
<!-- If RazorSdk is not referenced, fall-back to Precompilation tool -->
<ResolvedRazorCompileToolset Condition="'$(ResolvedRazorCompileToolset)' == 'RazorSdk' And '$(IsRazorCompilerReferenced)' != 'true'">PrecompilationTool</ResolvedRazorCompileToolset>
<!-- Previous versions of the precompilation tool still depends on the msbuild property 'MvcRazorCompileOnPublish'. Hence, setting it to the old default value -->
<MvcRazorCompileOnPublish Condition="'$(MvcRazorCompileOnPublish)' == ''">true</MvcRazorCompileOnPublish>
</PropertyGroup>
<!-- <!--
Properties that configure Razor SDK, but need to be defined in targets due to evaluation order. Properties that configure Razor SDK, but need to be defined in targets due to evaluation order.
--> -->