Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 9 additions & 53 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ function Start-BuildNativeUnixBinaries {
}
elseif ($IsMacOS) {
Start-NativeExecution { cmake -DCMAKE_TOOLCHAIN_FILE="./macos.toolchain.cmake" . }
Start-NativeExecution { make -j }
Start-NativeExecution { make -j }
Start-NativeExecution { ctest --verbose }
}
else {
Expand Down Expand Up @@ -2153,63 +2153,19 @@ function Start-PSBootstrap {
$cmakePresent = precheck 'cmake' $null
$sdkPresent = Test-Win10SDK

# Install chocolatey
$chocolateyPath = "$env:AllUsersProfile\chocolatey\bin"

if(precheck 'choco' $null) {
Write-Log "Chocolatey is already installed. Skipping installation."
}
elseif(($cmakePresent -eq $false) -or ($sdkPresent -eq $false)) {
Write-Log "Chocolatey not present. Installing chocolatey."
if ($Force -or "Install chocolatey via https://chocolatey.org/install.ps1") {
Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
if (-not ($machinePath.ToLower().Contains($chocolateyPath.ToLower()))) {
Write-Log "Adding $chocolateyPath to Path environment variable"
$env:Path += ";$chocolateyPath"
$newMachineEnvironmentPath += ";$chocolateyPath"
} else {
Write-Log "$chocolateyPath already present in Path environment variable"
}
} else {
Write-Error "Chocolatey is required to install missing dependencies. Please install it from https://chocolatey.org/ manually. Alternatively, install cmake and Windows 10 SDK."
return
}
} else {
Write-Log "Skipping installation of chocolatey, cause both cmake and Win 10 SDK are present."
}

# Install cmake
$cmakePath = "${env:ProgramFiles}\CMake\bin"
if($cmakePresent -and !($force.IsPresent)) {
Write-Log "Cmake is already installed. Skipping installation."
#$cmakePath = "${env:ProgramFiles}\CMake\bin"
if($cmakePresent) {
Write-Log "Cmake is already installed."
} else {
Write-Log "Cmake not present or -Force used. Installing cmake."
Start-NativeExecution { choco install cmake -y --version 3.10.0 }
if (-not ($machinePath.ToLower().Contains($cmakePath.ToLower()))) {
Write-Log "Adding $cmakePath to Path environment variable"
$env:Path += ";$cmakePath"
$newMachineEnvironmentPath = "$cmakePath;$newMachineEnvironmentPath"
} else {
Write-Log "$cmakePath already present in Path environment variable"
}
throw "Cmake not present."
}

# Install Windows 10 SDK
$packageName = "windows-sdk-10.0"

if (-not $sdkPresent) {
Write-Log "Windows 10 SDK not present. Installing $packageName."
Start-NativeExecution { choco install windows-sdk-10.0 -y }
} else {
Write-Log "Windows 10 SDK present. Skipping installation."
if ($sdkPresent) {
Write-Log "Windows 10 SDK is already installed."
}

# Update path machine environment variable
if ($newMachineEnvironmentPath -ne $machinePath) {
Write-Log "Updating Path machine environment variable"
if ($Force -or $PSCmdlet.ShouldProcess("Update Path machine environment variable to $newMachineEnvironmentPath")) {
[Environment]::SetEnvironmentVariable('Path', $newMachineEnvironmentPath, 'MACHINE')
}
else {
throw "Windows 10 SDK not present."
}
}
}
Expand Down
14 changes: 9 additions & 5 deletions tools/releaseBuild/yaml/releaseBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ stages:
jobs:
- job: BuildWin
pool:
vmImage: vs2017-win2016
name: PowerShell1ES
demands:
- ImageOverride -equals PSMMS2019-PS-Native-Secure
displayName: Windows
strategy:
matrix:
Expand All @@ -42,7 +44,7 @@ stages:
pool:
name: PowerShell1ES
demands:
- ImageOverride -equals MMS2019
- ImageOverride -equals PSMMS2019-PS-Native-Secure

displayName: Sign Windows
variables:
Expand All @@ -64,7 +66,9 @@ stages:
- job: BuildLinux
displayName: Linux
pool:
vmImage: ubuntu-latest
name: PowerShell1ES
demands:
- ImageOverride -equals PSMMSUbuntu20.04-Secure
strategy:
matrix:
UbuntuArm:
Expand Down Expand Up @@ -94,7 +98,7 @@ stages:
pool:
name: PowerShell1ES
demands:
- ImageOverride -equals MMS2019
- ImageOverride -equals PSMMS2019-PS-Native-Secure
variables:
- group: ESRP

Expand All @@ -109,7 +113,7 @@ stages:
pool:
name: PowerShell1ES
demands:
- ImageOverride -equals MMS2019
- ImageOverride -equals PSMMS2019-PS-Native-Secure
steps:
- checkout: self
clean: true
Expand Down
2 changes: 1 addition & 1 deletion tools/releaseBuild/yaml/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ parameters:
sourcePath: ''

steps:
- task: AzureFileCopy@2
- task: AzureFileCopy@4
displayName: 'Upload ${{ parameters.fileName }} to azure blob'
inputs:
SourcePath: '${{ parameters.sourcePath }}'
Expand Down
4 changes: 0 additions & 4 deletions tools/releaseBuild/yaml/windows-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
steps:
- powershell: |
choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System'
displayName: Install cmake
condition: succeeded()
- powershell: |
$vsPath = ${Env:ProgramFiles(x86)} + '\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin'
Write-Host "##vso[task.prependpath]$vsPath"
Expand Down