<SharedHostBrandName>$(ProductBrandPrefix) Host - $(ProductBrandSuffix)</SharedHostBrandName>
<HostFxrBrandName>$(ProductBrandPrefix) Host FX Resolver - $(ProductBrandSuffix)</HostFxrBrandName>
<TargetingPackBrandName>$(ProductBrandPrefix) Targeting Pack - $(ProductBrandSuffix)</TargetingPackBrandName>
+ <AppHostPackBrandName>$(ProductBrandPrefix) AppHost Pack - $(ProductBrandSuffix)</AppHostPackBrandName>
<SharedFrameworkBrandName>$(ProductBrandPrefix) Runtime - $(ProductBrandSuffix)</SharedFrameworkBrandName>
</PropertyGroup>
</Target>
<!--
- Copy the files in the package's data/ dir to a layout directory. This is what the targeting pack
- installer will place in the dotnet install dir.
+ Copy the files in the package's data/ dir to a layout directory. This is what the pack installer
+ will place in the dotnet install dir.
This extracts from the nupkg (zip) directly. An alternative would be using the PackageFile
items, but there's some risk of handling TargetPath metadata and filtering symbols differently
<RemoveDir Directories="$(PackLayoutDir)" />
<PropertyGroup>
- <TargetingPackNupkgFile>$(PackageOutputPath)$(Id).$(PackageVersion).nupkg</TargetingPackNupkgFile>
+ <FrameworkPackNupkgFile>$(PackageOutputPath)$(Id).$(PackageVersion).nupkg</FrameworkPackNupkgFile>
</PropertyGroup>
- <ZipFileGetEntries TargetArchive="$(TargetingPackNupkgFile)">
- <Output TaskParameter="Entries" ItemName="TargetingPackNupkgEntries" />
+ <ZipFileGetEntries TargetArchive="$(FrameworkPackNupkgFile)">
+ <Output TaskParameter="Entries" ItemName="FrameworkPackNupkgEntries" />
</ZipFileGetEntries>
<ItemGroup>
- <TargetingPackDataEntries
- Include="@(TargetingPackNupkgEntries)"
+ <FrameworkPackDataEntries
+ Include="@(FrameworkPackNupkgEntries)"
Condition="
- $([System.String]::new('%(TargetingPackNupkgEntries.Identity)').StartsWith('data/')) OR
- $([System.String]::new('%(TargetingPackNupkgEntries.Identity)').StartsWith('ref/')) OR
- $([System.String]::new('%(TargetingPackNupkgEntries.Identity)').StartsWith('runtimes/'))" />
+ $([System.String]::new('%(FrameworkPackNupkgEntries.Identity)').StartsWith('data/')) OR
+ $([System.String]::new('%(FrameworkPackNupkgEntries.Identity)').StartsWith('ref/')) OR
+ $([System.String]::new('%(FrameworkPackNupkgEntries.Identity)').StartsWith('runtimes/'))" />
</ItemGroup>
<ZipFileExtractToDirectory
- SourceArchive="$(TargetingPackNupkgFile)"
+ SourceArchive="$(FrameworkPackNupkgFile)"
DestinationDirectory="$(PackLayoutDir)packs/$(Id)/$(Version)/"
OverwriteDestination="true"
- Include="@(TargetingPackDataEntries)" />
+ Include="@(FrameworkPackDataEntries)" />
</Target>
<Target Name="GenerateSharedFramework"
<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Ref'))">
<FrameworkPackType>targeting</FrameworkPackType>
- <!--
- Prevent 'runtime.<rid>.Microsoft.<framework>.App.Ref' packages from being built.
+ <!-- Include the platform manifest in the data dir. -->
+ <PlatformManifestTargetPath>data/PlatformManifest.txt</PlatformManifestTargetPath>
+ <FrameworkListTargetPath>data/</FrameworkListTargetPath>
+ </PropertyGroup>
- Not the same as HasRuntimePackages, which is used to set up ProjectReferences on the runtime
- packages and generate assets such as the platform manifest.
+ <PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Host'))">
+ <FrameworkPackType>apphost</FrameworkPackType>
+
+ <!-- AppHost packs are only per-RID, e.g. 'Microsoft.NETCore.App.Host.win-x64'. -->
+ <BuildRidSpecificPacks>true</BuildRidSpecificPacks>
+ <BuildLineupPackage>false</BuildLineupPackage>
+
+ <!--
+ Use generic package description: packaging tasks don't handle RID suffix nicely and expect an
+ individual description for each RID.
-->
- <BuildRuntimePackages>false</BuildRuntimePackages>
+ <UseRuntimePackageDescription>true</UseRuntimePackageDescription>
+ </PropertyGroup>
- <PackageType>DotnetPlatform</PackageType>
+ <PropertyGroup Condition="'$(FrameworkPackType)' != ''">
<Version>$(ProductVersion)</Version>
+ <PackageType>DotnetPlatform</PackageType>
- <!-- Include the platform manifest in the data dir. -->
- <PlatformManifestTargetPath>data/PlatformManifest.txt</PlatformManifestTargetPath>
- <FrameworkListTargetPath>data/</FrameworkListTargetPath>
-
- <!-- Exclude runtime.json from the package. -->
+ <!--
+ Prevent 'runtime.<rid>.Microsoft.<framework>.App.Ref' packages from being built, and disable
+ the runtime.json and lineup package infrastructure. Packs are either RID-agnostic or use
+ convention-based runtime packages, not runtime.json with a lineup package.
+ -->
+ <BuildRuntimePackages>false</BuildRuntimePackages>
<IncludeRuntimeJson>false</IncludeRuntimeJson>
<IsLineupPackage>false</IsLineupPackage>
<PropertyGroup Condition="'$(FrameworkPackType)' == 'targeting'">
<InstallerName>$(ShortFrameworkName)-targeting-pack</InstallerName>
<WixProductMoniker>$(TargetingPackBrandName)</WixProductMoniker>
+ </PropertyGroup>
- <MacOSComponentName>com.microsoft.$(ShortFrameworkName).pack.$(FrameworkPackType).$(ProductVersion).component.osx.x64</MacOSComponentName>
- <MacOSSharedInstallDir>/usr/local/share/dotnet</MacOSSharedInstallDir>
+ <PropertyGroup Condition="'$(FrameworkPackType)' == 'apphost'">
+ <InstallerName>$(ShortFrameworkName)-apphost-pack</InstallerName>
+ <WixProductMoniker>$(AppHostPackBrandName)</WixProductMoniker>
</PropertyGroup>
<PropertyGroup Condition="'$(GenerateSharedFramework)' == 'true'">
</PropertyGroup>
<PropertyGroup>
+ <MacOSComponentName>com.microsoft.$(ShortFrameworkName).pack.$(FrameworkPackType).$(ProductVersion).component.osx.x64</MacOSComponentName>
+ <MacOSSharedInstallDir>/usr/local/share/dotnet</MacOSSharedInstallDir>
+
<VersionedInstallerName>$(InstallerName)-$(ProductBandVersion)</VersionedInstallerName>
<VersionedInstallerName>$(VersionedInstallerName.ToLowerInvariant())</VersionedInstallerName>
<InstallerPackageRelease>1</InstallerPackageRelease>
<!-- Set up information to pass to WiX, depending on the type of installer being created. -->
<Target Name="GetWixBuildConfiguration" DependsOnTargets="GetInstallerProperties">
- <ItemGroup Condition="'$(FrameworkPackType)' == 'targeting'">
+ <ItemGroup Condition="'$(FrameworkPackType)' != ''">
<DirectoryToHarvest
Include="$(PackLayoutDir)"
Name="install-files"
- SubstituteVar="TargetingPackSrc"
+ SubstituteVar="PackSrc"
ComponentGroupName="InstallFiles"
DirectoryRef="DOTNETHOME" />
- <WixSrcFile Include="$(MSBuildThisFileDirectory)targetingPack/product.wxs" />
+ <WixSrcFile Include="$(MSBuildThisFileDirectory)pack/product.wxs" />
</ItemGroup>
<ItemGroup Condition="'$(GenerateSharedFramework)' == 'true'">
<PropertyGroup>
<Version>$(AppHostVersion)</Version>
- </PropertyGroup>
+ </PropertyGroup>
- <Import Condition="'$(PackageTargetRuntime)' != ''" Project="$(MSBuildThisFileDirectory)runtime.$(OSGroup).$(MSBuildProjectName).props" />
+ <Import Project="$(MSBuildProjectName).props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Import
+ Condition="'$(PackageTargetRuntime)' != ''"
+ Project="$(MSBuildThisFileDirectory)runtime.$(OSGroup).Microsoft.NETCore.DotNetAppHost.props" />
+
+</Project>
<IsLineupPackage Condition="'$(PackageTargetRuntime)' == ''">true</IsLineupPackage>
<BuildRuntimePackages>true</BuildRuntimePackages>
+ <BuildLineupPackage>true</BuildLineupPackage>
<PackProjectDependencies>true</PackProjectDependencies>
</PropertyGroup>
<ItemGroup Condition="'$(HasRuntimePackages)' != 'false'">
<_project Include="@(BuildRID)">
<Platform Condition="'%(Platform)' == ''">x64</Platform>
- <PackageTargetRuntime>%(Identity)</PackageTargetRuntime>
- <AdditionalProperties>PackageTargetRuntime=%(Identity);NuGetRuntimeIdentifier=%(Identity);Platform=%(Platform)</AdditionalProperties>
+ <BuildRID>%(Identity)</BuildRID>
+ <PackageTargetRuntime>%(BuildRID)</PackageTargetRuntime>
+ <AdditionalProperties>PackageTargetRuntime=%(BuildRID);NuGetRuntimeIdentifier=%(BuildRID);Platform=%(Platform)</AdditionalProperties>
</_project>
<RuntimeProject Include="@(_project->'$(MSBuildProjectFullPath)')" />
+
+ <!--
+ Pack projects need package IDs like "Microsoft.NETCore.App.Host.Runtime.<rid>". The package
+ tooling statically uses the MSBuild project name as the package ID, allowing for a prefix, but
+ not a suffix. Set BaseId as a non-overridable global to force the desired ID in a way that the
+ rest of the packaging tooling automatically respects.
+
+ Force IdPrefix to '' to allow using the well-supported PackageTargetRuntime without adding the
+ undesired 'runtime.<rid>.' prefix to the package ID.
+ -->
+ <RidSpecificPackProject
+ Include="@(_project->'$(MSBuildProjectFullPath)')"
+ BaseId="$(MSBuildProjectName).%(BuildRID)"
+ AdditionalProperties="%(AdditionalProperties);BaseId=%(BaseId);IdPrefix=" />
</ItemGroup>
<ItemGroup Condition="'$(PackageTargetRuntime)' == '' and '$(HasRuntimePackages)' != 'false'">
<ItemGroup>
<!-- The pkg and src builds both build these projects. Add them to both phases. -->
<PkgSrcProject Include="@(RuntimeProject)" Condition="'$(BuildRuntimePackages)' == 'true'" />
- <PkgSrcProject Include="$(MSBuildProjectFullPath)" />
+ <PkgSrcProject Include="@(RidSpecificPackProject)" Condition="'$(BuildRidSpecificPacks)' == 'true'" />
+ <PkgSrcProject Include="$(MSBuildProjectFullPath)" Condition="'$(BuildLineupPackage)' == 'true'"/>
<Project Include="@(PkgSrcProject)" Phase="pkg" />
<Project Include="@(PkgSrcProject)" Phase="src" />
<!--
- Create targeting pack packages/installers. Similar to the runtime package, we only make one
- Debian or RPM package for all distros of that type.
+ Create framework pack non-nuget packages/installers. Similar to the runtime package, we only
+ make one Debian or RPM package for all distros of that type.
-->
<Project
Include="$(MSBuildProjectFullPath)"
Phase="installer"
Condition="
- '$(FrameworkPackType)' == 'targeting' AND
+ '$(FrameworkPackType)' != '' AND
'$(BuildDistroIndependentInstallers)' == 'true'" />
</ItemGroup>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+
+ <!--
+ Create AppHost Pack based on legacy DotNetAppHost package. This can be collapsed once the legacy
+ package is no longer used.
+ -->
+ <Import Project="..\..\Microsoft.NETCore.DotNetAppHost\Microsoft.NETCore.DotNetAppHost.props" />
+
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+</Project>
\ No newline at end of file
</PropertyGroup>
<!-- Redistribute package content from other nuget packages. -->
- <ItemGroup>
+ <ItemGroup Condition="'$(FrameworkPackType)' != 'apphost'">
<ProjectReference Include="..\src\netcoreapp.depproj">
<AdditionalProperties Condition="'$(PackageTargetRuntime)' != ''">NuGetRuntimeIdentifier=$(PackageTargetRuntime)</AdditionalProperties>
</ProjectReference>
<CompressedFile Include="$(AssetOutputPath)**/*$(CompressedFileExtension)">
<RelativeBlobPath>$(BinariesRelativePath)</RelativeBlobPath>
</CompressedFile>
- <RuntimePackageFile Include="$(PackageOutputPath)**/runtime.*.nupkg" >
- <RelativeBlobPath>$(BinariesRelativePath)</RelativeBlobPath>
- </RuntimePackageFile>
+
+ <RuntimePackageFile
+ Include="
+ $(PackageOutputPath)**/runtime.*.nupkg;
+ $(PackageOutputPath)**/*.App.Host.*.nupkg"
+ RelativeBlobPath="$(BinariesRelativePath)"/>
+
<RidAgnosticPackageFile Include="$(PackageOutputPath)**/*.nupkg" Exclude="@(RuntimePackageFile)" >
<RelativeBlobPath>$(BinariesRelativePath)</RelativeBlobPath>
</RidAgnosticPackageFile>