@@ -50,6 +50,7 @@ param (
5050 [switch ]$testCompiler ,
5151 [switch ]$testFSharpCore ,
5252 [switch ]$testFSharpQA ,
53+ [switch ]$testScripting ,
5354 [switch ]$testVs ,
5455 [switch ]$testAll ,
5556 [string ]$officialSkipTests = " false" ,
@@ -59,6 +60,8 @@ param (
5960
6061Set-StrictMode - version 2.0
6162$ErrorActionPreference = " Stop"
63+ $BuildCategory = " "
64+ $BuildMessage = " "
6265
6366function Print-Usage () {
6467 Write-Host " Common settings:"
@@ -86,6 +89,7 @@ function Print-Usage() {
8689 Write-Host " -testCoreClr Run tests against CoreCLR"
8790 Write-Host " -testFSharpCore Run FSharpCore unit tests"
8891 Write-Host " -testFSharpQA Run F# Cambridge tests"
92+ Write-Host " -testScripting Run Scripting tests"
8993 Write-Host " -testVs Run F# editor unit tests"
9094 Write-Host " -officialSkipTests <bool> Set to 'true' to skip running tests"
9195 Write-Host " "
@@ -148,11 +152,11 @@ function Process-Arguments() {
148152
149153function Update-Arguments () {
150154 if ($script :noVisualStudio ) {
151- $script :bootstrapTfm = " netcoreapp2.1 "
155+ $script :bootstrapTfm = " netcoreapp3.0 "
152156 $script :msbuildEngine = " dotnet"
153157 }
154158
155- if ($bootstrapTfm -eq " netcoreapp2.1 " ) {
159+ if ($bootstrapTfm -eq " netcoreapp3.0 " ) {
156160 if (-Not (Test-Path " $ArtifactsDir \Bootstrap\fsc\fsc.runtimeconfig.json" )) {
157161 $script :bootstrap = $True
158162 }
@@ -216,7 +220,7 @@ function UpdatePath() {
216220 TestAndAddToPath $subdir
217221
218222 # 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" ) {
220224 $subdir = $child
221225 }
222226 TestAndAddToPath $subdir
@@ -256,7 +260,7 @@ function TestUsingNUnit([string] $testProject, [string] $targetFramework) {
256260}
257261
258262function BuildCompiler () {
259- if ($bootstrapTfm -eq " netcoreapp2.1 " ) {
263+ if ($bootstrapTfm -eq " netcoreapp3.0 " ) {
260264 $dotnetPath = InitializeDotNetCli
261265 $dotnetExe = Join-Path $dotnetPath " dotnet.exe"
262266 $fscProject = " $RepoRoot \src\fsharp\fsc\fsc.fsproj"
@@ -265,10 +269,10 @@ function BuildCompiler() {
265269 $argNoRestore = if ($norestore ) { " --no-restore" } else { " " }
266270 $argNoIncremental = if ($rebuild ) { " --no-incremental" } else { " " }
267271
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
269273 Exec- Console $dotnetExe $args
270274
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
272276 Exec- Console $dotnetExe $args
273277 }
274278}
@@ -298,6 +302,9 @@ function EnablePreviewSdks() {
298302}
299303
300304try {
305+ $script :BuildCategory = " Build"
306+ $script :BuildMessage = " Failure preparing build"
307+
301308 Process - Arguments
302309
303310 . (Join-Path $PSScriptRoot " build-utils.ps1" )
@@ -309,17 +316,14 @@ try {
309316 if ($ci ) {
310317 Prepare- TempDir
311318 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"
317319 }
318320
319321 if ($bootstrap ) {
322+ $script :BuildMessage = " Failure building bootstrap compiler"
320323 $bootstrapDir = Make- BootstrapBuild
321324 }
322325
326+ $script :BuildMessage = " Failure building product"
323327 if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish ) {
324328 if ($noVisualStudio ) {
325329 BuildCompiler
@@ -332,12 +336,13 @@ try {
332336 VerifyAssemblyVersionsAndSymbols
333337 }
334338
339+ $script :BuildCategory = " Test"
340+ $script :BuildMessage = " Failure running tests"
335341 $desktopTargetFramework = " net472"
336342 $coreclrTargetFramework = " netcoreapp3.0"
337343
338344 if ($testDesktop -and -not $noVisualStudio ) {
339345 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
341346 TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" - targetFramework $desktopTargetFramework
342347 TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" - targetFramework $desktopTargetFramework
343348 TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" - targetFramework $desktopTargetFramework
@@ -346,7 +351,6 @@ try {
346351
347352 if ($testCoreClr ) {
348353 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
350354 TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" - targetFramework $coreclrTargetFramework
351355 TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" - targetFramework $coreclrTargetFramework
352356 TestUsingNUnit - testProject " $RepoRoot \tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" - targetFramework $coreclrTargetFramework
@@ -394,6 +398,13 @@ try {
394398 TestUsingNUnit - testProject " $RepoRoot \tests\fsharp\FSharpSuite.Tests.fsproj" - targetFramework $coreclrTargetFramework
395399 }
396400
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+
397408 if ($testVs -and -not $noVisualStudio ) {
398409 TestUsingNUnit - testProject " $RepoRoot \vsintegration\tests\GetTypesVS.UnitTests\GetTypesVS.UnitTests.fsproj" - targetFramework $desktopTargetFramework
399410 TestUsingNUnit - testProject " $RepoRoot \vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" - targetFramework $desktopTargetFramework
@@ -405,6 +416,7 @@ catch {
405416 Write-Host $_
406417 Write-Host $_.Exception
407418 Write-Host $_.ScriptStackTrace
419+ Write-PipelineTelemetryError - Category $script :BuildCategory - Message $script :BuildMessage
408420 ExitWithExitCode 1
409421}
410422finally {
0 commit comments