From 7ca0125d86ecec8bdde2ce107a8b1559b1d65819 Mon Sep 17 00:00:00 2001 From: iSazonov Date: Tue, 23 May 2017 16:42:31 +0300 Subject: [PATCH] Move Start-TypeGen logic from Build.psm1 to SDK csproj file (Target Name="TypeCatalogGen") --- build.psm1 | 29 ++--------- .../Microsoft.PowerShell.SDK.csproj | 50 +++++++++++++++++++ 2 files changed, 54 insertions(+), 25 deletions(-) diff --git a/build.psm1 b/build.psm1 index fdc99f9768f..11006bdb20c 100644 --- a/build.psm1 +++ b/build.psm1 @@ -535,8 +535,8 @@ Fix steps: # publish netcoreapp2.0 reference assemblies try { - Push-Location "$PSScriptRoot/src/TypeCatalogGen" - $refAssemblies = Get-Content -Path $incFileName | Where-Object { $_ -like "*microsoft.netcore.app*" } | ForEach-Object { $_.TrimEnd(';') } + Push-Location "$PSScriptRoot/src/Microsoft.PowerShell.SDK/gen" + $refAssemblies = Get-Content -Path "RefAssemblyList.inc" | Where-Object { $_ -like "*microsoft.netcore.app*" } | ForEach-Object { $_.TrimEnd(';') } $refDestFolder = Join-Path -Path $publishPath -ChildPath "ref" if (Test-Path $refDestFolder -PathType Container) { @@ -1715,33 +1715,12 @@ function Start-TypeGen # Add .NET CLI tools to PATH Find-Dotnet - $GetDependenciesTargetPath = "$PSScriptRoot/src/Microsoft.PowerShell.SDK/obj/Microsoft.PowerShell.SDK.csproj.TypeCatalog.targets" - $GetDependenciesTargetValue = @' - - - - <_RefAssemblyPath Include="%(_ReferencesFromRAR.ResolvedPath)%3B" Condition=" '%(_ReferencesFromRAR.Type)' == 'assembly' And '%(_ReferencesFromRAR.PackageName)' != 'Microsoft.Management.Infrastructure' " /> - - - - -'@ - Set-Content -Path $GetDependenciesTargetPath -Value $GetDependenciesTargetValue -Force -Encoding Ascii - Push-Location "$PSScriptRoot/src/Microsoft.PowerShell.SDK" try { - $ps_inc_file = "$PSScriptRoot/src/TypeCatalogGen/$IncFileName" - dotnet msbuild .\Microsoft.PowerShell.SDK.csproj /t:_GetDependencies "/property:DesignTimeBuild=true;_DependencyFile=$ps_inc_file" /nologo - } finally { - Pop-Location - } - - Push-Location "$PSScriptRoot/src/TypeCatalogGen" - try { - dotnet run ../System.Management.Automation/CoreCLR/CorePsTypeCatalog.cs $IncFileName + dotnet msbuild .\Microsoft.PowerShell.SDK.csproj /t:"Clean;TypeCatalogGen" "/property:DesignTimeBuild=true" } finally { Pop-Location + log "Finish Start-TypeGen" } } diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 31187624128..54714ac593a 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -29,4 +29,54 @@ + + + gen + RefAssemblyList.inc + $(MSBuildProjectDirectory)\$(RefAssemblyRelPath) + $(RefAssemblyDirPath)\$(RefAssemblyFileName) + + $(MSBuildProjectDirectory)\..\Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CorePsTypeCatalog.cs + $(MSBuildProjectDirectory)\..\TypeCatalogGen\TypeCatalogGen.csproj + + + + + + + + + <_RefAssemblyPath Include="%(_ReferencesFromRAR.ResolvedPath)%3B" Condition=" '%(_ReferencesFromRAR.Type)' == 'assembly' And '%(_ReferencesFromRAR.PackageName)' != 'Microsoft.Management.Infrastructure' " /> + + + + + + + + + + + + + + + + + + + +