| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <Project>
- <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
- <PropertyGroup>
- <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
- <IsShippingPackage>true</IsShippingPackage>
- <IsPackable>true</IsPackable>
- <IsPackable Condition="'$(IsTargetingPackBuilding)' == 'false'">false</IsPackable>
- <PackageId>$(TargetingPackName)</PackageId>
- <VersionPrefix>$(TargetingPackVersionPrefix)</VersionPrefix>
- <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>` impementation. -->
- <IsProjectReferenceProvider>false</IsProjectReferenceProvider>
- <PackageConflictManifestFileName>PackageOverrides.txt</PackageConflictManifestFileName>
- <!-- Reference implementation assemblies in addition to ref assemblies to get xml docs -->
- <ReferenceImplementationAssemblies>true</ReferenceImplementationAssemblies>
- </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)" />
- <Reference Include="Microsoft.Internal.Extensions.Refs" Version="$(MicrosoftInternalExtensionsRefsPackageVersion)" IncludeAssets="Build" />
- <!-- 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 Condition="'$(TargetRuntimeIdentifier)' == 'win-x64'">aspnetcore-targeting-pack-$(PackageVersion).zip</ArchiveOutputFileName>
- <ArchiveOutputFileName Condition="'$(TargetRuntimeIdentifier)' == 'linux-x64'">aspnetcore-targeting-pack-$(PackageVersion).tar.gz</ArchiveOutputFileName>
- <ArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName)</ArchiveOutputPath>
- </PropertyGroup>
- <PropertyGroup>
- <!-- If this project won't produce a package, don't bother building anything. -->
- <BuildDependsOn Condition="'$(IsTargetingPackBuilding)' != 'false'">
- $(BuildDependsOn);
- GeneratePackageConflictManifest;
- _ResolveTargetingPackContent;
- _BatchCopyToLayoutTargetDir;
- _InstallTargetingPackIntoLocalDotNet;
- _CreateTargetingPackArchive;
- </BuildDependsOn>
- </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"
- 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="_SelectedExtensionsRefAssemblies" />
- </JoinItems>
- <ItemGroup>
- <AspNetCoreReferenceAssemblyPath
- Include="@(ReferencePathWithRefAssemblies)"
- Exclude="
- @(_SelectedExtensionsRefAssemblies);
- @(ReferencePathWithRefAssemblies->WithMetadataValue('NuGetPackageId', 'Microsoft.NETCore.App'));
- @(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="$(PlatformManifestOutputPath)" PackagePath="$(ManifestsPackagePath)" />
- <_PackageFiles Include="@(RefPackContent)" />
- </ItemGroup>
- </Target>
- <Target Name="GeneratePackageConflictManifest"
- DependsOnTargets="ResolveReferences"
- Inputs="$(MSBuildAllProjects)"
- Outputs="$(TargetDir)$(PackageConflictManifestFileName)">
- <ItemGroup>
- <_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(NuGetPackageId)|%(NuGetPackageVersion)')" Condition=" '%(ReferencePath.NuGetPackageId)' != 'Microsoft.NETCore.App' AND '%(ReferencePath.NuGetSourceType)' == 'Package' " />
- <_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(FileName)|$(SharedFxVersion)')" Condition=" '%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' " />
- </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="$(ArchiveOutputPath)"
- Condition="'$(IsPackable)' == 'true'">
- <ZipDirectory
- SourceDirectory="$(TargetingPackLayoutRoot)"
- DestinationFile="$(ArchiveOutputPath)"
- Overwrite="true"
- Condition="'$(TargetRuntimeIdentifier)' == 'win-x64'" />
- <Exec
- Command="tar -czf $(ArchiveOutputPath) ."
- WorkingDirectory="$(TargetingPackLayoutRoot)"
- Condition="'$(TargetRuntimeIdentifier)' == 'linux-x64'" />
- <Message Importance="High" Text="$(MSBuildProjectName) -> $(ArchiveOutputPath)" />
- </Target>
- </Project>
|