skiasharp/scripts/get-build-type.ps1
Matthew Leibowitz 79162b3cc3
Add support for WinUI accelerated views (#2733)
Adds the GPU views for WinUI, but there are a few othe things it need
to do:
- Builds ANGLE as this is the primary interop between SkiaSharp and
  DirectX
- Builds an interop library that extends types needed for interacting
  with ANGLE
- Enables AngleSwapChainPanel as this is the WinUI view that sets up
  the GL context
- Enables the SKSwapChainPanel as this is the SkiaSharp accelerated
  view
- Add a new NativeAssets package for WinUI native files
2024-02-03 18:25:18 +08:00

56 lines
1.6 KiB
PowerShell

param (
[string] $ExternalsBuildId = ''
)
$ErrorActionPreference = 'Stop'
# some stage earlier requested a full build
if ($env:DOWNLOAD_EXTERNALS -eq 'required') {
Write-Host "Full build explicitly requested."
Write-Host "##vso[task.setvariable variable=DOWNLOAD_EXTERNALS]"
exit 0
}
# this was explicit, so just us that
$intBuildId = "$ExternalsBuildId" -as [int]
if ($intBuildId -gt 0) {
Write-Host "Explicit managed-only build using $intBuildId."
Write-Host "##vso[task.setvariable variable=DOWNLOAD_EXTERNALS]$intBuildId"
exit 0
}
# if this is a PR and we are requesting last-build artifacts
if (("$ExternalsBuildId" -eq 'latest') -and ("$env:BUILD_REASON" -eq 'PullRequest')) {
Write-Host "All changes:"
$all = (git diff-tree --no-commit-id --name-only -r HEAD~ HEAD)
if ($?) {
foreach ($d in $all) {
Write-Host " - $d"
}
Write-Host "Matching changes:"
$matching = @(
'externals',
'native',
'scripts',
'.gitmodules'
)
$requiresFull = (git diff-tree --no-commit-id --name-only -r HEAD~ HEAD @matching)
if ($?) {
foreach ($d in $requiresFull) {
Write-Host " - $d"
}
if (-not $requiresFull) {
Write-Host "Download-only build."
Write-Host "##vso[task.setvariable variable=DOWNLOAD_EXTERNALS]latest"
exit 0
}
}
}
}
# either not a PR, native files changed or explicit build-all
Write-Host "Full build."
Write-Host "##vso[task.setvariable variable=DOWNLOAD_EXTERNALS]"
exit 0