Skip to content

Commit 597b923

Browse files
committed
FIXUP: Another way of setting config
1 parent c135599 commit 597b923

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.build.ps1

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ 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"
11+
812
task SetupDotNet -Before Clean, Build, BuildHost, Test, TestPowerShellApi {
913

1014
# Bail out early if we've already found the exe path
@@ -58,14 +62,14 @@ task SetupDotNet -Before Clean, Build, BuildHost, Test, TestPowerShellApi {
5862
}
5963

6064
task Clean {
61-
exec { & dotnet clean .\PowerShellEditorServices.sln }
65+
exec { & dotnet clean .\PowerShellEditorServices.sln -- /p:Platform="$script:BuildPlatform" }
6266
}
6367

6468
function BuildForPowerShellVersion($version) {
65-
exec { & dotnet restore .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -- /p:PowerShellVersion=$version }
69+
exec { & dotnet restore .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -- /p:PowerShellVersion=$version /p:Platform="$script:BuildPlatform" }
6670

6771
Write-Host -ForegroundColor Green "`n### Testing API usage for PowerShell $version...`n"
68-
exec { & dotnet build -f net451 .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -- /p:PowerShellVersion=$version}
72+
exec { & dotnet build -f net451 .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -- /p:PowerShellVersion=$version /p:Platform="$script:BuildPlatform" }
6973
}
7074

7175
task TestPowerShellApi {
@@ -81,8 +85,8 @@ task BuildHost {
8185
}
8286

8387
task Build {
84-
exec { & dotnet restore -v:m .\PowerShellEditorServices.sln }
85-
exec { & dotnet build -c $Configuration .\PowerShellEditorServices.sln }
88+
exec { & dotnet restore -v:m .\PowerShellEditorServices.sln -- /p:Platform="$script:BuildPlatform" }
89+
exec { & dotnet build -c $Configuration .\PowerShellEditorServices.sln -- /p:Platform="$script:BuildPlatform" }
8690
}
8791

8892
task Test {
@@ -91,9 +95,9 @@ task Test {
9195
$testParams = @{"l" = "appveyor"}
9296
}
9397

94-
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test\PowerShellEditorServices.Test.csproj }
95-
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test.Protocol\PowerShellEditorServices.Test.Protocol.csproj }
96-
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test.Host\PowerShellEditorServices.Test.Host.csproj }
98+
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test\PowerShellEditorServices.Test.csproj -- /p:Platform="$script:BuildPlatform" }
99+
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test.Protocol\PowerShellEditorServices.Test.Protocol.csproj -- /p:Platform="$script:BuildPlatform" }
100+
exec { & dotnet test -c $Configuration @testParams .\test\PowerShellEditorServices.Test.Host\PowerShellEditorServices.Test.Host.csproj -- /p:Platform="$script:BuildPlatform" }
97101
}
98102

99103
task LayoutModule -After Build, BuildHost {

0 commit comments

Comments
 (0)