forked from aspnet/JitBench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAspNet-GenerateStore.ps1
57 lines (44 loc) · 2.07 KB
/
AspNet-GenerateStore.ps1
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
[cmdletbinding()]
param(
[string] $InstallDir = "<auto>",
[string] $AspNetVersion = "2.0.0",
[string] $Framework = "netcoreapp3.0",
[string] $FrameworkVersion = "<auto>",
[string] $Architecture = "x64",
[string] $Runtime = "win7-x64")
Set-StrictMode -Version Latest
$ErrorActionPreference="Stop"
$ProgressPreference="SilentlyContinue"
. "$(Split-Path $MyInvocation.MyCommand.Path -Parent)\AspNet-Shared.ps1"
# Create the installation directory and normalize to a fully qualified path
$InstallDir = New-InstallDirectory -Directory $InstallDir -Default ".store" -Clean -Create
# Blow away .temp - this will be used as a working directory by dotnet store, but it's
# bad at cleaning up after itself.
$temp = New-InstallDirectory -Directory "<auto>" -Default ".temp" -Clean
if ($FrameworkVersion -eq "<auto>")
{
$FrameworkVersion = Get-FrameworkVersion
}
if ($AspNetVersion -eq "<auto>")
{
$AspNetVersion = Get-LatestAspNetVersion -InstallDir "<auto>"
}
# These environment variables are used by CreateStore.proj
$env:JITBENCH_ASPNET_VERSION = $AspNetVersion
$env:JITBENCH_FRAMEWORK_VERSION = $FrameworkVersion
Write-Host -ForegroundColor Green "Running dotnet store"
& "dotnet" "store", "--manifest", ".\CreateStore.proj", "-f", "$Framework", "-r" "$Runtime" "--framework-version", "$FrameworkVersion", "-w", $temp, "-o", "$InstallDir", "--skip-symbols"
if ($LastExitCode -ne 0)
{
throw "dotnet store failed."
}
$BinariesDirectory = $InstallDir
$Manifest = [System.IO.Path]::Combine($InstallDir, $Architecture, $Framework, 'artifact.xml')
Write-Host -ForegroundColor Green "Setting JITBENCH_ASPNET_VERSION to $AspNetVersion"
$env:JITBENCH_ASPNET_VERSION = $AspNetVersion
Write-Host -ForegroundColor Green "Setting JITBENCH_FRAMEWORK_VERSION to $FrameworkVersion"
$env:JITBENCH_FRAMEWORK_VERSION = $FrameworkVersion
Write-Host -ForegroundColor Green "Setting JITBENCH_ASPNET_MANIFEST to $Manifest"
$env:JITBENCH_ASPNET_MANIFEST = $Manifest
Write-Host -ForegroundColor Green "Setting DOTNET_SHARED_STORE to $BinariesDirectory"
$env:DOTNET_SHARED_STORE = $BinariesDirectory