|
29 | 29 | <PackageReference Include="Microsoft.NETCore.Windows.ApiSets" Version="1.0.1" />
|
30 | 30 | </ItemGroup>
|
31 | 31 |
|
| 32 | + <!-- TypeCatalogGen properties --> |
| 33 | + <PropertyGroup> |
| 34 | + <RefAssemblyRelPath>gen</RefAssemblyRelPath> |
| 35 | + <RefAssemblyFileName>RefAssemblyList.inc</RefAssemblyFileName> |
| 36 | + <RefAssemblyDirPath>$(MSBuildProjectDirectory)\$(RefAssemblyRelPath)</RefAssemblyDirPath> |
| 37 | + <RefAssemblyFilePath>$(RefAssemblyDirPath)\$(RefAssemblyFileName)</RefAssemblyFilePath> |
| 38 | + |
| 39 | + <CorePsTypeCatalogFilePath>$(MSBuildProjectDirectory)\..\Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CorePsTypeCatalog.cs</CorePsTypeCatalogFilePath> |
| 40 | + <TypeCatalogProjectFilePath>$(MSBuildProjectDirectory)\..\TypeCatalogGen\TypeCatalogGen.csproj</TypeCatalogProjectFilePath> |
| 41 | + </PropertyGroup> |
| 42 | + |
| 43 | + <!-- Create file with Assembly Reference list --> |
| 44 | + <Target Name="ResolveAssemblyReferencesDesignTimeSDK" |
| 45 | + DependsOnTargets="ResolveAssemblyReferencesDesignTime" |
| 46 | + Condition=" '$(DesignTimeBuild)' == 'true' "> |
| 47 | + |
| 48 | + <MakeDir Directories="$(RefAssemblyRelPath)" Condition=" !Exists('$(RefAssemblyRelPath)') "/> |
| 49 | + |
| 50 | + <ItemGroup> |
| 51 | + <_RefAssemblyPath Include="%(_ReferencesFromRAR.ResolvedPath)%3B" Condition=" '%(_ReferencesFromRAR.Type)' == 'assembly' And '%(_ReferencesFromRAR.PackageName)' != 'Microsoft.Management.Infrastructure' " /> |
| 52 | + </ItemGroup> |
| 53 | + |
| 54 | + <ReadLinesFromFile |
| 55 | + File="$(RefAssemblyFilePath)" > |
| 56 | + <Output |
| 57 | + TaskParameter="Lines" |
| 58 | + ItemName="ItemsFromFile"/> |
| 59 | + </ReadLinesFromFile> |
| 60 | + |
| 61 | + <WriteLinesToFile |
| 62 | + Condition=" @(ItemsFromFile) != @(_RefAssemblyPath) "<
A65D
/span> |
| 63 | + File="$(RefAssemblyFilePath)" |
| 64 | + Lines="@(_RefAssemblyPath)" Overwrite="true" /> |
| 65 | + </Target> |
| 66 | + |
| 67 | + <!-- Used in standard Clean target --> |
| 68 | + <ItemGroup> |
| 69 | + <Clean Include="$(RefAssemblyDirPath)\**"/> |
| 70 | + </ItemGroup> |
| 71 | + |
| 72 | + <Target Name="TypeCatalogGen" |
| 73 | + DependsOnTargets="ResolveAssemblyReferencesDesignTimeSDK" |
| 74 | + Condition=" '$(DesignTimeBuild)' == 'true' " |
| 75 | + Inputs="$(RefAssemblyFilePath)" |
| 76 | + Outputs="$(CorePsTypeCatalogFilePath)"> |
| 77 | + |
| 78 | + <Message Text="Project File Name" /> |
| 79 | + <Exec Command="dotnet run --project $(TypeCatalogProjectFilePath) $(CorePsTypeCatalogFilePath) $(RefAssemblyFilePath) "/> |
| 80 | + </Target> |
| 81 | + |
32 | 82 | </Project>
|
0 commit comments