22// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
44using System ;
5- using System . Diagnostics ;
65using System . Collections . Generic ;
76using System . Linq ;
8- using System . Threading ;
97using Microsoft . AspNetCore . Razor . Language ;
108using Microsoft . CodeAnalysis ;
119
@@ -23,7 +21,6 @@ internal class RazorSourceGenerationContext
2321
2422 public RazorConfiguration Configuration { get ; private set ; }
2523
26-
2724 /// <summary>
2825 /// Gets a flag that determines if the source generator waits for the debugger to attach.
2926 /// <para>
@@ -34,13 +31,9 @@ internal class RazorSourceGenerationContext
3431 public bool WaitForDebugger { get ; private set ; }
3532
3633 /// <summary>
37- /// Gets a flag that determine if the source generator should log verbose messages .
34+ /// Gets a flag that determines if generated Razor views and Pages includes the <c>RazorSourceChecksumAttribute</c> .
3835 /// </summary>
39- /// <para>
40- /// To configure this using MSBuild, use the <c>_RazorSourceGeneratorLog</c> property.
41- /// For instance <c>dotnet msbuild /p:_RazorSourceGeneratorLog=true</c>
42- /// </para>
43- public bool EnableLogging { get ; private set ; }
36+ public bool GenerateMetadataSourceChecksumAttributes { get ; private set ; }
4437
4538 public RazorSourceGenerationContext ( GeneratorExecutionContext context )
4639 {
@@ -67,7 +60,8 @@ public RazorSourceGenerationContext(GeneratorExecutionContext context)
6760 }
6861
6962 globalOptions . TryGetValue ( "build_property._RazorSourceGeneratorDebug" , out var waitForDebugger ) ;
70- globalOptions . TryGetValue ( "build_property._RazorSourceGeneratorLog" , out var enableLogging ) ;
63+
64+ globalOptions . TryGetValue ( "build_property.GenerateRazorMetadataSourceChecksumAttributes" , out var generateMetadataSourceChecksumAttributes ) ;
7165
7266 var razorConfiguration = RazorConfiguration . Create ( razorLanguageVersion , configurationName , Enumerable . Empty < RazorExtension > ( ) , true ) ;
7367 var ( razorFiles , cshtmlFiles ) = GetRazorInputs ( context ) ;
@@ -79,7 +73,7 @@ public RazorSourceGenerationContext(GeneratorExecutionContext context)
7973 RazorFiles = razorFiles ;
8074 CshtmlFiles = cshtmlFiles ;
8175 WaitForDebugger = waitForDebugger == "true" ;
82- EnableLogging = enableLogging == "true" ;
76+ GenerateMetadataSourceChecksumAttributes = generateMetadataSourceChecksumAttributes == "true" ;
8377 }
8478
8579 private static VirtualRazorProjectFileSystem GetVirtualFileSystem ( GeneratorExecutionContext context , IReadOnlyList < RazorInputItem > razorFiles , IReadOnlyList < RazorInputItem > cshtmlFiles )
0 commit comments