Skip to content

Commit 08aeff5

Browse files
committed
Correctly build VSTemplateLocator package
1 parent 6c93e35 commit 08aeff5

9 files changed

+47
-53
lines changed

Directory.Build.targets

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
33
<Project>
4+
45
<ItemGroup>
56
<SupportedPlatform Remove="Android" />
67
<SupportedPlatform Remove="iOS" />
@@ -36,13 +37,18 @@
3637

3738
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
3839

40+
<PropertyGroup>
41+
<FullNugetVersion>$(VersionPrefix)-$(PreReleaseVersionLabel)</FullNugetVersion>
42+
<FullNugetVersion Condition="'$(PreReleaseVersionIteration)' != ''">$(FullNugetVersion).$(PreReleaseVersionIteration)</FullNugetVersion>
43+
<FullNugetVersion Condition=" '$(VersionSuffixDateStamp)' != '' And '$(VersionSuffixBuildOfTheDay)' != '' ">$(FullNugetVersion).$(VersionSuffixDateStamp).$(VersionSuffixBuildOfTheDay)</FullNugetVersion>
44+
</PropertyGroup>
45+
3946
<!-- Optionally override arcade's test target with one which will run the tests as tools.
4047
Conditionally overriding a target requires a conditional import of another (.targets)
4148
file. -->
4249
<Import Project="OverrideTest.targets"
4350
Condition="'$(RunTestsAsTool)' == 'true' And '$(CanRunTestAsTool)' == 'true'"/>
4451

45-
4652
<!-- Update KnownFrameworkReferences to target the right version of the runtime -->
4753
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'
4854
and $(MicrosoftNETCoreAppRefPackageVersion.StartsWith('$(_TargetFrameworkVersionWithoutV)'))

eng/Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<!-- For product build, build SdkResolver and VSTemplateLocator only in the second build pass as they depend on
1111
assets from other verticals that are built in the first build pass. -->
1212
<ProjectToBuild Include="$(RepoRoot)src\Installer\redist-installer\projects\SdkResolver.csproj" DotNetBuildPass="2" />
13-
<ProjectToBuild Include="$(RepoRoot)src\Installer\redist-installer\projects\VSTemplateLocator.csproj" DotNetBuildPass="2" />
13+
<ProjectToBuild Include="$(RepoRoot)src\Installer\redist-installer\projects\VSTemplateLocator\VSTemplateLocator.csproj" DotNetBuildPass="2" />
1414
</ItemGroup>
1515

1616
</Project>

sdk.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "redist-installer", "src\Ins
500500
EndProject
501501
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SdkResolver", "src\Installer\redist-installer\projects\SdkResolver.csproj", "{27E399C0-6F91-45D6-A63D-041DA41CCFDF}"
502502
EndProject
503-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VSTemplateLocator", "src\Installer\redist-installer\projects\VSTemplateLocator.csproj", "{0CBA5FB8-71A3-457A-89F3-E52B9602164A}"
503+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VSTemplateLocator", "src\Installer\redist-installer\projects\VSTemplateLocator\VSTemplateLocator.csproj", "{0CBA5FB8-71A3-457A-89F3-E52B9602164A}"
504504
EndProject
505505
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "core-sdk-tasks.Tests", "test\core-sdk-tasks.Tests\core-sdk-tasks.Tests.csproj", "{21C21975-84C1-4A24-8E21-F7EC790A4584}"
506506
EndProject

src/Installer/redist-installer/projects/VSTemplateLocator.csproj renamed to src/Installer/redist-installer/projects/VSTemplateLocator/VSTemplateLocator.csproj

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
<Project Sdk="Microsoft.Build.NoTargets/3.7.0">
1+
<Project Sdk="Microsoft.Build.NoTargets">
22

33
<PropertyGroup>
44
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
55
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
6-
<GenerateDependencyFile>false</GenerateDependencyFile>
76
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
8-
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
7+
8+
<VSTemplateLocatorNuspecFile>$(MSBuildThisFileDirectory)VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.nuspec</VSTemplateLocatorNuspecFile>
9+
<VSTemplateLocatorNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.$(FullNugetVersion).nupkg</VSTemplateLocatorNupkgFile>
10+
911
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
1012
<!-- For product build, this project only builds in the second build pass as it depends on assets other
1113
verticals that are built in the first build pass. -->
@@ -23,11 +25,7 @@
2325
<ProjectReference Include="$(RepoRoot)src\Microsoft.DotNet.TemplateLocator\Microsoft.DotNet.TemplateLocator.csproj" ReferenceOutputAssembly="false" />
2426
</ItemGroup>
2527

