From a2dc405242f2995af425e762129581f740ec913b Mon Sep 17 00:00:00 2001 From: Kyle Sferrazza Date: Fri, 13 Oct 2017 12:57:07 -0400 Subject: [PATCH] Update instructions for building from source (#5072) - Use new S.M.A.dll for build instructions - Include custom build target in `internals.md` - build.sh no longer exists --- docs/building/internals.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/building/internals.md b/docs/building/internals.md index 1252b72c0..6ab7fc332 100644 --- a/docs/building/internals.md +++ b/docs/building/internals.md @@ -70,11 +70,28 @@ The necessary steps can be run manually: ```sh cd ../TypeCatalogGen dotnet restore -dotnet run ../Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CorePsTypeCatalog.cs powershell.inc +dotnet run ../System.Management.Automation/CoreCLR/CorePsTypeCatalog.cs powershell.inc ``` The file `powershell.inc` is generated by running a custom MSBuild target, -which can be found at [`build.sh`](../../build.sh#L15). +which can be set-up by navigating to the `src` directory and running the following commands: + +```sh +targetFile="Microsoft.PowerShell.SDK/obj/Microsoft.PowerShell.SDK.csproj.TypeCatalog.targets" +cat > $targetFile <<-"EOF" + + + + <_RefAssemblyPath Include="%(_ReferencesFromRAR.ResolvedPath)%3B" Condition=" '%(_ReferencesFromRAR.Type)' == 'assembly' And '%(_ReferencesFromRAR.PackageName)' != 'Microsoft.Management.Infrastructure' " /> + + + + +EOF +dotnet msbuild Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj /t:_GetDependencies "/property:DesignTimeBuild=true;_DependencyFile=$(pwd)/src/TypeCatalogGen/powershell.inc" /nologo +``` + `powershell.inc` contains the resolved paths to the DLLs of each dependency of PowerShell, and is taken as input to the [`TypeCatalogGen`](../../src/TypeCatalogGen) tool, which generates a source file `CorePsTypeCatalog.cs` for the `Microsoft.PowerShell.CoreCLR.AssemblyLoadContext` project.