Include AppHostTemplate

This commit is contained in:
Daniel Plaisted 2018-12-03 18:58:43 -08:00
parent 55841f78ea
commit 6c8f08bbd9
2 changed files with 68 additions and 3 deletions

View file

@ -19,18 +19,18 @@
<!-- Download the runtime package with the crossgen executable in it -->
<ItemGroup>
<DownloadPackageProject Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj">
<CrossGenDownloadPackageProject Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj">
<Properties>
PackageToRestore=$(RuntimeNETCoreAppPackageName);
PackageVersionToRestore=$(MicrosoftNETCoreAppPackageVersion);
TargetFramework=$(TargetFramework)
</Properties>
</DownloadPackageProject>
</CrossGenDownloadPackageProject>
</ItemGroup>
<MSBuild
BuildInParallel="False"
Projects="@(DownloadPackageProject)">
Projects="@(CrossGenDownloadPackageProject)">
</MSBuild>
<ItemGroup>

View file

@ -218,6 +218,70 @@
Overwrite="true" />
</Target>
<Target Name="LayoutAppHostTemplate" DependsOnTargets="RunResolvePackageDependencies">
<PropertyGroup>
<NETCoreDotNetAppHostPackageName>Microsoft.NETCore.DotNetAppHost</NETCoreDotNetAppHostPackageName>
<AppHostRestorePath>$(IntermediateOutputPath)AppHostRestore\</AppHostRestorePath>
<AppHostTemplatePath>$(SdkOutputDirectory)AppHostTemplate</AppHostTemplatePath>
</PropertyGroup>
<RemoveDir Directories="$(AppHostRestorePath)" />
<MakeDir Directories="$(AppHostRestorePath)" />
<ItemGroup>
<NETCoreDotNetAppHostPackageVersions Include="@(PackageDefinitions->'%(Version)')"
Condition="%(PackageDefinitions.Name) == $(NETCoreDotNetAppHostPackageName)" />
</ItemGroup>
<Error Condition="@(NETCoreDotNetAppHostPackageVersions->Distinct()->Count()) != 1"
Text="Failed to determine the $(NETCoreDotNetAppHostPackageName) version pulled in Microsoft.NETCore.App" />
<PropertyGroup>
<_NETCoreDotNetAppHostPackageVersion>@(NETCoreDotNetAppHostPackageVersions->Distinct())</_NETCoreDotNetAppHostPackageVersion>
</PropertyGroup>
<ItemGroup>
<AppHostTemplateDownloadPackageProject Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj">
<Properties>
PackageToRestore=$(NETCoreDotNetAppHostPackageName);
PackageVersionToRestore=$(_NETCoreDotNetAppHostPackageVersion);
TargetFramework=$(TargetFramework);
RestorePackagesPath=$(AppHostRestorePath);
RuntimeIdentifier=$(Rid)
</Properties>
</AppHostTemplateDownloadPackageProject>
</ItemGroup>
<MSBuild
BuildInParallel="False"
Projects="@(AppHostTemplateDownloadPackageProject)">
</MSBuild>
<PropertyGroup>
<AppHostExecutableName>AppHost$(ExeExtension)</AppHostExecutableName>
</PropertyGroup>
<ItemGroup>
<AllFileOfRestoredAppHostPackage Include="$(AppHostRestorePath)\**\*.*" />
<NativeRestoredAppHostNETCore
Include="@(AllFileOfRestoredAppHostPackage)"
Condition="'%(FileName)%(Extension)' == '$(AppHostExecutableName)'"/>
</ItemGroup>
<Error Condition="@(NativeRestoredAppHostNETCore->Distinct()->Count()) != 1"
Text="Failed to determine the $(NETCoreDotNetAppHostPackageName) executable in @(AllFileOfRestoredAppHostPackage)" />
<Copy
SourceFiles="@(NativeRestoredAppHostNETCore)"
DestinationFolder="$(AppHostTemplatePath)" />
<Message Text="Copy from @(NativeRestoredAppHostNETCore) to $(AppHostTemplatePath)."
Importance="High" />
</Target>
<Target Name="GenerateLayout"
DependsOnTargets="DownloadBundledComponents;
CleanLayoutPath;
@ -227,6 +291,7 @@
LayoutTemplates;
LayoutBundledTools;
RetargetTools;
LayoutAppHostTemplate;
CrossgenLayout"
AfterTargets="Build">