2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
|
|
|
|
## File: Validate-Boost.ps1
|
|
|
|
|
## Desc: Validate Boost
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
function Validate-BoostVersion
|
|
|
|
|
{
|
|
|
|
|
Param
|
|
|
|
|
(
|
|
|
|
|
[String]$BoostRootPath,
|
|
|
|
|
[String]$BoostRelease
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
$ReleasePath = Join-Path -Path $BoostRootPath -ChildPath $BoostRelease
|
|
|
|
|
|
2020-01-29 10:41:09 +03:00
|
|
|
if (Test-Path "$ReleasePath\b2.exe")
|
2019-12-13 09:48:00 -05:00
|
|
|
{
|
|
|
|
|
Write-Host "Boost.Build $BoostRelease is successfully installed"
|
2020-01-29 10:41:09 +03:00
|
|
|
|
2019-12-13 09:48:00 -05:00
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Host "$BoostRelease not found"
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Verify that Boost is on the path
|
2020-01-29 10:41:09 +03:00
|
|
|
if (Get-Command -Name 'b2')
|
2019-12-13 09:48:00 -05:00
|
|
|
{
|
|
|
|
|
Write-Host "Boost is on the path"
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Write-Host "Boost is not on the path"
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Adding description of the software to Markdown
|
|
|
|
|
$tmplMark = @"
|
|
|
|
|
#### {0}
|
|
|
|
|
|
|
|
|
|
_Environment:_
|
|
|
|
|
* {1}: root directory of the Boost version {0} installation
|
|
|
|
|
|
|
|
|
|
"@
|
|
|
|
|
|
|
|
|
|
$tmplMarkRoot = @"
|
|
|
|
|
#### {0}
|
|
|
|
|
|
|
|
|
|
* PATH: contains the location of Boost version {0}
|
|
|
|
|
* BOOST_ROOT: root directory of the Boost version {0} installation
|
|
|
|
|
* {1}: root directory of the Boost version {0} installation
|
|
|
|
|
"@
|
|
|
|
|
|
|
|
|
|
$SoftwareName = 'Boost'
|
|
|
|
|
$Description = New-Object System.Text.StringBuilder
|
2020-01-29 10:41:09 +03:00
|
|
|
$BoostRootDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath "Boost"
|
2019-12-13 09:48:00 -05:00
|
|
|
$BoostVersionsToInstall = $env:BOOST_VERSIONS.split(",")
|
|
|
|
|
|
2020-01-29 10:41:09 +03:00
|
|
|
foreach($BoostVersion in $BoostVersionsToInstall)
|
2019-12-13 09:48:00 -05:00
|
|
|
{
|
2020-01-29 10:41:09 +03:00
|
|
|
Validate-BoostVersion -BoostRootPath $BoostRootDirectory -BoostRelease $BoostVersion
|
|
|
|
|
$BoostVersionTag = "BOOST_ROOT_{0}" -f $BoostVersion.Replace('.', '_')
|
2019-12-13 09:48:00 -05:00
|
|
|
|
2020-01-29 10:41:09 +03:00
|
|
|
if($BoostVersion -eq $env:BOOST_DEFAULT)
|
2019-12-13 09:48:00 -05:00
|
|
|
{
|
|
|
|
|
$null = $Description.AppendLine(($tmplMarkRoot -f $BoostVersion, $BoostVersionTag))
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$null = $Description.AppendLine(($tmplMark -f $BoostVersion, $BoostVersionTag))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description.ToString()
|