2
2
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
3
4
4
using System ;
5
- using System . Diagnostics ;
6
5
using System . Collections . Generic ;
7
6
using System . Linq ;
8
- using System . Threading ;
9
7
using Microsoft . AspNetCore . Razor . Language ;
10
8
using Microsoft . CodeAnalysis ;
11
9
@@ -23,7 +21,6 @@ internal class RazorSourceGenerationContext
23
21
24
22
public RazorConfiguration Configuration { get ; private set ; }
25
23
26
-
27
24
/// <summary>
28
25
/// Gets a flag that determines if the source generator waits for the debugger to attach.
29
26
/// <para>
@@ -34,13 +31,9 @@ internal class RazorSourceGenerationContext
34
31
public bool WaitForDebugger { get ; private set ; }
35
32
36
33
/// <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> .
38
35
/// </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 ; }
44
37
45
38
public RazorSourceGenerationContext ( GeneratorExecutionContext context )
46
39
{
@@ -67,7 +60,8 @@ public RazorSourceGenerationContext(GeneratorExecutionContext context)
67
60
}
68
61
69
62
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 ) ;
71
65
72
66
var razorConfiguration = RazorConfiguration . Create ( razorLanguageVersion , configurationName , Enumerable . Empty < RazorExtension > ( ) , true ) ;
73
67
var ( razorFiles , cshtmlFiles ) = GetRazorInputs ( context ) ;
@@ -79,7 +73,7 @@ public RazorSourceGenerationContext(GeneratorExecutionContext context)
79
73
RazorFiles = razorFiles ;
80
74
CshtmlFiles = cshtmlFiles ;
81
75
WaitForDebugger = waitForDebugger == "true" ;
82
- EnableLogging = enableLogging == "true" ;
76
+ GenerateMetadataSourceChecksumAttributes = generateMetadataSourceChecksumAttributes == "true" ;
83
77
}
84
78
85
79
private static VirtualRazorProjectFileSystem GetVirtualFileSystem ( GeneratorExecutionContext context , IReadOnlyList < RazorInputItem > razorFiles , IReadOnlyList < RazorInputItem > cshtmlFiles )
0 commit comments