Microsoft.AspNetCore.App.Ref.csproj 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <Project>
  2. <PropertyGroup>
  3. <OutputInRepoRoot>true</OutputInRepoRoot>
  4. <!-- Temporary flag to disable restoring this project against the artifacts/ folder. -->
  5. <_DisableRestoreFromLocalPackages>true</_DisableRestoreFromLocalPackages>
  6. </PropertyGroup>
  7. <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
  8. <PropertyGroup>
  9. <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
  10. <IsShippingPackage>true</IsShippingPackage>
  11. <IsPackable>true</IsPackable>
  12. <PackageDescription>Provides a default set of APIs for building an ASP.NET Core application. Contains reference assemblies, documentation, and other design-time assets.
  13. This package is an internal implementation of the .NET Core SDK and is not meant to be used as a normal PackageReference.</PackageDescription>
  14. <PackageTags>aspnetcore;targeting-pack</PackageTags>
  15. <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
  16. <PackageType>DotnetPlatform</PackageType>
  17. <RefAssemblyPackagePath>ref/$(TargetFramework)/</RefAssemblyPackagePath>
  18. <LayoutTargetDir>$(TargetingPackLayoutRoot)packs/Microsoft.AspNetCore.App.Ref/$(PackageVersion)/</LayoutTargetDir>
  19. <ArchiveOutputFileName>aspnetcore-targeting-pack-$(PackageVersion).zip</ArchiveOutputFileName>
  20. <ArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName)</ArchiveOutputPath>
  21. <!-- There are no symbols for reference assemblies. -->
  22. <IncludeSymbols>false</IncludeSymbols>
  23. <!-- The project representing the shared framework doesn't produce a .NET assembly or symbols. -->
  24. <DebugType>none</DebugType>
  25. <IncludeBuildOutput>false</IncludeBuildOutput>
  26. <CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
  27. <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
  28. <CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
  29. <GenerateDependencyFile>false</GenerateDependencyFile>
  30. <!-- This project should not be referenced via the `<Reference>` impementation. -->
  31. <IsProjectReferenceProvider>false</IsProjectReferenceProvider>
  32. <PackageConflictManifestFileName>PackageOverrides.txt</PackageConflictManifestFileName>
  33. <PackageConflictManifestPackagePath>data/</PackageConflictManifestPackagePath>
  34. <!-- Reference implementation assemblies in addition to ref assemblies to get xml docs -->
  35. <ReferenceImplementationAssemblies>true</ReferenceImplementationAssemblies>
  36. </PropertyGroup>
  37. <ItemGroup>
  38. <!-- Note: do not add _TransitiveExternalAspNetCoreAppReference to this list. This is intentionally not listed as a direct package reference. -->
  39. <Reference Include="@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference)" />
  40. </ItemGroup>
  41. <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
  42. <PropertyGroup>
  43. <BuildDependsOn>
  44. $(BuildDependsOn);
  45. GeneratePackageConflictManifest;
  46. _ResolveTargetingPackContent;
  47. _BatchCopyToLayoutTargetDir;
  48. _CreateTargetingPackArchive;
  49. </BuildDependsOn>
  50. </PropertyGroup>
  51. <!-- Override the default MSBuild targets so that nothing is returned from the project since it represents a collection of assemblies. -->
  52. <Target Name="GetTargetPath" />
  53. <Target Name="Build" DependsOnTargets="$(BuildDependsOn)">
  54. <Message Importance="High" Text="$(MSBuildProjectName) -> $(TargetDir)" />
  55. </Target>
  56. <!-- This project doesn't compile anything. -->
  57. <Target Name="CoreCompile" />
  58. <!-- Completely disable default targets for copying to output. -->
  59. <Target Name="CopyFilesToOutputDirectory" />
  60. <!-- This target finds the reference assemblies. -->
  61. <Target Name="_ResolveTargetingPackContent"
  62. BeforeTargets="_GetPackageFiles"
  63. DependsOnTargets="ResolveReferences;FindReferenceAssembliesForReferences">
  64. <ItemGroup>
  65. <AspNetCoreReferenceAssemblyPath
  66. Include="@(ReferencePathWithRefAssemblies)"
  67. Exclude="
  68. @(ReferencePathWithRefAssemblies->WithMetadataValue('NuGetPackageId', 'Microsoft.NETCore.App'));
  69. @(ReferencePathWithRefAssemblies->WithMetadataValue('ReferenceGrouping', 'Microsoft.NETCore.App'));" />
  70. <AspNetCoreReferenceDocXml Include="@(_ResolvedProjectReferencePaths->WithMetadataValue('IsReferenceAssembly', 'false')->'%(RootDir)%(Directory)%(FileName).xml')" />
  71. <RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
  72. <RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
  73. <RefPackContent Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(PackageConflictManifestPackagePath)" />
  74. <_PackageFiles Include="@(RefPackContent)" />
  75. </ItemGroup>
  76. </Target>
  77. <Target Name="GeneratePackageConflictManifest"
  78. DependsOnTargets="ResolveReferences"
  79. Inputs="$(MSBuildAllProjects)"
  80. Outputs="$(TargetDir)$(PackageConflictManifestFileName)">
  81. <ItemGroup>
  82. <_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(NuGetPackageId)|%(NuGetPackageVersion)')" Condition=" '%(ReferencePath.NuGetPackageId)' != 'Microsoft.NETCore.App' AND '%(ReferencePath.NuGetSourceType)' == 'Package' " />
  83. <_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(FileName)|$(SharedFxVersion)')" Condition=" '%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' " />
  84. </ItemGroup>
  85. <WriteLinesToFile
  86. Lines="@(_AspNetCoreAppPackageOverrides)"
  87. File="$(TargetDir)$(PackageConflictManifestFileName)"
  88. Overwrite="true" />
  89. </Target>
  90. <!-- Written to take advantage of target batching in MSBuild. -->
  91. <Target Name="_BatchCopyToLayoutTargetDir"
  92. DependsOnTargets="_ResolveTargetingPackContent"
  93. Inputs="@(RefPackContent)"
  94. Outputs="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')">
  95. <Copy SourceFiles="@(RefPackContent)"
  96. DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')"
  97. UseHardlinksIfPossible="true" />
  98. </Target>
  99. <Target Name="_CreateTargetingPackArchive"
  100. Inputs="@(RefPackContent)"
  101. Outputs="$(ArchiveOutputPath)"
  102. Condition="'$(IsPackable)' != 'false'">
  103. <ZipDirectory
  104. SourceDirectory="$(TargetingPackLayoutRoot)"
  105. DestinationFile="$(ArchiveOutputPath)"
  106. Overwrite="true" />
  107. </Target>
  108. </Project>