Skip to content

Commit 4ef6311

Browse files
committed
FIXUP: Everything potentially fixed...
1 parent db57954 commit 4ef6311

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

.build.ps1

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ param(
55

66
#Requires -Modules @{ModuleName="InvokeBuild";ModuleVersion="3.2.1"}
77

8-
# AppVeyor causes trouble with the build platform, fix that
9-
# by setting the environment variable that MSBuild picks up
10-
$script:BuildPlatform = "Any CPU"
118
if ($env:APPVEYOR -ne $null) {
12-
# $env:Platform = "AnyCPU"
9+
dotnet --info
1310
}
1411

1512
task SetupDotNet -Before Clean, Build, BuildHost, Test, TestPowerShellApi {
@@ -64,23 +61,30 @@ task SetupDotNet -Before Clean, Build, BuildHost, Test, TestPowerShellApi {
6461
Write-Host "`n### Using dotnet at path $script:dotnetExe`n" -ForegroundColor Green
6562
}
6663

64+
task Restore {
65+
exec { & dotnet restore -v:m .\PowerShellEditorServices.sln }
66+
}
67+
6768
task Clean {
68-
# exec { & dotnet clean .\PowerShellEditorServices.sln -- /p:Platform="$script:BuildPlatform" }
69-
exec { & dotnet clean -v:diag .\src\PowerShellEditorServices\PowerShellEditorServices.csproj }
69+
exec { & dotnet clean .\PowerShellEditorServices.sln }
7070
}
7171

7272
function BuildForPowerShellVersion($version) {
73-
exec { & dotnet restore .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -- /p:PowerShellVersion=$version /p:Platform="$script:BuildPlatform" }
73+
# Restore packages for the specified version
74+
exec { & dotnet restore .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -- /p:PowerShellVersion=$version }
7475

7576
Write-Host -ForegroundColor Green "`n### Testing API usage for PowerShell $version...`n"
76-
exec { & dotnet build -f net451 .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -- /p:PowerShellVersion=$version /p:Platform="$script:BuildPlatform" }
77+
exec { & dotnet build -f net451 .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -- /p:PowerShellVersion=$version }
7778
}
7879

7980
task TestPowerShellApi {
8081
BuildForPowerShellVersion v3
8182
BuildForPowerShellVersion v4
8283
BuildForPowerShellVersion v5r1
8384
BuildForPowerShellVersion v5r2
85+
86+
# Do a final restore to put everything back to normal
87+
exec { & dotnet restore .\src\PowerShellEditorServices\PowerShellEditorServices.csproj }
8488
}
8589

8690
task BuildHost {
@@ -89,8 +93,7 @@ task BuildHost {
8993
}
9094

9195
task Build {
92-
exec { & dotnet restore -v:m .\PowerShellEditorServices.sln -- /p:Platform="$script:BuildPlatform" }
93-
exec { & dotnet build -c $Configuration .\PowerShellEditorServices.sln -- /p:Platform="$script:BuildPlatform" }
96+
exec { & dotnet build -c $Configuration .\PowerShellEditorServices.sln }
9497
}
9598

9699
task Test {
@@ -99,9 +102,9 @@ task Test {
99102
$testParams = @{"l" = "appveyor"}
100103
}
101104

102-
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test\PowerShellEditorServices.Test.csproj -- /p:Platform="$script:BuildPlatform" }
103-
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test.Protocol\PowerShellEditorServices.Test.Protocol.csproj -- /p:Platform="$script:BuildPlatform" }
104-
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test.Host\PowerShellEditorServices.Test.Host.csproj -- /p:Platform="$script:BuildPlatform" }
105+
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test\PowerShellEditorServices.Test.csproj }
106+
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test.Protocol\PowerShellEditorServices.Test.Protocol.csproj }
107+
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test.Host\PowerShellEditorServices.Test.Host.csproj }
105108
}
106109

107110
task LayoutModule -After Build, BuildHost {
@@ -114,4 +117,5 @@ task LayoutModule -After Build, BuildHost {
114117
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\
115118
}
116119

117-
task . Clean, Build, Test, TestPowerShellApi
120+
# The default task is to run the entire CI build
121+
task . Restore, Clean, Build, Test, TestPowerShellApi

0 commit comments

Comments
 (0)