|
| 1 | +<Project Sdk="Microsoft.Build.NoTargets"> |
| 2 | + |
| 3 | + <PropertyGroup> |
| 4 | + <TargetFramework>$(SdkTargetFramework)</TargetFramework> |
| 5 | + <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory> |
| 6 | + <ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild> |
| 7 | + <!-- For product build, this project only builds in the second build pass as it depends on assets other |
| 8 | + verticals that are built in the first build pass. --> |
| 9 | + <ExcludeFromDotNetBuild Condition="'$(DotNetBuildPass)' != '2'">true</ExcludeFromDotNetBuild> |
| 10 | + <!-- For product build, this only builds in the second build pass as it depends on assets |
| 11 | + from other verticals that are built in the first build pass. --> |
| 12 | + <IsPackable Condition="'$(OS)' == 'Windows_NT' and |
| 13 | + '$(Architecture)' == 'x64' and |
| 14 | + '$(PgoInstrument)' != 'true' and |
| 15 | + '$(PackInstaller)' != 'false' and |
| 16 | + ('$(DotNetBuild)' != 'true' or '$(DotNetBuildPass)' == '2')">true</IsPackable> |
| 17 | + <BeforePack>$(BeforePack);GenerateMSBuildExtensionsLayout</BeforePack> |
| 18 | + <PackageDescription>MSBuild extensions bundled with .NET Core SDK for internal Visual Studio build consumption</PackageDescription> |
| 19 | + <PackageId>VS.Redist.Common.Net.Core.SDK.MSBuildExtensions</PackageId> |
| 20 | + <NoWarn>$(NoWarn);NU5100;NU5109;NU5123</NoWarn> |
| 21 | + <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> |
| 22 | + <IsShippingPackage>false</IsShippingPackage> |
| 23 | + </PropertyGroup> |
| 24 | + |
| 25 | + <ItemGroup> |
| 26 | + <PackageDownload Include="NETStandard.Library.NETFramework" Version="[$(NETStandardLibraryNETFrameworkVersion)]" /> |
| 27 | + |
| 28 | + <ProjectReference Include="$(RepoRoot)src\Tasks\Microsoft.NET.Build.Extensions.Tasks\Microsoft.NET.Build.Extensions.Tasks.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" /> |
| 29 | + </ItemGroup> |
| 30 | + |
| 31 | + <!-- SdkResolver --> |
| 32 | + <ItemGroup> |
| 33 | + <PackageDownload Include="Microsoft.Deployment.DotNet.Releases" Version="[$(MicrosoftDeploymentDotNetReleasesVersion)]" /> |
| 34 | + <PackageDownload Include="Microsoft.NETCore.App.Runtime.win-x86" Version="[$(MicrosoftNETCoreAppRuntimePackageVersion)]" /> |
| 35 | + <PackageDownload Include="Microsoft.NETCore.App.Runtime.win-x64" Version="[$(MicrosoftNETCoreAppRuntimePackageVersion)]" /> |
| 36 | + <PackageDownload Include="Microsoft.NETCore.App.Runtime.win-arm64" Version="[$(MicrosoftNETCoreAppRuntimePackageVersion)]" /> |
| 37 | + |
| 38 | + <ProjectReference Include="$(RepoRoot)src\Resolvers\Microsoft.DotNet.MSBuildSdkResolver\Microsoft.DotNet.MSBuildSdkResolver.csproj" ReferenceOutputAssembly="false" /> |
| 39 | + </ItemGroup> |
| 40 | + |
| 41 | + <!-- Shared infra to build and use the BuildCoreSdkTasks --> |
| 42 | + <Import Project="..\..\targets\BuildCoreSdkTasks.targets" /> |
| 43 | + |
| 44 | + <Target Name="GenerateMSBuildExtensionsLayout" DependsOnTargets="BuildCoreSdkTasks;ResolveProjectReferences"> |
| 45 | + <PropertyGroup> |
| 46 | + <MSBuildExtensionsOutputPath>$(ArtifactsBinDir)$(Configuration)\Sdks\Microsoft.NET.Build.Extensions</MSBuildExtensionsOutputPath> |
| 47 | + <SdkMSBuildExtensionsSwrFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.swr</SdkMSBuildExtensionsSwrFile> |
| 48 | + </PropertyGroup> |
| 49 | + |
| 50 | + <ItemGroup> |
| 51 | + <!-- Don't include .NET MS.NET.Build.Extensions tasks in Full Framework MSBuild layout. --> |
| 52 | + <VSMSBuildExtensionsContent Include="$(MSBuildExtensionsOutputPath)\msbuildExtensions\**\*.*" |
| 53 | + Exclude="$(MSBuildExtensionsOutputPath)\msbuildExtensions\Microsoft\Microsoft.NET.Build.Extensions\net*\**; |
| 54 | + $(MSBuildExtensionsOutputPath)\msbuildExtensions\Microsoft\Microsoft.NET.Build.Extensions\tools\net*.*\**" |
| 55 | + DeploymentSubpath="msbuildExtensions/" /> |
| 56 | + |
| 57 | + <!-- Don't include .NET targets in the Full Framework MSBuild layout. --> |
| 58 | + <VSMSBuildExtensionsContent Include="$(MSBuildExtensionsOutputPath)\msbuildExtensions-ver\**\*.*" |
| 59 | + Exclude="$(MSBuildExtensionsOutputPath)\msbuildExtensions-ver\SolutionFile\**" |
| 60 | + DeploymentSubpath="msbuildExtensions-ver/" /> |
| 61 | + |
| 62 | + <VSMSBuildExtensionsContent Include="$(NuGetPackageRoot)netstandard.library.netframework\$(NETStandardLibraryNETFrameworkVersion)\build\**\*.*" |
| 63 | + Exclude="$(NuGetPackageRoot)netstandard.library.netframework\$(NETStandardLibraryNETFrameworkVersion)\build\**\*.props; |
| 64 | + $(NuGetPackageRoot)netstandard.library.netframework\$(NETStandardLibraryNETFrameworkVersion)\build\**\*.targets" |
| 65 | + DeploymentSubpath="msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/" /> |
| 66 | + |
| 67 | + <!-- SdkResolver --> |
| 68 | + <VSMSBuildExtensionsContent Include="$(NuGetPackageRoot)microsoft.deployment.dotNet.releases\$(MicrosoftDeploymentDotNetReleasesVersion)\lib\netstandard2.0\**\*.*" DeploymentSubpath="MSBuildSdkResolver/" /> |
| 69 | + <VSMSBuildExtensionsContent Include="$(NuGetPackageRoot)microsoft.netcore.app.runtime.win-x86\$(MicrosoftNETCoreAppRuntimePackageVersion)\runtimes\win-x86\native\hostfxr.dll" DeploymentSubpath="MSBuildSdkResolver/x86/" /> |
| 70 | + <VSMSBuildExtensionsContent Include="$(NuGetPackageRoot)microsoft.netcore.app.runtime.win-x64\$(MicrosoftNETCoreAppRuntimePackageVersion)\runtimes\win-x64\native\hostfxr.dll" DeploymentSubpath="MSBuildSdkResolver/x64/" /> |
| 71 | + <VSMSBuildExtensionsContent Include="$(NuGetPackageRoot)microsoft.netcore.app.runtime.win-arm64\$(MicrosoftNETCoreAppRuntimePackageVersion)\runtimes\win-arm64\native\hostfxr.dll" DeploymentSubpath="MSBuildSdkResolver/arm64/" /> |
| 72 | + <VSMSBuildExtensionsContent Include="$(ArtifactsBinDir)Microsoft.DotNet.MSBuildSdkResolver\$(Configuration)\net472\**\Microsoft.DotNet.MSBuildSdkResolver*.dll" DeploymentSubpath="MSBuildSdkResolver/" /> |
| 73 | + |
| 74 | + <VSMSBuildExtensionsContent Update="@(VSMSBuildExtensionsContent)"> |
| 75 | + <DestinationPath>$(OutputPath)/%(VSMSBuildExtensionsContent.DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension)</DestinationPath> |
| 76 | + </VSMSBuildExtensionsContent> |
| 77 | + </ItemGroup> |
| 78 | + |
| 79 | + <Copy SourceFiles="@(VSMSBuildExtensionsContent)" DestinationFiles="%(VSMSBuildExtensionsContent.DestinationPath)" /> |
| 80 | + |
| 81 | + <GenerateMSBuildExtensionsSWR MSBuildExtensionsLayoutDirectory="$(OutputPath)" |
| 82 | + OutputFile="$(SdkMSBuildExtensionsSwrFile)" /> |
| 83 | + |
| 84 | + <ItemGroup> |
| 85 | + <!-- Include the swr file in the nuget package for VS authoring --> |
| 86 | + <Content Include="$(SdkMSBuildExtensionsSwrFile)" PackagePath="/" /> |
| 87 | + <Content Include="@(VSMSBuildExtensionsContent)" PackagePath="/%(VSMSBuildExtensionsContent.DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension)" /> |
| 88 | + </ItemGroup> |
| 89 | + </Target> |
| 90 | + |
| 91 | +</Project> |
0 commit comments