@@ -50,6 +50,7 @@ param (
50
50
[switch ]$testCompiler ,
51
51
[switch ]$testFSharpCore ,
52
52
[switch ]$testFSharpQA ,
53
+ [switch ]$testScripting ,
53
54
[switch ]$testVs ,
54
55
[switch ]$testAll ,
55
56
[string ]$officialSkipTests = " false" ,
@@ -59,6 +60,8 @@ param (
59
60
60
61
Set-StrictMode - version 2.0
61
62
$ErrorActionPreference = " Stop"
63
+ $BuildCategory = " "
64
+ $BuildMessage = " "
62
65
63
66
function Print-Usage () {
64
67
Write-Host " Common settings:"
@@ -86,6 +89,7 @@ function Print-Usage() {
86
89
Write-Host " -testCoreClr Run tests against CoreCLR"
87
90
Write-Host " -testFSharpCore Run FSharpCore unit tests"
88
91
Write-Host " -testFSharpQA Run F# Cambridge tests"
92
+ Write-Host " -testScripting Run Scripting tests"
89
93
Write-Host " -testVs Run F# editor unit tests"
90
94
Write-Host " -officialSkipTests <bool> Set to 'true' to skip running tests"
91
95
Write-Host " "
@@ -148,11 +152,11 @@ function Process-Arguments() {
148
152
149
153
function Update-Arguments () {
150
154
if ($script :noVisualStudio ) {
151
- $script :bootstrapTfm = " netcoreapp2.1 "
155
+ $script :bootstrapTfm = " netcoreapp3.0 "
152
156
$script :msbuildEngine = " dotnet"
153
157
}
154
158
155
- if ($bootstrapTfm -eq " netcoreapp2.1 " ) {
159
+ if ($bootstrapTfm -eq " netcoreapp3.0 " ) {
156
160
if (-Not (Test-Path " $ArtifactsDir \Bootstrap\fsc\fsc.runtimeconfig.json" )) {
157
161
$script :bootstrap = $True
158
162
}
@@ -216,7 +220,7 @@ function UpdatePath() {
216
220
TestAndAddToPath $subdir
217
221
218
222
# add windows SDK dir for ildasm.exe
219
- foreach ($child in Get-ChildItem " ${env: ProgramFiles(x86)} \Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.?.? Tools" ) {
223
+ foreach ($child in Get-ChildItem " ${env: ProgramFiles(x86)} \Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.* Tools" ) {
220
224
$subdir = $child
221
225
}
222
226
TestAndAddToPath $subdir
@@ -256,7 +260,7 @@ function TestUsingNUnit([string] $testProject, [string] $targetFramework) {
256
260
}
257
261
258
262
function BuildCompiler () {
259
- if ($bootstrapTfm -eq " netcoreapp2.1 " ) {
263
+ if ($bootstrapTfm -eq " netcoreapp3.0 " ) {
260
264
$dotnetPath = InitializeDotNetCli
261
265
$dotnetExe = Join-Path $dotnetPath " dotnet.exe"
262
266
$fscProject = " $RepoRoot \src\fsharp\fsc\fsc.fsproj"
@@ -265,10 +269,10 @@ function BuildCompiler() {
265
269
$argNoRestore = if ($norestore ) { " --no-restore" } else { " " }
266
270
$argNoIncremental = if ($rebuild ) { " --no-incremental" } else { " " }
267
271
268
- $args = " build $fscProject -c $configuration -v $verbosity -f netcoreapp2.1 " + $argNoRestore + $argNoIncremental
272
+ $args = " build $fscProject -c $configuration -v $verbosity -f netcoreapp3.0 " + $argNoRestore + $argNoIncremental
269
273
Exec- Console $dotnetExe $args
270
274
271
- $args = " build $fsiProject -c $configuration -v $verbosity -f netcoreapp2.1 " + $argNoRestore + $argNoIncremental
275
+ $args = " build $fsiProject -c $configuration -v $verbosity -f netcoreapp3.0 " + $argNoRestore + $argNoIncremental
272
276
Exec- Console $dotnetExe $args
273
277
}
274
278
}
@@ -298,6 +302,9 @@ function EnablePreviewSdks() {
298
302
}
299
303
300
304
try {
305
+ $script :BuildCategory = " Build"
306
+ $script :BuildMessage = " Failure preparing build"
307
+
301
308
Process - Arguments
302
309
303
310
. (Join-Path $PSScriptRoot " build-utils.ps1" )
@@ -309,17 +316,14 @@ try {
309
316
if ($ci ) {
310
317
Prepare- TempDir
311
318
EnablePreviewSdks
312
-
313
- # enable us to build netcoreapp2.1 product binaries
314
- $global :_DotNetInstallDir = Join-Path $RepoRoot " .dotnet"
315
- InstallDotNetSdk $global :_DotNetInstallDir $GlobalJson.tools.dotnet
316
- InstallDotNetSdk $global :_DotNetInstallDir " 2.1.503"
317
319
}
318
320
319
321
if ($bootstrap ) {
322
+ $script :BuildMessage = " Failure building bootstrap compiler"
320
323
$bootstrapDir = Make- BootstrapBuild
321
324
}
322
325
326
+ $script :BuildMessage = " Failure building product"
323
327
if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish ) {
324
328
if ($noVisualStudio ) {
325
329
BuildCompiler
@@ -332,12 +336,13 @@ try {
332
336
VerifyAssemblyVersionsAndSymbols
333
337
}
334
338
339
+ $script :BuildCategory = " Test"
340
+ $script :BuildMessage = " Failure running tests"
335
341
$desktopTargetFramework = " net472"
336
342
$coreclrTargetFramework = " netcoreapp3.0"
337
343
338
344
if ($testDesktop -and -not $noVisualStudio ) {
339
345
TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" - targetFramework $desktopTargetFramework
340
- TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj" - targetFramework $desktopTargetFramework
341
346
TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" - targetFramework $desktopTargetFramework
342
347
TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" - targetFramework $desktopTargetFramework
343
348
TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" - targetFramework $desktopTargetFramework
@@ -346,7 +351,6 @@ try {
346
351
347
352
if ($testCoreClr ) {
348
353
TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" - targetFramework $coreclrTargetFramework
349
- TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj" - targetFramework $coreclrTargetFramework
350
354
TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" - targetFramework $coreclrTargetFramework
351
355
TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" - targetFramework $coreclrTargetFramework
352
356
TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" - targetFramework $coreclrTargetFramework
@@ -394,6 +398,13 @@ try {
394
398
TestUsingNUnit - testProject " $RepoRoot \tests\fsharp\FSharpSuite.Tests.fsproj" - targetFramework $coreclrTargetFramework
395
399
}
396
400
401
+ if ($testScripting ) {
402
+ if (-not $noVisualStudio ) {
403
+ TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" - targetFramework $desktopTargetFramework
404
+ }
405
+ TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" - targetFramework $coreclrTargetFramework
406
+ }
407
+
397
408
if ($testVs -and -not $noVisualStudio ) {
398
409
TestUsingNUnit - testProject " $RepoRoot \vsintegration\tests\GetTypesVS.UnitTests\GetTypesVS.UnitTests.fsproj" - targetFramework $desktopTargetFramework
399
410
TestUsingNUnit - testProject " $RepoRoot \vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" - targetFramework $desktopTargetFramework
@@ -405,6 +416,7 @@ catch {
405
416
Write-Host $_
406
417
Write-Host $_.Exception
407
418
Write-Host $_.ScriptStackTrace
419
+ Write-PipelineTelemetryError - Category $script :BuildCategory - Message $script :BuildMessage
408
420
ExitWithExitCode 1
409
421
}
410
422
finally {
0 commit comments