5
5
6
6
# Requires -Modules @ {ModuleName = " InvokeBuild" ;ModuleVersion = " 3.2.1" }
7
7
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
+
8
12
task SetupDotNet - Before Clean , Build, BuildHost, Test, TestPowerShellApi {
9
13
10
14
# Bail out early if we've already found the exe path
@@ -58,14 +62,14 @@ task SetupDotNet -Before Clean, Build, BuildHost, Test, TestPowerShellApi {
58
62
}
59
63
60
64
task Clean {
61
- exec { & dotnet clean .\PowerShellEditorServices.sln }
65
+ exec { & dotnet clean .\PowerShellEditorServices.sln -- / p:Platform = " $ script :BuildPlatform " }
62
66
}
63
67
64
68
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 " }
66
70
67
71
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 " }
69
73
}
70
74
71
75
task TestPowerShellApi {
@@ -81,8 +85,8 @@ task BuildHost {
81
85
}
82
86
83
87
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 " }
86
90
}
87
91
88
92
task Test {
@@ -91,9 +95,9 @@ task Test {
91
95
$testParams = @ {" l" = " appveyor" }
92
96
}
93
97
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 " }
97
101
}
98
102
99
103
task LayoutModule - After Build, BuildHost {
0 commit comments