| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- <Project>
- <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
- <PropertyGroup>
- <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
- <IsPackable>true</IsPackable>
- <IsPackable Condition="'$(IsTargetingPackBuilding)' == 'false'">false</IsPackable>
- <PackageId>$(TargetingPackName)</PackageId>
- <VersionPrefix>$(TargetingPackVersionPrefix)</VersionPrefix>
- <!-- This is a reference package and does not include any dependencies. -->
- <NoWarn>$(NoWarn);NU5128</NoWarn>
- <PackageDescription>Provides a default set of APIs for building an ASP.NET Core application. Contains reference assemblies, documentation, and other design-time assets.
- This package is an internal implementation of the .NET Core SDK and is not meant to be used as a normal PackageReference.</PackageDescription>
- <PackageTags>aspnetcore;targeting-pack</PackageTags>
- <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
- <PackageType>DotnetPlatform</PackageType>
- <RefAssemblyPackagePath>ref/$(TargetFramework)/</RefAssemblyPackagePath>
- <!-- There are no symbols for reference assemblies. -->
- <IncludeSymbols>false</IncludeSymbols>
- <!-- The project representing the shared framework doesn't produce a .NET assembly or symbols. -->
- <DebugType>none</DebugType>
- <IncludeBuildOutput>false</IncludeBuildOutput>
- <CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
- <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
- <CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
- <GenerateDependencyFile>false</GenerateDependencyFile>
- <!-- This project should not be referenced via the `<Reference>` implementation. -->
- <IsProjectReferenceProvider>false</IsProjectReferenceProvider>
- <PackageConflictManifestFileName>PackageOverrides.txt</PackageConflictManifestFileName>
- <!-- Reference implementation assemblies in addition to ref assemblies to get xml docs -->
- <ReferenceImplementationAssemblies>true</ReferenceImplementationAssemblies>
- <!--
- We are ignoring MSB3243 warnings since implementation and reference assemblies are versioned differently.
- We need both to compose the targeting pack with reference assemblies and xml docs.
- -->
- <MSBuildWarningsAsMessages>MSB3243</MSBuildWarningsAsMessages>
- <!-- We are ignoring NU5131 and NU5128 warnings since the dependency group should be kept empty. -->
- <NoWarn>$(NoWarn);NU5131;NU5128</NoWarn>
- <!-- Platform manifest data -->
- <FrameworkListFileName>FrameworkList.xml</FrameworkListFileName>
- <FrameworkListOutputPath>$(ArtifactsObjDir)$(FrameworkListFileName)</FrameworkListOutputPath>
- <!-- Platform manifest and package override metatdata -->
- <ReferencePackSharedFxVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).0</ReferencePackSharedFxVersion>
- <ReferencePackSharedFxVersion Condition="'$(VersionSuffix)' != ''">$(ReferencePackSharedFxVersion)-$(VersionSuffix)</ReferencePackSharedFxVersion>
- <ReferencePlatformManifestPath Condition="'$(IsServicingBuild)' != 'true'">$(PlatformManifestOutputPath)</ReferencePlatformManifestPath>
- <ReferencePlatformManifestPath Condition="'$(IsServicingBuild)' == 'true'">$(RepoRoot)eng\PlatformManifest.txt</ReferencePlatformManifestPath>
- </PropertyGroup>
- <ItemGroup>
- <!-- Note: do not add _TransitiveExternalAspNetCoreAppReference to this list. This is intentionally not listed as a direct package reference. -->
- <Reference Include="@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference)" />
- <!-- Enforce build order. Targeting pack needs to bundle information about the runtime. -->
- <ProjectReference Include="..\src\Microsoft.AspNetCore.App.Runtime.csproj">
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
- </ProjectReference>
- </ItemGroup>
- <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
- <PropertyGroup>
- <TargetingPackSubPath>packs\Microsoft.AspNetCore.App.Ref\$(PackageVersion)\</TargetingPackSubPath>
- <LayoutTargetDir>$(TargetingPackLayoutRoot)$(TargetingPackSubPath)</LayoutTargetDir>
- <LocalInstallationOutputPath>$(LocalDotNetRoot)$(TargetingPackSubPath)</LocalInstallationOutputPath>
- <ArchiveOutputFileName>aspnetcore-targeting-pack-$(PackageVersion)</ArchiveOutputFileName>
- <ZipArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName).zip</ZipArchiveOutputPath>
- <TarArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName).tar.gz</TarArchiveOutputPath>
- </PropertyGroup>
- <PropertyGroup>
- <!-- If this project won't produce a package, don't bother building anything. -->
- <BuildDependsOn Condition="'$(IsTargetingPackBuilding)' != 'false'">
- $(BuildDependsOn);
- _ResolveTargetingPackContent;
- GeneratePackageConflictManifest;
- IncludeFrameworkListFile;
- _BatchCopyToLayoutTargetDir;
- _InstallTargetingPackIntoLocalDotNet;
- _CreateTargetingPackArchive;
- </BuildDependsOn>
- <!-- No-op when in source build -->
- <BuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'"/>
- </PropertyGroup>
- <!-- Override the default MSBuild targets so that nothing is returned from the project since it represents a collection of assemblies. -->
- <Target Name="GetTargetPath" />
- <Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
- <!-- This project doesn't compile anything. -->
- <Target Name="CoreCompile" />
- <!-- Completely disable default targets for copying to output. -->
- <Target Name="CopyFilesToOutputDirectory" />
- <!-- This target finds the reference assemblies. -->
- <Target Name="_ResolveTargetingPackContent"
- Returns="@(AspNetCoreReferenceAssemblyPath)"
- BeforeTargets="_GetPackageFiles"
- DependsOnTargets="ResolveReferences;FindReferenceAssembliesForReferences">
- <ItemGroup>
- <_AvailableExtensionsRefAssemblies Include="$(MicrosoftInternalExtensionsRefsPath)\*.dll" />
- </ItemGroup>
- <JoinItems Left="@(ReferencePathWithRefAssemblies)" Right="@(_AvailableExtensionsRefAssemblies)" LeftKey="Filename" RightKey="Filename" ItemSpecToUse="Left">
- <Output TaskParameter="JoinResult" ItemName="_ReferencedExtensionsRefAssemblies" />
- </JoinItems>
- <!-- _DuplicatedExtensionsRefAssemblies represents ref assemblies that are present in Microsoft.Internal.Extensions.Refs package and also are built in this repo. -->
- <!-- This should be temporary while we migrate sources since there should be no duplication when sources are deleted from extensions. -->
- <JoinItems Left="@(_ReferencedExtensionsRefAssemblies)" Right="@(_ResolvedProjectReferencePaths)" LeftKey="Filename" RightKey="Filename" ItemSpecToUse="Left">
- <Output TaskParameter="JoinResult" ItemName="_DuplicatedExtensionsRefAssemblies" />
- </JoinItems>
- <JoinItems Left="@(_ReferencedExtensionsRefAssemblies)" Right="@(ExternalAspNetCoreAppReference)" LeftKey="Filename" RightKey="Identity" ItemSpecToUse="Left">
- <Output TaskParameter="JoinResult" ItemName="_SelectedExtensionsRefs" />
- </JoinItems>
- <JoinItems Left="@(ReferencePathWithRefAssemblies)" Right="@(_SelectedExtensionsRefs)" LeftKey="Filename" RightKey="Filename" ItemSpecToUse="Left">
- <Output TaskParameter="JoinResult" ItemName="_SelectedExtensionsRefAssemblies" />
- </JoinItems>
- <ItemGroup>
- <!-- Do not exclude the ref assemblies that we built in this repo if it's also included in Microsoft.Internal.Extensions.Refs -->
- <_ReferencedExtensionsRefAssembliesToExclude Include="@(_ReferencedExtensionsRefAssemblies)" Exclude="@(_DuplicatedExtensionsRefAssemblies)" />
- <!-- Exclude transitive external dependencies that are not directly referenced by projects in AspNetCore or Extensions -->
- <AspNetCoreReferenceAssemblyPath
- Include="@(ReferencePathWithRefAssemblies)"
- Condition="'%(ReferencePathWithRefAssemblies.IsReferenceAssembly)' == 'true'"
- Exclude="
- @(_ReferencedExtensionsRefAssembliesToExclude);
- @(ReferencePathWithRefAssemblies->WithMetadataValue('NuGetPackageId', 'Microsoft.NETCore.App.Ref'));
- @(ReferencePathWithRefAssemblies->WithMetadataValue('NuGetPackageId', 'System.Security.Cryptography.Pkcs'));
- @(ReferencePathWithRefAssemblies->WithMetadataValue('NuGetPackageId', 'System.Drawing.Common'));
- @(ReferencePathWithRefAssemblies->WithMetadataValue('NuGetPackageId', 'Microsoft.Win32.SystemEvents'));
- @(ReferencePathWithRefAssemblies->WithMetadataValue('ReferenceGrouping', 'Microsoft.NETCore.App'));" />
- <AspNetCoreReferenceAssemblyPath
- Include="@(_SelectedExtensionsRefAssemblies->'$(MicrosoftInternalExtensionsRefsPath)%(FileName)%(Extension)')" />
- <AspNetCoreReferenceDocXml Include="@(_ResolvedProjectReferencePaths->WithMetadataValue('IsReferenceAssembly', 'false')->'%(RootDir)%(Directory)%(FileName).xml')" />
- <AspNetCoreReferenceDocXml Include="@(_SelectedExtensionsRefAssemblies->'$(MicrosoftInternalExtensionsRefsPath)%(FileName).xml')" />
- <RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
- <RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
- <RefPackContent Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(ManifestsPackagePath)" />
- <RefPackContent Include="$(ReferencePlatformManifestPath)" PackagePath="$(ManifestsPackagePath)" />
- </ItemGroup>
- </Target>
- <Target Name="GeneratePackageConflictManifest"
- DependsOnTargets="_ResolveTargetingPackContent"
- Inputs="$(MSBuildAllProjects)"
- Outputs="$(TargetDir)$(PackageConflictManifestFileName)">
- <ItemGroup>
- <!-- Use package version for non-Extensions references -->
- <_AspNetCoreAppPackageOverrides Include="@(AspNetCoreReferenceAssemblyPath->'%(NuGetPackageId)|%(NuGetPackageVersion)')" Condition="!Exists('$(MicrosoftInternalExtensionsRefsPath)%(AspNetCoreReferenceAssemblyPath.NuGetPackageId).dll') AND '%(AspNetCoreReferenceAssemblyPath.NuGetPackageId)' != 'Microsoft.NETCore.App' AND '%(AspNetCoreReferenceAssemblyPath.NuGetPackageId)' != 'Microsoft.Internal.Extensions.Refs' AND '%(AspNetCoreReferenceAssemblyPath.NuGetSourceType)' == 'Package' " />
- <!-- Pin version for extensions references -->
- <_AspNetCoreAppPackageOverrides Include="@(_SelectedExtensionsRefAssemblies->'%(FileName)|$(MicrosoftInternalExtensionsRefsPackageOverrideVersion)')" />
- <_AspNetCoreAppPackageOverrides Include="@(AspNetCoreReferenceAssemblyPath->'%(FileName)|$(ReferencePackSharedFxVersion)')" Condition=" '%(AspNetCoreReferenceAssemblyPath.ReferenceSourceTarget)' == 'ProjectReference' AND '%(AspNetCoreReferenceAssemblyPath.IsReferenceAssembly)' == 'true' " />
- </ItemGroup>
- <WriteLinesToFile
- Lines="@(_AspNetCoreAppPackageOverrides)"
- File="$(TargetDir)$(PackageConflictManifestFileName)"
- Overwrite="true" />
- </Target>
- <!-- Written to take advantage of target batching in MSBuild. -->
- <Target Name="_BatchCopyToLayoutTargetDir"
- DependsOnTargets="_ResolveTargetingPackContent"
- Inputs="@(RefPackContent)"
- Outputs="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')">
- <Copy SourceFiles="@(RefPackContent)"
- DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')"
- UseHardlinksIfPossible="true" />
- <Message Importance="High" Text="$(MSBuildProjectName) -> $(LayoutTargetDir)" />
- </Target>
- <ItemGroup>
- <CreateDirectory Include="$(LocalInstallationOutputPath)" />
- </ItemGroup>
- <!-- Workaround https://github.com/dotnet/sdk/issues/2910 by copying targeting pack into local installation. -->
- <Target Name="_InstallTargetingPackIntoLocalDotNet"
- DependsOnTargets="_ResolveTargetingPackContent"
- Inputs="@(RefPackContent)"
- Outputs="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(FileName)%(Extension)')">
- <Copy SourceFiles="@(RefPackContent)"
- DestinationFiles="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(FileName)%(Extension)')"
- UseHardlinksIfPossible="true" />
- <Message Importance="High" Text="$(MSBuildProjectName) -> $(LocalInstallationOutputPath)" />
- </Target>
- <Target Name="_CreateTargetingPackArchive"
- Inputs="@(RefPackContent)"
- Outputs="$(ZipArchiveOutputPath);$(TarArchiveOutputPath)"
- Condition=" '$(IsPackable)' == 'true' ">
- <PropertyGroup>
- <_TarCommand>tar</_TarCommand>
- <_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">"$(RepoRoot).tools\tar.exe"</_TarCommand>
- <!-- For the tar packed with git, transform e.g. "C:\root\AspNetCore\File.tar.gz" to "/C/root/AspNetCore/File.tar.gz". -->
- <_TarArchiveOutputPath>$(TarArchiveOutputPath)</_TarArchiveOutputPath>
- <_TarArchiveOutputPath
- Condition="Exists('$(repoRoot)\.tools\tar.fromGit')">/$(TarArchiveOutputPath.Replace('\','/').Replace(':',''))</_TarArchiveOutputPath>
- </PropertyGroup>
- <ZipDirectory
- SourceDirectory="$(TargetingPackLayoutRoot)"
- DestinationFile="$(ZipArchiveOutputPath)"
- Overwrite="true" />
- <!-- Requires Windows 10 version 1803 or newer -->
- <Message Importance="High" Text="Executing: $(_TarCommand) -czf "$(_TarArchiveOutputPath)" ." />
- <Exec Command="$(_TarCommand) -czf "$(_TarArchiveOutputPath)" ."
- WorkingDirectory="$(TargetingPackLayoutRoot)" />
- <Message Importance="High" Text="$(MSBuildProjectName) -> $(TarArchiveOutputPath)" />
- </Target>
- <Target Name="IncludeFrameworkListFile"
- DependsOnTargets="_ResolveTargetingPackContent"
- BeforeTargets="_GetPackageFiles"
- Condition="'$(PackageTargetRuntime)' == '' AND '$(ManifestsPackagePath)' != ''">
- <RepoTasks.CreateFrameworkListFile
- Files="@(RefPackContent)"
- TargetFile="$(FrameworkListOutputPath)"
- RootAttributes="@(FrameworkListRootAttributes)" />
- <ItemGroup>
- <RefPackContent Include="$(FrameworkListOutputPath)" PackagePath="$(ManifestsPackagePath)" />
- <_PackageFiles Include="@(RefPackContent)" />
- </ItemGroup>
- </Target>
- </Project>
|