235 lines
12 KiB
XML
235 lines
12 KiB
XML
<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>
|
|
<!-- 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>` impementation. -->
|
|
<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 implemenation and reference assemblies are versioned differently. We need both to compose the targeting pack with reference assemblies and xml docs. -->
|
|
<MSBuildWarningsAsMessages>MSB3243</MSBuildWarningsAsMessages >
|
|
|
|
<!-- 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>
|
|
<ReferencePlatformManifestOutputPath>$(ArtifactsObjDir)ref\PlatformManifest.txt</ReferencePlatformManifestOutputPath>
|
|
</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>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);
|
|
GeneratePackageConflictManifest;
|
|
_ResolveTargetingPackContent;
|
|
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="_SelectedExtensionsRefAssemblies" />
|
|
</JoinItems>
|
|
|
|
<ItemGroup>
|
|
<AspNetCoreReferenceAssemblyPath
|
|
Include="@(ReferencePathWithRefAssemblies)"
|
|
Exclude="
|
|
@(_SelectedExtensionsRefAssemblies);
|
|
@(ReferencePathWithRefAssemblies->WithMetadataValue('NuGetPackageId', 'Microsoft.NETCore.App.Ref'));
|
|
@(ReferencePathWithRefAssemblies->WithMetadataValue('IsReferenceAssembly', 'false'));
|
|
@(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')" />
|
|
</ItemGroup>
|
|
|
|
<RepoTasks.GenerateSharedFrameworkDepsFile
|
|
DepsFilePath="$(ProjectDepsFilePath)"
|
|
TargetFramework="$(TargetFramework)"
|
|
FrameworkName="$(TargetingPackName)"
|
|
FrameworkVersion="$(ReferencePackSharedFxVersion)"
|
|
References="@(AspNetCoreReferenceAssemblyPath)"
|
|
RuntimeIdentifier="$(TargetRuntimeIdentifier)"
|
|
RuntimePackageName="$(PackageId)"
|
|
PlatformManifestOutputPath="$(ReferencePlatformManifestOutputPath)" />
|
|
|
|
<ItemGroup>
|
|
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
|
|
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
|
|
<RefPackContent Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(ManifestsPackagePath)" />
|
|
<RefPackContent Include="$(ReferencePlatformManifestOutputPath)" PackagePath="$(ManifestsPackagePath)" />
|
|
</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)|$(ReferencePackSharedFxVersion)')" Condition=" '%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' AND '%(ReferencePath.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>
|