|
5 | 5 | [ValidateSet("Debug", "Release")]
|
6 | 6 | [string]$Configuration = "Debug",
|
7 | 7 |
|
| 8 | + [switch]$LocalOmniSharp, |
| 9 | + |
8 | 10 | [string]$PsesSubmodulePath = "$PSScriptRoot/module",
|
9 | 11 |
|
10 | 12 | [string]$ModulesJsonPath = "$PSScriptRoot/modules.json",
|
11 | 13 |
|
12 | 14 | [string]$DefaultModuleRepository = "PSGallery",
|
13 | 15 |
|
14 |
| - [string[]]$VerbosityArgs = @("--verbosity", "quiet", "--nologo"), |
| 16 | + [string]$Verbosity = "quiet", |
15 | 17 |
|
16 | 18 | # See: https://docs.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests
|
17 | 19 | [string]$TestFilter = '',
|
18 | 20 |
|
19 | 21 | # See: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test
|
20 |
| - [string[]]$TestArgs = $VerbosityArgs + @("--logger", "console;verbosity=normal", "--logger", "trx") |
| 22 | + [string[]]$TestArgs = @("--logger", "console;verbosity=normal", "--logger", "trx") |
21 | 23 | )
|
22 | 24 |
|
23 | 25 | #Requires -Modules @{ModuleName="InvokeBuild"; ModuleVersion="5.0.0"}
|
24 | 26 | #Requires -Modules @{ModuleName="platyPS"; ModuleVersion="0.14.0"}
|
25 | 27 |
|
26 |
| -$script:dotnetTestArgs = @( |
27 |
| - "test" |
28 |
| - $TestArgs |
| 28 | +$script:dotnetBuildArgs = @( |
| 29 | + "--verbosity" |
| 30 | + $Verbosity |
| 31 | + "--nologo" |
| 32 | + "-c" |
| 33 | + $Configuration |
| 34 | + if ($LocalOmniSharp) { "-property:LocalOmniSharp=true" } |
| 35 | +) |
| 36 | + |
| 37 | +$script:dotnetTestArgs = @("test") + $script:dotnetBuildArgs + $TestArgs + @( |
29 | 38 | if ($TestFilter) { "--filter", $TestFilter }
|
30 | 39 | "--framework"
|
31 | 40 | )
|
@@ -80,7 +89,7 @@ Task BinClean {
|
80 | 89 | }
|
81 | 90 |
|
82 | 91 | Task Clean FindDotNet, BinClean, {
|
83 |
| - Invoke-BuildExec { & dotnet clean $VerbosityArgs } |
| 92 | + Invoke-BuildExec { & dotnet clean --verbosity $Verbosity } |
84 | 93 | Get-ChildItem -Recurse $PSScriptRoot\src\*.nupkg | Remove-BuildItem
|
85 | 94 | Get-ChildItem $PSScriptRoot\PowerShellEditorServices*.zip | Remove-BuildItem
|
86 | 95 | Get-ChildItem $PSScriptRoot\module\PowerShellEditorServices\Commands\en-US\*-help.xml | Remove-BuildItem
|
@@ -162,15 +171,14 @@ Task SetupHelpForTests {
|
162 | 171 | }
|
163 | 172 |
|
164 | 173 | Task Build FindDotNet, CreateBuildInfo, {
|
165 |
| - Invoke-BuildExec { & dotnet restore $VerbosityArgs } |
166 |
| - Invoke-BuildExec { & dotnet publish $VerbosityArgs -c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script:NetRuntime.Standard } |
167 |
| - Invoke-BuildExec { & dotnet publish $VerbosityArgs -c $Configuration .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetRuntime.PS7 } |
| 174 | + Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script:NetRuntime.Standard } |
| 175 | + Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetRuntime.PS7 } |
168 | 176 | if (-not $script:IsNix) {
|
169 |
| - Invoke-BuildExec { & dotnet publish $VerbosityArgs -c $Configuration .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetRuntime.Desktop } |
| 177 | + Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetRuntime.Desktop } |
170 | 178 | }
|
171 | 179 |
|
172 | 180 | # Build PowerShellEditorServices.VSCode module
|
173 |
| - Invoke-BuildExec { & dotnet publish $VerbosityArgs -c $Configuration .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj -f $script:NetRuntime.Standard } |
| 181 | + Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj -f $script:NetRuntime.Standard } |
174 | 182 | }
|
175 | 183 |
|
176 | 184 | Task Test TestServer, TestE2E
|
|
0 commit comments