diff --git a/build/scripts/createrunsettings.ps1 b/build/scripts/createrunsettings.ps1 index 208e53123307cdda1ae3fb694771d48174e6d77f..02b4446030dc578f457b4a8c3ca23cfae79501b5 100644 --- a/build/scripts/createrunsettings.ps1 +++ b/build/scripts/createrunsettings.ps1 @@ -7,9 +7,9 @@ $ErrorActionPreference = "Stop" try { . (Join-Path $PSScriptRoot "build-utils.ps1") - Push-Location $repoDir + Push-Location $RepoRoot - Write-Host "Repo Dir $repoDir" + Write-Host "Repo Dir $RepoRoot" Write-Host "Binaries Dir $binariesDir" $buildConfiguration = if ($release) { "Release" } else { "Debug" } @@ -17,7 +17,7 @@ try { $optProfToolDir = Get-PackageDir "Roslyn.OptProf.RunSettings.Generator" $optProfToolExe = Join-Path $optProfToolDir "tools\roslyn.optprof.runsettings.generator.exe" - $configFile = Join-Path $repoDir "build\config\optprof.json" + $configFile = Join-Path $RepoRoot "build\config\optprof.json" $outputFolder = Join-Path $configDir "Insertion\RunSettings" $optProfArgs = "--configFile $configFile --outputFolder $outputFolder --buildNumber 28320.3001 " diff --git a/build/scripts/test-build-correctness.ps1 b/build/scripts/test-build-correctness.ps1 index 3dbd8a9531d307e9c5504e32465ef04d39f7cbfa..e72b690c5432c879539a76ec3fde561ad23239a0 100644 --- a/build/scripts/test-build-correctness.ps1 +++ b/build/scripts/test-build-correctness.ps1 @@ -36,7 +36,30 @@ try { # Verify the state of our generated syntax files Write-Host "Checking generated compiler files" Exec-Block { & (Join-Path $PSScriptRoot "generate-compiler-code.ps1") -test } + Write-Host "" + + # Verfiy the state of creating run settings for optprof + Write-Host "Checking run generation for optprof" + + # set environment variables + if (-not (Test-Path env:SYSTEM_TEAMPROJECT)) { $env:SYSTEM_TEAMPROJECT = "DevDiv" } + if (-not (Test-Path env:BUILD_REPOSITORY_NAME)) { $env:BUILD_REPOSITORY_NAME = "dotnet/roslyn" } + if (-not (Test-Path env:BUILD_SOURCEBRANCHNAME)) { $env:BUILD_SOURCEBRANCHNAME = "test" } + if (-not (Test-Path env:BUILD_BUILDID)) { $env:BUILD_BUILDID = "42.42.42.42" } + if (-not (Test-Path env:BUILD_SOURCESDIRECTORY)) { $env:BUILD_SOURCESDIRECTORY = $RepoRoot } + if (-not (Test-Path env:BUILD_STAGINGDIRECTORY)) { $env:BUILD_STAGINGDIRECTORY = $configDir } + + # create a fake BootstrapperInfo.json file + $bootstrapperInfoFolder = Join-Path $configDir "MicroBuild\Output" + Create-Directory $bootstrapperInfoFolder + + $bootstrapperInfoPath = Join-Path $bootstrapperInfoFolder "BootstrapperInfo.json" + $bootstrapperInfoContent = "[{""VSBuildVersion"": ""42.42.42424.42""}]" + $bootstrapperInfoContent >> $bootstrapperInfoPath + # generate run settings + Exec-Block { & (Join-Path $PSScriptRoot "createrunsettings.ps1") } + exit 0 } catch [exception] {