26-
<Target Name="GenerateLayout"
27-
Condition="'$(OS)' == 'Windows_NT' and '$(_SuppressAllTargets)' != 'true'"
28-
BeforeTargets="AfterBuild">
29-
<Message Importance="High" Text="$(MSBuildProjectName) -&gt; $(OutputPath)" />
30-
28+
<Target Name="GenerateLayout">
3129
<RemoveDir Directories="$(OutputPath)" />
3230
<MakeDir Directories="$(OutputPath)" />
3331

@@ -43,6 +41,30 @@
4341
</ItemGroup>
4442

4543
<Copy SourceFiles="@(_VSTemplateLocatorSrc)" DestinationFiles="@(_VSTemplateLocatorDst)" />
44+
45+
<Message Importance="High" Text="$(MSBuildProjectName) -&gt; $(OutputPath)" />
46+
</Target>
47+
48+
<!-- For product build, this only builds in the second build pass as it depends on assets
49+
from other verticals that are built in the first build pass. -->
50+
<Target Name="GenerateVSTemplateLocatorNupkg"
51+
DependsOnTargets="GenerateLayout"
52+
Condition="'$(OS)' == 'Windows_NT' and
53+
'$(Architecture)' == 'x64' and
54+
'$(PgoInstrument)' != 'true' and
55+
('$(DotNetBuild)' != 'true' or '$(DotNetBuildPass)' == '2') and
56+
'$(_SuppressAllTargets)' != 'true'"
57+
Inputs="$(OutputPath)/**/*;
58+
$(VSTemplateLocatorNuspecFile);
59+
$(GenerateNupkgPowershellScript)"
60+
Outputs="$(VSTemplateLocatorNupkgFile)"
61+
AfterTargets="Build">
62+
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
63+
'$(ArtifactsDir)' ^
64+
'$(OutputPath.TrimEnd('\'))' ^
65+
'$(FullNugetVersion)' ^
66+
'$(VSTemplateLocatorNuspecFile)' ^
67+
'$(VSTemplateLocatorNupkgFile)'" />
4668
</Target>
4769

4870
</Project>

src/Installer/redist-installer/redist-installer.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
<ProjectReference Include="$(RepoRoot)template_feed\*\*.csproj" ReferenceOutputAssembly="false" />
2222
</ItemGroup>
2323

24-
<!-- For product build, this only builds in the second build pass as it depends on SdkResolver and VSTemplateLocator
24+
<!-- For product build, this only builds in the second build pass as it depends on SdkResolver
2525
which need assets from other verticals that are built in the first build pass. -->
2626
<ItemGroup Condition="'$(DotNetBuild)' != 'true' or '$(ExcludeFromDotNetBuild)' != 'true'">
2727
<ProjectReference Include="projects\SdkResolver.csproj" ReferenceOutputAssembly="false" />
28-
<ProjectReference Include="projects\VSTemplateLocator.csproj" ReferenceOutputAssembly="false" />
2928
</ItemGroup>
3029

3130
<ItemGroup>
@@ -35,7 +34,6 @@
3534
<Import Project="targets\BuildCoreSdkTasks.targets" />
3635
<Import Project="targets\GetRuntimeInformation.targets" />
3736
<Import Project="targets\SetBuildDefaults.targets" />
38-
<Import Project="targets\Versions.targets" />
3937
<Import Project="targets\Branding.targets" />
4038
<Import Project="targets\BundledTemplates.targets" />
4139
<Import Project="targets\BundledManifests.targets" />

src/Installer/redist-installer/targets/GenerateLayout.targets

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@
511511
</Target>
512512

513513
<Target Name="GenerateVersionFile"
514-
DependsOnTargets="SetupBundledComponents;GenerateFullNuGetVersion">
514+
DependsOnTargets="SetupBundledComponents">
515515
<WriteLinesToFile File="$(SdkOutputDirectory).version"
516516
Lines="$(SourceRevisionId);$(Version);$(Rid);$(FullNugetVersion);$(SdkFeatureBand)"
517517
Overwrite="true" />
@@ -611,7 +611,6 @@
611611
DependsOnTargets="DownloadBundledComponents;
612612
CleanLayoutPath;
613613
LayoutBundledComponents;
614-
GenerateFullNuGetVersion;
615614
GenerateVersionFile;
616615
CopyKnownWorkloadManifestFile;
617616
GenerateBundledVersions;

