Make RazorCompileOnPublish the default
This commit is contained in:
parent
627696677c
commit
0584fe3ecf
|
|
@ -8,8 +8,8 @@
|
||||||
configure this behaviour.
|
configure this behaviour.
|
||||||
-->
|
-->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<RazorCompileOnBuild Condition="'$(RazorCompileOnBuild)'==''">false</RazorCompileOnBuild>
|
<RazorGenerateDependsOn>RazorResolveGenerateInputs;RazorCoreGenerate</RazorGenerateDependsOn>
|
||||||
<RazorCompileOnPublish Condition="'$(RazorCompileOnPublish)'==''">false</RazorCompileOnPublish>
|
<RazorCompileDependsOn>RazorGenerate;RazorCoreCompile</RazorCompileDependsOn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,13 @@
|
||||||
Default values for properties that affect Razor MSBuild behavior.
|
Default values for properties that affect Razor MSBuild behavior.
|
||||||
-->
|
-->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
<!--
|
||||||
|
Razor also attaches itself by default to some of the standard .NET targets. Uses these properties to
|
||||||
|
configure this behaviour.
|
||||||
|
-->
|
||||||
|
<RazorCompileOnBuild Condition="'$(RazorCompileOnBuild)'==''">false</RazorCompileOnBuild>
|
||||||
|
<RazorCompileOnPublish Condition="'$(RazorCompileOnPublish)'==''">true</RazorCompileOnPublish>
|
||||||
|
|
||||||
<!-- Output directory used for generated files -->
|
<!-- Output directory used for generated files -->
|
||||||
<RazorGenerateOutputPath Condition="'$(RazorGenerateOutputPath)'==''">$(IntermediateOutputPath)Razor\</RazorGenerateOutputPath>
|
<RazorGenerateOutputPath Condition="'$(RazorGenerateOutputPath)'==''">$(IntermediateOutputPath)Razor\</RazorGenerateOutputPath>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,27 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
||||||
{
|
{
|
||||||
public class PublishIntegrationTest : MSBuildIntegrationTestBase
|
public class PublishIntegrationTest : MSBuildIntegrationTestBase
|
||||||
{
|
{
|
||||||
|
[Fact]
|
||||||
|
[InitializeTestProject("SimpleMvc")]
|
||||||
|
public async Task Publish_RazorCompileOnPublish_IsDefault()
|
||||||
|
{
|
||||||
|
var result = await DotnetMSBuild("Publish");
|
||||||
|
|
||||||
|
Assert.BuildPassed(result);
|
||||||
|
|
||||||
|
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll");
|
||||||
|
Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb");
|
||||||
|
|
||||||
|
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll");
|
||||||
|
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb");
|
||||||
|
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll");
|
||||||
|
Assert.FileExists(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb");
|
||||||
|
|
||||||
|
// By default refs and .cshtml files will not be copied on publish
|
||||||
|
Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "refs"), "*.dll");
|
||||||
|
Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "Views"), "*.cshtml");
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[InitializeTestProject("SimpleMvc")]
|
[InitializeTestProject("SimpleMvc")]
|
||||||
public async Task Publish_WithRazorCompileOnBuild_PublishesAssembly()
|
public async Task Publish_WithRazorCompileOnBuild_PublishesAssembly()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue