Implement builders to build Boost from source code

This commit is contained in:
Maxim Lobanov
2020-05-27 09:24:57 +03:00
parent 886c1d6104
commit 610555ac3d
36 changed files with 2005 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
set -e
BOOST_VERSION="{{__VERSION__}}"
ARCHITECTURE="{{__ARCHITECTURE__}}"
if [ -z ${AGENT_TOOLSDIRECTORY+x} ]; then
# No AGENT_TOOLSDIRECTORY on GitHub images
TOOLCACHE_ROOT=$RUNNER_TOOL_CACHE
else
TOOLCACHE_ROOT=$AGENT_TOOLSDIRECTORY
fi
BOOST_TOOLCACHE_PATH=$TOOLCACHE_ROOT/boost
BOOST_TOOLCACHE_VERSION_PATH=$BOOST_TOOLCACHE_PATH/$BOOST_VERSION
BOOST_TOOLCACHE_VERSION_ARCH_PATH=$BOOST_TOOLCACHE_VERSION_PATH/$ARCHITECTURE
echo "Check if Boost hostedtoolcache folder exist..."
if [ ! -d $BOOST_TOOLCACHE_PATH ]; then
mkdir -p $BOOST_TOOLCACHE_PATH
fi
echo "Delete Boost $BOOST_VERSION [$ARCHITECTURE] if installed"
rm -rf $BOOST_TOOLCACHE_VERSION_ARCH_PATH
echo "Create Boost $BOOST_VERSION [$ARCHITECTURE] folder"
mkdir -p $BOOST_TOOLCACHE_VERSION_ARCH_PATH
echo "Copy Boost binaries to hostedtoolcache folder"
cp -R ./* $BOOST_TOOLCACHE_VERSION_ARCH_PATH
rm $BOOST_TOOLCACHE_VERSION_ARCH_PATH/setup.sh
echo "Create complete file"
touch $BOOST_TOOLCACHE_VERSION_PATH/$ARCHITECTURE.complete

View File

@@ -0,0 +1,33 @@
$ErrorActionPreference = "Stop"
[Version]$Version = "{{__VERSION__}}"
[string]$Architecture = "{{__ARCHITECTURE__}}"
$ToolcacheRoot = $env:AGENT_TOOLSDIRECTORY
if ([string]::IsNullOrEmpty($ToolcacheRoot)) {
# GitHub images don't have `AGENT_TOOLSDIRECTORY` variable
$ToolcacheRoot = $env:RUNNER_TOOL_CACHE
}
$BoostToolcachePath = Join-Path -Path $ToolcacheRoot -ChildPath "boost"
$BoostToolcacheVersionPath = Join-Path -Path $BoostToolcachePath -ChildPath $Version.ToString()
$BoostToolcacheArchitecturePath = Join-Path $BoostToolcacheVersionPath $Architecture
Write-Host "Check if Boost hostedtoolcache folder exist..."
if (-not (Test-Path $BoostToolcachePath)) {
New-Item -ItemType Directory -Path $BoostToolcachePath | Out-Null
}
if (Test-Path $BoostToolcacheArchitecturePath) {
Write-Host "Delete existing Boost $Version [$Architecture]"
Remove-Item $BoostToolcacheArchitecturePath -Recurse -Force | Out-Null
}
Write-Host "Create Boost $Version [$Architecture] folder"
New-Item -ItemType Directory -Path $BoostToolcacheArchitecturePath | Out-Null
Write-Host "Copy Boost binaries to hostedtoolcache folder"
Copy-Item -Path * -Destination $BoostToolcacheArchitecturePath -Recurse
Remove-Item $BoostToolcacheArchitecturePath\setup.ps1 -Force | Out-Null
Write-Host "Create complete file"
New-Item -ItemType File -Path $BoostToolcacheVersionPath -Name "$Architecture.complete" | Out-Null