src/Installer/redist-installer/targets/GenerateMSIs.targets

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
<SdkMSBuildExtensionsNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.$(FullNugetVersion).nupkg</SdkMSBuildExtensionsNupkgFile>
3434
<SdkMSBuildExtensionsSwrFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.swr</SdkMSBuildExtensionsSwrFile>
3535

36-
<VSTemplateLocatorLayoutPath>$(ArtifactsDir)bin/VSTemplateLocator/$(Configuration)</VSTemplateLocatorLayoutPath>
37-
<VSTemplateLocatorNuspecFile>$(SdkPkgSourcesRootDirectory)/VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.nuspec</VSTemplateLocatorNuspecFile>
38-
<VSTemplateLocatorNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.$(FullNugetVersion).nupkg</VSTemplateLocatorNupkgFile>
39-
4036
<!-- Temp directory for light command layouts -->
4137
<LightCommandObjDir>$(ArtifactsObjDir)/LightCommandPackages</LightCommandObjDir>
4238
<!-- Directory for the zipped up light command package -->
@@ -440,12 +436,14 @@
440436
</ItemGroup>
441437
</Target>
442438

439+
<!-- For product build, this only builds in the second build pass as it depends on assets
440+
from other verticals that are built in the first build pass. -->
443441
<Target Name="GenerateSdkMSBuildExtensionsNupkg"
444442
DependsOnTargets="GenerateLayout;GenerateMSBuildExtensions;MsiTargetsSetupInputOutputs"
445-
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' "
443+
Condition="'$(OS)' == 'Windows_NT' and '$(Architecture)' == 'x64' and ('$(DotNetBuild)' != 'true' or '$(DotNetBuildPass)' == '2')"
446444
Inputs="$(MSBuildExtensionsLayoutDirectory)/**/*;
447-
$(SdkMSBuildExtensionsNuspecFile);
448-
$(GenerateNupkgPowershellScript)"
445+
$(SdkMSBuildExtensionsNuspecFile);
446+
$(GenerateNupkgPowershellScript)"
449447
Outputs="$(SdkMSBuildExtensionsNupkgFile);$(SdkMSBuildExtensionsSwrFile)">
450448
<GenerateMSBuildExtensionsSWR MSBuildExtensionsLayoutDirectory="$(MSBuildExtensionsLayoutDirectory)"
451449
OutputFile="$(SdkMSBuildExtensionsSwrFile)" />
@@ -461,23 +459,6 @@
461459
'$(SdkMSBuildExtensionsNupkgFile)'" />
462460
</Target>
463461

464-
<!-- For product build, this only builds in the second build pass as it depends on assets
465-
from other verticals that are built in the first build pass. -->
466-
<Target Name="GenerateVSTemplateLocatorNupkg"
467-
DependsOnTargets="GenerateLayout;MsiTargetsSetupInputOutputs"
468-
Condition="'$(OS)' == 'Windows_NT' and '$(Architecture)' == 'x64' and ('$(DotNetBuild)' != 'true' or '$(DotNetBuildPass)' == '2')"
469-
Inputs="$(MSBuildExtensionsLayoutDirectory)/**/*;
470-
$(VSTemplateLocatorNuspecFile);
471-
$(GenerateNupkgPowershellScript)"
472-
Outputs="$(VSTemplateLocatorNupkgFile)">
473-
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
474-
'$(ArtifactsDir)' ^
475-
'$(VSTemplateLocatorLayoutPath.TrimEnd('\'))' ^
476-
'$(FullNugetVersion)' ^
477-
'$(VSTemplateLocatorNuspecFile)' ^
478-
'$(VSTemplateLocatorNupkgFile)'" />
479-
</Target>
480-
481462
<Target Name="GenerateMsis"
482463
DependsOnTargets="GenerateLayout;
483464
MsiTargetsSetupInputOutputs;
@@ -489,8 +470,7 @@
489470
GenerateToolsetNupkg;
490471
GenerateTemplatesNupkgs;
491472
GenerateSdkPlaceholderNupkg;
492-
GenerateSdkMSBuildExtensionsNupkg;
493-
GenerateVSTemplateLocatorNupkg"
473+
GenerateSdkMSBuildExtensionsNupkg"
494474
Condition=" '$(OS)' == 'Windows_NT' and '$(Architecture)' != 'arm' " />
495475

496476
</Project>

src/Installer/redist-installer/targets/Versions.targets

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)