|
1 | 1 | <Project Sdk="Microsoft.Build.NoTargets">
|
2 | 2 |
|
3 | 3 | <PropertyGroup>
|
4 |
| - <TargetFramework>$(SdkTargetFramework)</TargetFramework> |
| 4 | + <TargetFramework>net472</TargetFramework> |
5 | 5 | <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
|
6 |
| - <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> |
7 |
| - <ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild> |
8 |
| - <!-- For product build, this project only builds in the second build pass as it depends on assets other |
| 6 | + <!-- For product build, this project only builds in the second build pass as it depends on assets from other |
9 | 7 | verticals that are built in the first build pass. -->
|
10 | 8 | <ExcludeFromDotNetBuild Condition="'$(DotNetBuildPass)' != '2'">true</ExcludeFromDotNetBuild>
|
| 9 | + <IsPackable Condition="'$(OS)' == 'Windows_NT' and |
| 10 | + '$(Architecture)' == 'x64' and |
| 11 | + '$(PgoInstrument)' != 'true'">true</IsPackable> |
| 12 | + <BeforePack>$(BeforePack);GenerateLayout</BeforePack> |
| 13 | + <PackageId>VS.Redist.Common.Net.Core.SDK.VSTemplateLocator</PackageId> |
| 14 | + <PackageDescription>MSBuild extensions bundled with .NET Core SDK for internal Visual Studio build consumption</PackageDescription> |
| 15 | + <NoWarn>$(NoWarn);NU5100;NU5109;NU5123</NoWarn> |
| 16 | + <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> |
| 17 | + <IsShippingPackage>false</IsShippingPackage> |
11 | 18 | </PropertyGroup>
|
12 | 19 |
|
13 | 20 | <ItemGroup>
|
14 |
| - <PackageReference Include="Microsoft.NETCore.App.Runtime.win-x86" ExcludeAssets="all" GeneratePathProperty="true" /> |
15 |
| - <PackageReference Include="Microsoft.NETCore.App.Runtime.win-x64" ExcludeAssets="all" GeneratePathProperty="true" /> |
16 |
| - <PackageReference Include="Microsoft.NETCore.App.Runtime.win-arm64" ExcludeAssets="all" GeneratePathProperty="true" /> |
17 | 21 | <PackageReference Include="Microsoft.Deployment.DotNet.Releases" ExcludeAssets="all" GeneratePathProperty="true" />
|
18 |
| - </ItemGroup> |
19 |
| - |
20 |
| - <ItemGroup> |
21 | 22 | <ProjectReference Include="$(RepoRoot)src\Microsoft.DotNet.TemplateLocator\Microsoft.DotNet.TemplateLocator.csproj" ReferenceOutputAssembly="false" />
|
22 | 23 | </ItemGroup>
|
23 | 24 |
|
24 |
| - <Target Name="GenerateLayout"> |
25 |
| - <!-- Set these here early enough for inputs & outputs in the GenerateVSTemplateLocatorNupkg target. --> |
26 |
| - <PropertyGroup> |
27 |
| - <VSTemplateLocatorNuspecFile>$(MSBuildThisFileDirectory)VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.nuspec</VSTemplateLocatorNuspecFile> |
28 |
| - <VSTemplateLocatorNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.$(FullNugetVersion).nupkg</VSTemplateLocatorNupkgFile> |
29 |
| - <GenerateNupkgPowershellScript>$(MSBuildThisFileDirectory)../../packaging/windows/generatenupkg.ps1</GenerateNupkgPowershellScript> |
30 |
| - </PropertyGroup> |
31 |
| - |
32 |
| - <RemoveDir Directories="$(OutputPath)" /> |
33 |
| - <MakeDir Directories="$(OutputPath)" /> |
34 |
| - |
| 25 | + <Target Name="GenerateLayout" Condition="'$(IsPackable)' == 'true'" DependsOnTargets="ResolveProjectReferences"> |
35 | 26 | <ItemGroup>
|
36 |
| - <_VSTemplateLocatorSrc Include="$(PkgMicrosoft_NETCore_App_Runtime_win-x86)\runtimes\win-x86\native\hostfxr.dll" Arch="x86\" /> |
37 |
| - <_VSTemplateLocatorSrc Include="$(PkgMicrosoft_NETCore_App_Runtime_win-x64)\runtimes\win-x64\native\hostfxr.dll" Arch="x64\" /> |
38 |
| - <_VSTemplateLocatorSrc Include="$(PkgMicrosoft_NETCore_App_Runtime_win-arm64)\runtimes\win-arm64\native\hostfxr.dll" Arch="arm64\" /> |
39 |
| - <_VSTemplateLocatorSrc Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\Microsoft.DotNet.NativeWrapper.dll" Arch="" /> |
40 |
| - <_VSTemplateLocatorSrc Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\Microsoft.DotNet.SdkResolver.dll" Arch="" /> |
41 |
| - <_VSTemplateLocatorSrc Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\**\Microsoft.DotNet.TemplateLocator*.dll" Arch="" /> |
42 |
| - <_VSTemplateLocatorSrc Include="$(PkgMicrosoft_Deployment_DotNet_Releases)\lib\net452\**\*.dll" Arch="" /> |
43 |
| - <_VSTemplateLocatorDst Include="@(_VSTemplateLocatorSrc->'$(OutputPath)VSTemplateLocator\%(Arch)%(RecursiveDir)%(Filename)%(Extension)')" /> |
44 |
| - </ItemGroup> |
| 27 | + <VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\x86\hostfxr.dll" Arch="x86/" /> |
| 28 | + <VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\x64\hostfxr.dll" Arch="x64/" /> |
| 29 | + <VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\arm64\hostfxr.dll" Arch="arm64/" /> |
45 | 30 |
|
46 |
| - <Copy SourceFiles="@(_VSTemplateLocatorSrc)" DestinationFiles="@(_VSTemplateLocatorDst)" /> |
| 31 | + <VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\Microsoft.DotNet.NativeWrapper.dll" Arch="" /> |
| 32 | + <VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\Microsoft.DotNet.SdkResolver.dll" Arch="" /> |
| 33 | + <VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\**\Microsoft.DotNet.TemplateLocator*.dll" Arch="" /> |
47 | 34 |
|
48 |
| - <Message Importance="High" Text="$(MSBuildProjectName) -> $(OutputPath)" /> |
49 |
| - </Target> |
| 35 | + <VSTemplateLocatorContent Include="$(PkgMicrosoft_Deployment_DotNet_Releases)\lib\net452\**\*.dll" Arch="" /> |
| 36 | + </ItemGroup> |
50 | 37 |
|
51 |
| - <!-- For product build, this only builds in the second build pass as it depends on assets |
52 |
| - from other verticals that are built in the first build pass. --> |
53 |
| - <Target Name="GenerateVSTemplateLocatorNupkg" |
54 |
| - DependsOnTargets="GenerateLayout" |
55 |
| - Condition="'$(OS)' == 'Windows_NT' and |
56 |
| - '$(Architecture)' == 'x64' and |
57 |
| - '$(PgoInstrument)' != 'true' and |
58 |
| - ('$(DotNetBuild)' != 'true' or '$(DotNetBuildPass)' == '2') and |
59 |
| - '$(_SuppressAllTargets)' != 'true'" |
60 |
| - Inputs="$(OutputPath)/**/*; |
61 |
| - $(VSTemplateLocatorNuspecFile); |
62 |
| - $(GenerateNupkgPowershellScript)" |
63 |
| - Outputs="$(VSTemplateLocatorNupkgFile)" |
64 |
| - AfterTargets="Build"> |
65 |
| - <Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^ |
66 |
| - '$(ArtifactsDir)' ^ |
67 |
| - '$(OutputPath.TrimEnd('\'))' ^ |
68 |
| - '$(FullNugetVersion)' ^ |
69 |
| - '$(VSTemplateLocatorNuspecFile)' ^ |
70 |
| - '$(VSTemplateLocatorNupkgFile)'" /> |
| 38 | + <ItemGroup> |
| 39 | + <Content Include="@(VSTemplateLocatorContent)" PackagePath="/VSTemplateLocator/%(Arch)%(RecursiveDir)%(Filename)%(Extension)" /> |
| 40 | + </ItemGroup> |
71 | 41 | </Target>
|
72 | 42 |
|
73 | 43 | </Project>
|
0 commit comments