-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathvcpkg.yml
59 lines (54 loc) · 1.9 KB
/
vcpkg.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
parameters:
# Use the variable name itself (no $() or other wrapping syntax). This is
# because we use runtime and macro expressions for conditions and script
# invocations
DependenciesVariableName: vcpkg.deps
steps:
- pwsh: |
$TargetPath = "$(Agent.TempDirectory)/vcpkg"
Remove-Item -Path $TargetPath -Recurse -Force -ErrorAction Ignore
New-Item -ItemType Directory -Path $TargetPath -Force
$VcpkgCommit = $(Get-Content eng/vcpkg-commit.txt)
Write-Host "Target Path for vcpkg: $TargetPath"
Write-Host "Vcpkg SHA: $VcpkgCommit"
Write-Host "##vso[task.prependpath]$TargetPath"
Write-Host "##vso[task.setvariable variable=VCPKG_INSTALLATION_ROOT]$TargetPath"
Write-Host "##vso[task.setvariable variable=VcpkgCommit]$VcpkgCommit"
displayName: Set Vcpkg Variables
condition: >-
and(
succeeded(),
not(eq(variables['${{ parameters.DependenciesVariableName }}'], ''))
)
- task: Cache@2
inputs:
key: >-
$(Agent.JobName)
| "$(VcpkgCommit)"
| $(Agent.Os)
| $(${{ parameters.DependenciesVariableName }})
| $(VCPKG_DEFAULT_TRIPLET)
path: $(VCPKG_INSTALLATION_ROOT)
cacheHitVar: VcpkgRestoredFromCache
displayName: Vcpkg Cache
condition: >-
and(
succeeded(),
not(eq(variables['${{ parameters.DependenciesVariableName }}'], '')),
not(eq(variables['Skip.VcpkgCache'], 'true'))
)
- task: PowerShell@2
inputs:
targetType: filePath
filePath: eng/scripts/vcpkg.ps1
arguments: >-
-Ref $(VcpkgCommit)
-Dependencies "$(${{ parameters.DependenciesVariableName }})"
-VcpkgPath $(VCPKG_INSTALLATION_ROOT)
pwsh: true
condition: >-
and(
succeeded(),
not(eq(variables['${{ parameters.DependenciesVariableName }}'], '')),
ne(variables['VcpkgRestoredFromCache'], true)
)