diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2020-05-20 13:37:45 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2020-05-22 15:34:14 (GMT) |
commit | 809f9a99165e1e8463a9af398282c8fa01ff761b (patch) | |
tree | ac3b5e758f0c45f8d0b6afd98b32ae74b02abf5e /.gitlab | |
parent | 02c56b71a1f2f66be0ba79f0b3da66bfa3107ce7 (diff) | |
download | CMake-809f9a99165e1e8463a9af398282c8fa01ff761b.zip CMake-809f9a99165e1e8463a9af398282c8fa01ff761b.tar.gz CMake-809f9a99165e1e8463a9af398282c8fa01ff761b.tar.bz2 |
gitlab: add powershell scripts for utilities
Diffstat (limited to '.gitlab')
-rwxr-xr-x | .gitlab/ci/cmake.ps1 | 18 | ||||
-rwxr-xr-x | .gitlab/ci/ninja.ps1 | 17 | ||||
-rwxr-xr-x | .gitlab/ci/sccache.ps1 | 22 | ||||
-rwxr-xr-x | .gitlab/ci/vcvarsall.ps1 | 9 |
4 files changed, 66 insertions, 0 deletions
diff --git a/.gitlab/ci/cmake.ps1 b/.gitlab/ci/cmake.ps1 new file mode 100755 index 0000000..3b42cae --- /dev/null +++ b/.gitlab/ci/cmake.ps1 @@ -0,0 +1,18 @@ +$erroractionpreference = "stop" + +$version = "3.17.2" +$sha256sum = "CF82B1EB20B6FBE583487656FCD496490FFCCDFBCBBA0F26E19F1C9C63B0B041" +$filename = "cmake-$version-win64-x64" +$tarball = "$filename.zip" + +$outdir = $pwd.Path +$outdir = "$outdir\.gitlab" +Invoke-WebRequest -Uri "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball" +$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256 +if ($hash.Hash -ne $sha256sum) { + exit 1 +} + +Add-Type -AssemblyName System.IO.Compression.FileSystem +[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir") +Move-Item -Path "$outdir\$filename" -Destination "$outdir\cmake" diff --git a/.gitlab/ci/ninja.ps1 b/.gitlab/ci/ninja.ps1 new file mode 100755 index 0000000..91f8b02 --- /dev/null +++ b/.gitlab/ci/ninja.ps1 @@ -0,0 +1,17 @@ +$erroractionpreference = "stop" + +$version = "1.10.0" +$sha256sum = "919FD158C16BF135E8A850BB4046EC1CE28A7439EE08B977CD0B7F6B3463D178" +$filename = "ninja-win" +$tarball = "$filename.zip" + +$outdir = $pwd.Path +$outdir = "$outdir\.gitlab" +Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball" +$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256 +if ($hash.Hash -ne $sha256sum) { + exit 1 +} + +Add-Type -AssemblyName System.IO.Compression.FileSystem +[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir") diff --git a/.gitlab/ci/sccache.ps1 b/.gitlab/ci/sccache.ps1 new file mode 100755 index 0000000..6231c72 --- /dev/null +++ b/.gitlab/ci/sccache.ps1 @@ -0,0 +1,22 @@ +$erroractionpreference = "stop" + +# 0.2.13 is unavailable right now. +# https://github.com/mozilla/sccache/issues/677 +$version = "0.2.12" +$sha256sum = "FD05E91C59B9497D4EBAE311B47A982F2A6EB942DCA3C9C314CC1FB36F8BC64D" +$filename = "sccache-$version-x86_64-pc-windows-msvc" +$tarball = "$filename.tar.gz" + +$outdir = $pwd.Path +$outdir = "$outdir\.gitlab" +Invoke-WebRequest -Uri "https://github.com/mozilla/sccache/releases/download/$version/$tarball" -OutFile "$outdir\$tarball" +$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256 +if ($hash.Hash -ne $sha256sum) { + exit 1 +} + +$curdir = $pwd.Path +Set-Location -Path "$outdir" +cmake -E tar xzf "$outdir\$tarball" +Move-Item -Path "$outdir\$filename\sccache.exe" -Destination "$outdir\sccache.exe" +Set-Location -Path "$curdir" diff --git a/.gitlab/ci/vcvarsall.ps1 b/.gitlab/ci/vcvarsall.ps1 new file mode 100755 index 0000000..a48b511 --- /dev/null +++ b/.gitlab/ci/vcvarsall.ps1 @@ -0,0 +1,9 @@ +$erroractionpreference = "stop" + +cmd /c "`"$env:VCVARSALL`" $VCVARSPLATFORM & set" | +foreach { + if ($_ -match "=") { + $v = $_.split("=") + [Environment]::SetEnvironmentVariable($v[0], $v[1]) + } +} |