From b374e2fd06505bf69839f15d6f4e556dafd3ed1b Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Fri, 17 Jun 2016 11:23:29 -0700 Subject: [PATCH] Add Start-TypeGen Update Microsoft.PowerShell.CoreCLR.AssemblyLoadContext\project.json Include Crypto package for new source code --- build.psm1 | 41 +++++++++++++++++++ .../project.json | 4 +- src/TypeCatalogGen/.gitignore | 1 - 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/build.psm1 b/build.psm1 index 2a109da28e..d3518f260e 100644 --- a/build.psm1 +++ b/build.psm1 @@ -27,6 +27,7 @@ function Start-PSBuild { [switch]$Restore, [string]$Output, [switch]$ResGen, + [switch]$TypeGen, [Parameter(ParameterSetName='CoreCLR')] [switch]$Publish, @@ -194,6 +195,13 @@ function Start-PSBuild { } } + # handle TypeGen + if ($TypeGen -or -not (Test-Path "$PSScriptRoot/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CorePsTypeCatalog.cs")) + { + log "Run TypeGen (generating CorePsTypeCatalog.cs)" + Start-TypeGen + } + try { # Relative paths do not work well if cwd is not changed to project Push-Location $Options.Top @@ -867,6 +875,39 @@ function Send-GitDiffToSd { } } +function Start-TypeGen +{ + [CmdletBinding()] + param() + + if (!$IsWindows) + { + throw "Start-TypeGen is not supported on non-windows. Use src/TypeCatalogGen/build.sh instead" + } + + Push-Location "$PSScriptRoot/src/TypeCatalogParser" + try + { + dotnet restore -v Warning + dotnet run + } + finally + { + Pop-Location + } + + Push-Location "$PSScriptRoot/src/TypeCatalogGen" + try + { + dotnet restore -v Warning + dotnet run ../Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CorePsTypeCatalog.cs powershell.inc + } + finally + { + Pop-Location + } +} + function Start-ResGen { [CmdletBinding()] diff --git a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json index beeeba76f8..b7ddc7ab42 100644 --- a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json +++ b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json @@ -26,7 +26,9 @@ }, "dependencies": { "NETStandard.Library": "1.5.0-rc2-24027", - "System.Runtime.Loader": "4.0.0-rc2-24027" + "System.Runtime.Loader": "4.0.0-rc2-24027", + "System.Reflection.Metadata": "1.1.0", + "System.Security.Cryptography.Algorithms": "4.1.0-rc2-24027" } } } diff --git a/src/TypeCatalogGen/.gitignore b/src/TypeCatalogGen/.gitignore index 172ca8f17f..d745414448 100644 --- a/src/TypeCatalogGen/.gitignore +++ b/src/TypeCatalogGen/.gitignore @@ -1,2 +1 @@ powershell.inc -CorePsTypeCatalog.cs