Skip to content

Commit 3434fbd

Browse files
committed
Add 'EnableIncrementalGeneration'
1 parent 420dde4 commit 3434fbd

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/RunCsWinRTGenerator.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public sealed class RunCsWinRTGenerator : ToolTask
7676
/// </summary>
7777
public bool ValidateWinRTRuntimeDllVersion2References { get; set; } = true;
7878

79+
/// <summary>
80+
/// Gets whether to enable incremental generation (i.e. with a cache file on disk saving the full set of types to generate).
81+
/// </summary>
82+
public bool EnableIncrementalGeneration { get; set; } = true;
83+
7984
/// <summary>
8085
/// Gets whether to treat warnings coming from 'cswinrtgen' as errors (regardless of the global 'TreatWarningsAsErrors' setting).
8186
/// </summary>
@@ -216,6 +221,7 @@ protected override string GenerateResponseFileCommands()
216221
AppendResponseFileCommand(args, "--use-windows-ui-xaml-projections", UseWindowsUIXamlProjections.ToString());
217222
AppendResponseFileCommand(args, "--validate-winrt-runtime-assembly-version", ValidateWinRTRuntimeAssemblyVersion.ToString());
218223
AppendResponseFileCommand(args, "--validate-winrt-runtime-dll-version-2-references", ValidateWinRTRuntimeDllVersion2References.ToString());
224+
AppendResponseFileCommand(args, "--enable-incremental-generation", EnableIncrementalGeneration.ToString());
219225
AppendResponseFileCommand(args, "--treat-warnings-as-errors", TreatWarningsAsErrors.ToString());
220226
AppendResponseFileCommand(args, "--max-degrees-of-parallelism", MaxDegreesOfParallelism.ToString());
221227

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Windows.targets

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ Copyright (c) .NET Foundation. All rights reserved.
185185
<CsWinRTGeneratorInteropAssemblyDirectory Condition="'$(CsWinRTGeneratorInteropAssemblyDirectory)' == ''">$(IntermediateOutputPath)</CsWinRTGeneratorInteropAssemblyDirectory>
186186
<CsWinRTGeneratorValidateWinRTRuntimeAssemblyVersion Condition="'$(CsWinRTGeneratorValidateWinRTRuntimeAssemblyVersion)' == ''">true</CsWinRTGeneratorValidateWinRTRuntimeAssemblyVersion>
187187
<CsWinRTGeneratorValidateWinRTRuntimeDllVersion2References Condition="'$(CsWinRTGeneratorValidateWinRTRuntimeDllVersion2References)' == ''">true</CsWinRTGeneratorValidateWinRTRuntimeDllVersion2References>
188+
<CsWinRTGeneratorEnableIncrementalGeneration Condition="'$(CsWinRTGeneratorEnableIncrementalGeneration)' == ''">true</CsWinRTGeneratorEnableIncrementalGeneration>
188189
<CsWinRTGeneratorTreatWarningsAsErrors Condition="'$(CsWinRTGeneratorTreatWarningsAsErrors)' == ''">false</CsWinRTGeneratorTreatWarningsAsErrors>
189190
<CsWinRTGeneratorMaxDegreesOfParallelism Condition="'$(CsWinRTGeneratorMaxDegreesOfParallelism)' == ''">-1</CsWinRTGeneratorMaxDegreesOfParallelism>
190191
<CsWinRTGeneratorStandardOutputImportance Condition="'$(CsWinRTGeneratorStandardOutputImportance)' == ''">High</CsWinRTGeneratorStandardOutputImportance>
@@ -248,6 +249,7 @@ Copyright (c) .NET Foundation. All rights reserved.
248249
<_RunCsWinRTGeneratorInputsCacheToHash Include="$(CsWinRTUseWindowsUIXamlProjections)" />
249250
<_RunCsWinRTGeneratorInputsCacheToHash Include="$(CsWinRTGeneratorValidateWinRTRuntimeAssemblyVersion)" />
250251
<_RunCsWinRTGeneratorInputsCacheToHash Include="$(CsWinRTGeneratorValidateWinRTRuntimeDllVersion2References)" />
252+
<_RunCsWinRTGeneratorInputsCacheToHash Include="$(CsWinRTGeneratorEnableIncrementalGeneration)" />
251253
<_RunCsWinRTGeneratorInputsCacheToHash Include="$(CsWinRTGeneratorTreatWarningsAsErrors)" />
252254
<_RunCsWinRTGeneratorInputsCacheToHash Include="$(CsWinRTGeneratorMaxDegreesOfParallelism)" />
253255
<_RunCsWinRTGeneratorInputsCacheToHash Include="$(CsWinRTGeneratorLogStandardErrorAsError)" />
@@ -294,6 +296,7 @@ Copyright (c) .NET Foundation. All rights reserved.
294296
UseWindowsUIXamlProjections="$(CsWinRTUseWindowsUIXamlProjections)"
295297
ValidateWinRTRuntimeAssemblyVersion="$(CsWinRTGeneratorValidateWinRTRuntimeAssemblyVersion)"
296298
ValidateWinRTRuntimeDllVersion2References="$(CsWinRTGeneratorValidateWinRTRuntimeDllVersion2References)"
299+
EnableIncrementalGeneration="$(CsWinRTGeneratorEnableIncrementalGeneration)"
297300
TreatWarningsAsErrors="$(CsWinRTGeneratorTreatWarningsAsErrors)"
298301
MaxDegreesOfParallelism="$(CsWinRTGeneratorMaxDegreesOfParallelism)"
299302
AdditionalArguments="@(CsWinRTGeneratorAdditionalArgument)"

0 commit comments

Comments
 (0)