diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-02-23 16:34:31 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-02-23 18:19:04 -0800 |
| commit | 407767858336479eebe759404db689a9b1e16671 (patch) | |
| tree | 7f3014c271062212caa4d3e4c8aa3ca11b96f9fc /scripts/fetchDependency.ps1 | |
| parent | f0cee21f7a11c9c2073616e199b412d6fb2a364d (diff) | |
| download | vcpkg-407767858336479eebe759404db689a9b1e16671.tar.gz vcpkg-407767858336479eebe759404db689a9b1e16671.zip | |
Rename "depenencies" to tools. Rework xml file to reduce fields.
Diffstat (limited to 'scripts/fetchDependency.ps1')
| -rw-r--r-- | scripts/fetchDependency.ps1 | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 deleted file mode 100644 index 5f7902881..000000000 --- a/scripts/fetchDependency.ps1 +++ /dev/null @@ -1,76 +0,0 @@ -[CmdletBinding()] -param( - [Parameter(Mandatory=$true)][string]$dependency -) - -$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" - -Write-Verbose "Fetching dependency: $dependency" -$vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root - -$downloadsDir = "$vcpkgRootDir\downloads" - -function fetchDependencyInternal([Parameter(Mandatory=$true)][string]$dependency) -{ - $dependency = $dependency.toLower() - - [xml]$asXml = Get-Content "$scriptsDir\vcpkgDependencies.xml" - $dependencyData = $asXml.SelectSingleNode("//dependencies/dependency[@name=`"$dependency`"]") # Case-sensitive! - - if ($dependencyData -eq $null) - { - throw "Unkown dependency $dependency" - } - - $requiredVersion = $dependencyData.requiredVersion - $downloadVersion = $dependencyData.downloadVersion - $url = $dependencyData.x86url - $downloadRelativePath = $dependencyData.downloadRelativePath - $downloadPath = "$downloadsDir\$downloadRelativePath" - $expectedDownloadedFileHash = $dependencyData.sha256 - $extension = $dependencyData.extension - - if (!(Test-Path $downloadPath)) - { - Write-Host "Downloading $dependency..." - vcpkgDownloadFile $url $downloadPath - Write-Host "Downloading $dependency has completed successfully." - } - - $downloadedFileHash = vcpkgGetSHA256 $downloadPath - vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash - - - if ($extension -eq "exe") - { - $executableFromDownload = $downloadPath - } - elseif ($extension -eq "zip") - { - $postExtractionExecutableRelativePath = $dependencyData.postExtractionExecutableRelativePath - $executableFromDownload = "$downloadsDir\$postExtractionExecutableRelativePath" - if (-not (Test-Path $executableFromDownload)) - { - $outFilename = (Get-ChildItem $downloadPath).BaseName - Write-Host "Extracting $dependency..." - vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename - Write-Host "Extracting $dependency has completed successfully." - } - } - else - { - throw "Unexpected file type" - } - - if (-not (Test-Path $executableFromDownload)) - { - throw ("Could not detect or download " + $dependency) - } - - return $executableFromDownload -} - -$path = fetchDependencyInternal $dependency -Write-Verbose "Fetching dependency: $dependency. Done." -return "<sol>::$path::<eol>" |
