-
Notifications
You must be signed in to change notification settings - Fork 199
/
Copy pathCIFeatureFlags.ps1
38 lines (31 loc) · 1.34 KB
/
CIFeatureFlags.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[CmdletBinding(PositionalBinding = $false)]
param(
[string]$flags = ''
)
if ($flags -eq '') {
# Reads flags from the build name if not provided
# Example: FeatureFlags - ForceRuntimeCodeGeneration,UseRazorCohostServer
$flags = $env:Build_CronSchedule_DisplayName).Substring(0, 'FeatureFlags -'.Length)
}
# Matches src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/WellKnownFeatureFlagNames.cs
$knownFlags = @{
ShowAllCSharpCodeActions = "Razor.LSP.ShowAllCSharpCodeActions";
IncludeProjectKeyInGeneratedFilePath = "Razor.LSP.IncludeProjectKeyInGeneratedFilePath";
UsePreciseSemanticTokenRanges = "Razor.LSP.UsePreciseSemanticTokenRanges";
UseRazorCohostServer = "Razor.LSP.UseRazorCohostServer";
DisableRazorLanguageServer = "Razor.LSP.DisableRazorLanguageServer";
ForceRuntimeCodeGeneration = "Razor.LSP.ForceRuntimeCodeGeneration";
UseRoslynTokenizer = "Razor.LSP.UseRoslynTokenizer";
}
Write-Host "Setting flags from $flags"
foreach ($flag in $flags.Split(',')) {
Write-Host "Searching for '$flag'"
$match = $knownFlags.Keys | ?{ $_ -ieq $flag } | select -first 1
if ($match -ne $NULL) {
$value = $knownFlags[$match]
Write-Host "$match -> $value"
Write-Host "Setting $value"
& "./featureFlag.ps1 -set -enable -flag $value"
}
}
Write-Host "Done setting flags"