[Windows] Merge several toolset provisioners into single Configure-Toolset script (#1111)

* Add Configure-Toolset for windows

* Set error action preference to stop

* Move toolcache.json to config folder

* Fix in verbose

* Rename toolsets folder

* Move default version functions from install-toolset to configure-toolset

* Rework Configure-Toolset

* Fix typo and remove empty line

* Fix issues

* Fix parameters in helpers

* Fix helper syntax

* Rename defaultVariable
This commit is contained in:
Maksim Petrov
2020-06-30 07:48:55 +03:00
committed by GitHub
parent a89f839675
commit 8d0d6f85cc
13 changed files with 160 additions and 166 deletions

View File

@@ -75,34 +75,11 @@ $toolsExecutables = @{
$tools = Get-ToolsetContent | Select-Object -ExpandProperty toolcache
foreach($tool in $tools) {
$toolPath = Join-Path $env:AGENT_TOOLSDIRECTORY $tool.name
# Get executables for current tool
$toolExecs = $toolsExecutables[$tool.name]
foreach ($version in $tool.versions) {
# Add wildcard if missing
if ($version.Split(".").Length -lt 3) {
$version += ".*"
}
# Check if version folder exists
$expectedVersionPath = Join-Path $toolPath $version
if (-not (Test-Path $expectedVersionPath)) {
Write-Host "Expected $($tool.name) $version folder is not found!"
exit 1
}
# Take latest installed version in case if toolset version contains wildcards
$foundVersion = Get-Item $expectedVersionPath `
| Sort-Object -Property {[version]$_.name} -Descending `
| Select-Object -First 1
# Check for required architecture folder
$foundVersionArchPath = Join-Path $foundVersion $tool.arch
if (-not (Test-Path $foundVersionArchPath)) {
Write-Host "Expected $($tool.name)($($tool.arch)) $($foundVersion.name) architecture folder is not found!"
exit 1
}
$foundVersionArchPath = Get-ToolsetToolFullPath -Name $tool.name -Version $version -Arch $tool.arch
if ($toolExecs) {
Write-Host "Run validation test for $($tool.name)($($tool.arch)) $($foundVersion.name) executables..."