|
1 | 1 | . $PSScriptRoot/../end-to-end-tests-prelude.ps1
|
2 | 2 |
|
| 3 | +$VcpkgToolsJsonSchemaFile = (Get-Item "$PSScriptRoot/../../docs/vcpkg-tools.schema.json").FullName |
| 4 | +if (-not (Test-Json -ea:0 -LiteralPath "$VcpkgRoot/scripts/vcpkg-tools.json" -SchemaFile $VcpkgToolsJsonSchemaFile)) { |
| 5 | + throw "real vcpkg-tools.json doesn't conform to schema" |
| 6 | +} |
| 7 | + |
3 | 8 | if (-not $IsMacOS -and -not $IsLinux) {
|
4 | 9 | "" | Out-File -enc ascii $(Join-Path $TestingRoot .vcpkg-root)
|
5 | 10 |
|
6 | 11 | $Scripts = Join-Path $TestingRoot "scripts"
|
7 | 12 | mkdir $Scripts | Out-Null
|
| 13 | + |
| 14 | + $VcpkgToolsJson = Join-Path $Scripts "vcpkg-tools.json" |
| 15 | + |
| 16 | + $7zip_version = "19.00" |
| 17 | + $ninja_version = "1.10.2" |
8 | 18 |
|
9 |
| -@" |
10 |
| -<?xml version="1.0"?> |
11 |
| -<tools version="2"> |
12 |
| - <tool name="7zip" os="windows"> |
13 |
| - <version>19.00</version> |
14 |
| - <exeRelativePath>Files\7-Zip\7z.exe</exeRelativePath> |
15 |
| - <url>https://www.7-zip.org/a/7z1900-x64.msi</url> |
16 |
| - <sha512>7837a8677a01eed9c3309923f7084bc864063ba214ee169882c5b04a7a8b198ed052c15e981860d9d7952c98f459a4fab87a72fd78e7d0303004dcb86f4324c8</sha512> |
17 |
| - <archiveName>7z1900-x64.msi</archiveName> |
18 |
| - </tool> |
19 |
| - <tool name="ninja-testing" os="windows"> |
20 |
| - <version>1.10.2</version> |
21 |
| - <exeRelativePath>ninja.exe</exeRelativePath> |
22 |
| - <url>https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip</url> |
23 |
| - <sha512>6004140d92e86afbb17b49c49037ccd0786ce238f340f7d0e62b4b0c29ed0d6ad0bab11feda2094ae849c387d70d63504393714ed0a1f4d3a1f155af7a4f1ba3</sha512> |
24 |
| - <archiveName>ninja-win-1.10.2.zip</archiveName> |
25 |
| - </tool> |
26 |
| - <tool name="ninja" os="windows"> |
27 |
| - <version>1.10.2</version> |
28 |
| - <exeRelativePath>ninja.exe</exeRelativePath> |
29 |
| - <url>https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip</url> |
30 |
| - <sha512>6004140d92e86afbb17b49c49037ccd0786ce238f340f7d0e62b4b0c29ed0d6ad0bab11feda2094ae849c387d70d63504393714ed0a1f4d3a1f155af7a4f1ba3</sha512> |
31 |
| - <archiveName>ninja-win-1.10.2.zip</archiveName> |
32 |
| - </tool> |
33 |
| - <tool name="cmake" os="windows"> |
34 |
| - <version>3.22.2</version> |
35 |
| - <exeRelativePath>cmake-3.22.2-windows-i386\bin\cmake.exe</exeRelativePath> |
36 |
| - <url>https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-windows-i386.zip</url> |
37 |
| - <sha512>969d3d58d56d8fa3cc3acae2b949bf58abab945f70ae292ff20c9060d845dfc094c613c367a924abff47f307cc33af1467cdb9b75bb857868e38b2c7cdc72f79</sha512> |
38 |
| - <archiveName>cmake-3.22.2-windows-i386.zip</archiveName> |
39 |
| - </tool> |
40 |
| - <tool name="cmake" os="osx"> |
41 |
| - <version>3.22.2</version> |
42 |
| - <exeRelativePath>cmake-3.22.2-macos-universal/CMake.app/Contents/bin/cmake</exeRelativePath> |
43 |
| - <url>https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-macos-universal.tar.gz</url> |
44 |
| - <sha512>08104f608ecb9a5cfef38e79f0957d21e425616c0677781445492f82cbfec805113e3b5eb4bc737b707bb26a00678e7bd55e17555a5611c08b0b9b44ac5136ac</sha512> |
45 |
| - <archiveName>cmake-3.22.2-macos-universal.tar.gz</archiveName> |
46 |
| - </tool> |
47 |
| - <tool name="cmake" os="linux"> |
48 |
| - <version>3.22.2</version> |
49 |
| - <exeRelativePath>cmake-3.22.2-linux-x86_64/bin/cmake</exeRelativePath> |
50 |
| - <url>https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-linux-x86_64.tar.gz</url> |
51 |
| - <sha512>579e08b086f6903ef063697fca1dc2692f68a7341dd35998990b772b4221cdb5b1deecfa73bad9d46817ef09e58882b2adff9d64f959c01002c11448a878746b</sha512> |
52 |
| - <archiveName>cmake-3.22.2linux-x86_64.tar.gz</archiveName> |
53 |
| - </tool> |
54 |
| - <tool name="cmake" os="freebsd"> |
55 |
| - <version>3.20.4</version> |
56 |
| - <exeRelativePath>usr/local/bin/cmake</exeRelativePath> |
57 |
| - <url>https://pkg.freebsd.org/FreeBSD:13:amd64/quarterly/All/cmake-3.20.4.txz</url> |
58 |
| - <sha512>3e5b675d7ff924f92996d912e2365582e687375109ef99c9073fb8196bb329243a406b218cf1358d7cc518988b311ce9e5bf87de4d64f2e6377b7c2bc8894475</sha512> |
59 |
| - <archiveName>cmake-3.20.4.txz</archiveName> |
60 |
| - </tool> |
61 |
| -</tools> |
62 |
| -"@ | % { $_ -replace "`r","" } | Out-File -enc ascii $(Join-Path $Scripts "vcpkgTools.xml") |
| 19 | + @' |
| 20 | +{ |
| 21 | + "schema-version": 1, |
| 22 | + "tools": [{ |
| 23 | + "name": "7zip", |
| 24 | + "os": "windows", |
| 25 | + "version": "19.00", |
| 26 | + "executable": "Files\\7-Zip\\7z.exe", |
| 27 | + "url": "https://www.7-zip.org/a/7z1900-x64.msi", |
| 28 | + "sha512": "7837a8677a01eed9c3309923f7084bc864063ba214ee169882c5b04a7a8b198ed052c15e981860d9d7952c98f459a4fab87a72fd78e7d0303004dcb86f4324c8", |
| 29 | + "archive": "7z1900-x64.msi" |
| 30 | + }, |
| 31 | + { |
| 32 | + "name": "ninja-testing", |
| 33 | + "os": "windows", |
| 34 | + "version": "1.10.2", |
| 35 | + "executable": "ninja.exe", |
| 36 | + "url": "https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip", |
| 37 | + "sha512": "6004140d92e86afbb17b49c49037ccd0786ce238f340f7d0e62b4b0c29ed0d6ad0bab11feda2094ae849c387d70d63504393714ed0a1f4d3a1f155af7a4f1ba3", |
| 38 | + "archive": "ninja-win-1.10.2.zip" |
| 39 | + }, |
| 40 | + { |
| 41 | + "name": "ninja", |
| 42 | + "os": "windows", |
| 43 | + "version": "1.10.2", |
| 44 | + "executable": "ninja.exe", |
| 45 | + "url": "https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip", |
| 46 | + "sha512": "6004140d92e86afbb17b49c49037ccd0786ce238f340f7d0e62b4b0c29ed0d6ad0bab11feda2094ae849c387d70d63504393714ed0a1f4d3a1f155af7a4f1ba3", |
| 47 | + "archive": "ninja-win-1.10.2.zip" |
| 48 | + }, |
| 49 | + { |
| 50 | + "name": "cmake", |
| 51 | + "os": "windows", |
| 52 | + "version": "3.22.2", |
| 53 | + "executable": "cmake-3.22.2-windows-i386\\bin\\cmake.exe", |
| 54 | + "url": "https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-windows-i386.zip", |
| 55 | + "sha512": "969d3d58d56d8fa3cc3acae2b949bf58abab945f70ae292ff20c9060d845dfc094c613c367a924abff47f307cc33af1467cdb9b75bb857868e38b2c7cdc72f79", |
| 56 | + "archive": "cmake-3.22.2-windows-i386.zip" |
| 57 | + }, |
| 58 | + { |
| 59 | + "name": "cmake", |
| 60 | + "os": "osx", |
| 61 | + "version": "3.22.2", |
| 62 | + "executable": "cmake-3.22.2-macos-universal/CMake.app/Contents/bin/cmake", |
| 63 | + "url": "https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-macos-universal.tar.gz", |
| 64 | + "sha512": "08104f608ecb9a5cfef38e79f0957d21e425616c0677781445492f82cbfec805113e3b5eb4bc737b707bb26a00678e7bd55e17555a5611c08b0b9b44ac5136ac", |
| 65 | + "archive": "cmake-3.22.2-macos-universal.tar.gz" |
| 66 | + }, |
| 67 | + { |
| 68 | + "name": "cmake", |
| 69 | + "os": "linux", |
| 70 | + "version": "3.22.2", |
| 71 | + "executable": "cmake-3.22.2-linux-x86_64/bin/cmake", |
| 72 | + "url": "https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-linux-x86_64.tar.gz", |
| 73 | + "sha512": "579e08b086f6903ef063697fca1dc2692f68a7341dd35998990b772b4221cdb5b1deecfa73bad9d46817ef09e58882b2adff9d64f959c01002c11448a878746b", |
| 74 | + "archive": "cmake-3.22.2linux-x86_64.tar.gz" |
| 75 | + }, |
| 76 | + { |
| 77 | + "name": "cmake", |
| 78 | + "os": "freebsd", |
| 79 | + "version": "3.20.4", |
| 80 | + "executable": "/usr/local/bin/cmake", |
| 81 | + "url": "https://pkg.freebsd.org/FreeBSD:13:amd64/quarterly/All/cmake-3.20.4.txz", |
| 82 | + "sha512": "3e5b675d7ff924f92996d912e2365582e687375109ef99c9073fb8196bb329243a406b218cf1358d7cc518988b311ce9e5bf87de4d64f2e6377b7c2bc8894475", |
| 83 | + "archive": "cmake-3.20.4.txz" |
| 84 | + }] |
| 85 | +} |
| 86 | +'@ | % { $_ -replace "`r","" } | Out-File -enc ascii $VcpkgToolsJson |
| 87 | + |
| 88 | + if (-not (Test-Json -ea:0 -LiteralPath $VcpkgToolsJson -SchemaFile $VcpkgToolsJsonSchemaFile)) { |
| 89 | + throw "testing vcpkg-tools.json doesn't conform to schema" |
| 90 | + } |
63 | 91 |
|
64 | 92 | $env:VCPKG_DOWNLOADS = Join-Path $TestingRoot 'down loads'
|
65 | 93 | Run-Vcpkg -TestArgs ($commonArgs + @("fetch", "7zip", "--vcpkg-root=$TestingRoot"))
|
66 | 94 | Throw-IfFailed
|
67 |
| - Require-FileExists "$TestingRoot/down loads/tools/7zip-19.00-windows/Files/7-Zip/7z.exe" |
| 95 | + Require-FileExists "$env:VCPKG_DOWNLOADS/tools/7zip-19.00-windows/Files/7-Zip/7z.exe" |
68 | 96 |
|
69 | 97 | Run-Vcpkg -TestArgs ($commonArgs + @("fetch", "ninja-testing", "--vcpkg-root=$TestingRoot"))
|
70 | 98 | Throw-IfFailed
|
71 |
| - Require-FileExists "$TestingRoot/down loads/tools/ninja-testing-1.10.2-windows/ninja.exe" |
| 99 | + Require-FileExists "$env:VCPKG_DOWNLOADS/tools/ninja-testing-1.10.2-windows/ninja.exe" |
72 | 100 |
|
73 | 101 | $path = $env:PATH
|
74 | 102 |
|
75 |
| - $env:PATH = "$path;$TestingRoot/down loads/tools/ninja-testing-1.10.2-windows" |
| 103 | + $env:PATH = "$path;$env:VCPKG_DOWNLOADS/tools/ninja-testing-1.10.2-windows" |
76 | 104 | Run-Vcpkg -TestArgs ($commonArgs + @("fetch", "ninja", "--vcpkg-root=$TestingRoot"))
|
77 | 105 | Throw-IfFailed
|
78 |
| - Require-FileNotExists "$TestingRoot/down loads/tools/ninja-1.10.2-windows/ninja.exe" |
| 106 | + Require-FileNotExists "$env:VCPKG_DOWNLOADS/tools/ninja-1.10.2-windows/ninja.exe" |
79 | 107 |
|
80 | 108 | $env:VCPKG_FORCE_DOWNLOADED_BINARIES = "1"
|
81 | 109 | Run-Vcpkg -TestArgs ($commonArgs + @("fetch", "ninja", "--vcpkg-root=$TestingRoot"))
|
82 | 110 | Throw-IfFailed
|
83 |
| - Require-FileExists "$TestingRoot/down loads/tools/ninja-1.10.2-windows/ninja.exe" |
| 111 | + Require-FileExists "$env:VCPKG_DOWNLOADS/tools/ninja-1.10.2-windows/ninja.exe" |
84 | 112 |
|
85 |
| - Remove-Item -Recurse -Force "$TestingRoot/down loads/tools/ninja-1.10.2-windows" -ErrorAction SilentlyContinue |
| 113 | + Remove-Item -Recurse -Force "$env:VCPKG_DOWNLOADS/tools/ninja-1.10.2-windows" -ErrorAction SilentlyContinue |
86 | 114 | Remove-Item env:VCPKG_FORCE_DOWNLOADED_BINARIES
|
87 | 115 |
|
88 | 116 | $env:VCPKG_FORCE_SYSTEM_BINARIES = "1"
|
89 | 117 | $env:PATH = "$PSScriptRoot\..\e2e-assets\fetch;$path"
|
90 | 118 | Run-Vcpkg -TestArgs ($commonArgs + @("fetch", "ninja", "--vcpkg-root=$TestingRoot"))
|
91 | 119 | Throw-IfFailed
|
92 |
| - Require-FileNotExists "$TestingRoot/down loads/tools/ninja-1.10.2-windows/ninja.exe" |
| 120 | + Require-FileNotExists "$env:VCPKG_DOWNLOADS/tools/ninja-1.10.2-windows/ninja.exe" |
93 | 121 |
|
94 | 122 | Remove-Item env:VCPKG_FORCE_SYSTEM_BINARIES
|
95 | 123 | $out = Run-VcpkgAndCaptureOutput -TestArgs ($commonArgs + @("fetch", "ninja", "--vcpkg-root=$TestingRoot", "--x-stderr-status"))
|
|
0 commit comments