Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElinor Fung <elfung@microsoft.com>2022-03-08 20:14:43 +0300
committerGitHub <noreply@github.com>2022-03-08 20:14:43 +0300
commit627851323fe8f15539c163aabd7d7c644766c549 (patch)
tree3c78a019d87eee41fcfdc0d78042955da7676408 /eng/native/ijw/getRefPackFolderFromSdk.ps1
parentfa5dcda23c681031b5d2bd68482702baef80b836 (diff)
Add tests for `ijwhost` (#66308)
Diffstat (limited to 'eng/native/ijw/getRefPackFolderFromSdk.ps1')
-rw-r--r--eng/native/ijw/getRefPackFolderFromSdk.ps127
1 files changed, 27 insertions, 0 deletions
diff --git a/eng/native/ijw/getRefPackFolderFromSdk.ps1 b/eng/native/ijw/getRefPackFolderFromSdk.ps1
new file mode 100644
index 00000000000..1b59248cb42
--- /dev/null
+++ b/eng/native/ijw/getRefPackFolderFromSdk.ps1
@@ -0,0 +1,27 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+
+$engNativeFolder = Split-Path $PSScriptRoot -Parent
+$engFolder = Split-Path $engNativeFolder -Parent
+$repoRoot = Split-Path $engFolder -Parent
+
+. "$repoRoot/eng/common/tools.ps1"
+
+$dotnetRoot = InitializeDotNetCli $true $false
+
+$dotnetSdkVersion = $GlobalJson.tools.dotnet
+
+$sdkBundledVersionsFile = "$dotnetRoot/sdk/$dotnetSdkVersion/Microsoft.NETCoreSdk.BundledVersions.props"
+
+$refPackVersion = Select-Xml -Path $sdkBundledVersionsFile -XPath "/Project/PropertyGroup/BundledNETCoreAppPackageVersion" | %{$_.Node.InnerText}
+$refPackTfmVersion = Select-Xml -Path $sdkBundledVersionsFile -XPath "/Project/PropertyGroup/BundledNETCoreAppTargetFrameworkVersion" | %{$_.Node.InnerText}
+
+$refPackPath = "$dotnetRoot/packs/Microsoft.NETCore.App.Ref/$refPackVersion/ref/net$refPackTfmVersion"
+
+if (-not (Test-Path $refPackPath))
+{
+ Write-Error "Reference assemblies not found in the SDK folder. Did the SDK layout change? Did the SDK change how it describes the bundled runtime version?"
+ exit 1
+}
+
+Write-Output "refPackPath=$refPackPath"