Skip to content

Commit ef35db7

Browse files
committed
Modify build script's Build task to not build solution
This change modifies the build script so that it doesn't build the entire solution file. This is needed because the test projects depend on net452 now due to xUnit requirements; building the solution with both net451 and net452 was causing compilation errors, so it was better to just take that out and let "dotnet test" build the test projects on demand.
1 parent 3fbd436 commit ef35db7

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

.vscode/tasks.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@
2828
"taskName": "Build",
2929
"suppressTaskName": true,
3030
"isBuildCommand": true,
31-
"args": [ "Invoke-Build BuildHost" ]
32-
},
33-
{
34-
"taskName": "Full Build",
35-
"suppressTaskName": true,
36-
"args": [ "Invoke-Build" ]
31+
"args": [ "Invoke-Build Build" ]
3732
},
3833
{
3934
"taskName": "Test",

PowerShellEditorServices.build.ps1

+4-9
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ if ($PSVersionTable.PSEdition -ne "Core") {
1818
Add-Type -Assembly System.IO.Compression.FileSystem
1919
}
2020

21-
task SetupDotNet -Before Restore, Clean, Build, BuildHost, Test, TestPowerShellApi, PackageNuGet {
21+
task SetupDotNet -Before Restore, Clean, Build, Test, TestPowerShellApi, PackageNuGet {
2222

23-
# Fetch the SDK version from global.json
2423
$requiredSdkVersion = "1.0.0-rc4-004771"
2524

2625
$needsInstall = $true
@@ -92,7 +91,7 @@ function NeedsRestore($rootPath) {
9291
return ($projectAssets -eq $null) -or ((Get-ChildItem $rootPath).Length -gt $projectAssets.Length)
9392
}
9493

95-
task Restore -If { "Restore" -in $BuildTask -or (NeedsRestore(".\src")) -or (NeedsRestore(".\test")) } -Before Clean, Build, BuildHost, Test {
94+
task Restore -If { "Restore" -in $BuildTask -or (NeedsRestore(".\src")) -or (NeedsRestore(".\test")) } -Before Clean, Build, Test {
9695
exec { & $script:dotnetExe restore }
9796
}
9897

@@ -136,12 +135,8 @@ task TestPowerShellApi -If { !$script:IsUnix } {
136135
exec { & $script:dotnetExe restore .\src\PowerShellEditorServices\PowerShellEditorServices.csproj }
137136
}
138137

139-
task BuildHost {
140-
exec { & $script:dotnetExe build -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj $script:TargetFrameworksParam }
141-
}
142-
143138
task Build {
144-
exec { & $script:dotnetExe build -c $Configuration .\PowerShellEditorServices.sln $script:TargetFrameworksParam }
139+
exec { & $script:dotnetExe build -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj $script:TargetFrameworksParam }
145140
}
146141

147142
function UploadTestLogs {
@@ -177,7 +172,7 @@ task CITest (job Test -Safe), {
177172
}
178173
}
179174

180-
task LayoutModule -After Build, BuildHost {
175+
task LayoutModule -After Build {
181176
New-Item -Force $PSScriptRoot\module\PowerShellEditorServices\bin\ -Type Directory | Out-Null
182177
New-Item -Force $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop -Type Directory | Out-Null
183178
New-Item -Force $PSScriptRoot\module\PowerShellEditorServices\bin\Core -Type Directory | Out-Null

0 commit comments

Comments
 (0)