Add VSTemplateLocator package

This commit is contained in:
William Li 2020-09-15 21:26:58 -07:00
parent 446388ee4f
commit 0a5da187e0
5 changed files with 82 additions and 1 deletions

View file

@ -58,6 +58,7 @@
<MicrosoftDotNetMSBuildSdkResolverPackageVersion>5.0.100-rc.2.20466.5</MicrosoftDotNetMSBuildSdkResolverPackageVersion>
<MicrosoftNETBuildExtensionsPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftNETBuildExtensionsPackageVersion>
<MicrosoftDotnetToolsetInternalPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftDotnetToolsetInternalPackageVersion>
<MicrosoftDotnetTemplateLocatorPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftDotnetTemplateLocatorPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/corefx -->

View file

@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(CoreSdkTargetFramework)</TargetFramework>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<GenerateDependencyFile>false</GenerateDependencyFile>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateRuntimeCofigurationFiles>false</GenerateRuntimeCofigurationFiles>
<AssemblyName>UNUSED</AssemblyName>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="microsoft.dotnet.templateLocator" Version="$(MicrosoftDotnetTemplateLocatorPackageVersion)" ExcludeAssets="all" GeneratePathProperty="true"/>
<PackageReference Include="runtime.win-x86.Microsoft.NETCore.DotNetHostResolver" Version="$(MicrosoftNETCoreDotNetHostResolverPackageVersion)" ExcludeAssets="all" GeneratePathProperty="true" />
<PackageReference Include="runtime.win-x64.Microsoft.NETCore.DotNetHostResolver" Version="$(MicrosoftNETCoreDotNetHostResolverPackageVersion)" ExcludeAssets="all" GeneratePathProperty="true" />
</ItemGroup>
<Target
Name="GenerateLayout"
Condition=" '$(OS)' == 'Windows_NT' "
BeforeTargets="AfterBuild"
>
<Message Importance="High" Text="$(MSBuildProjectName) -&gt; $(OutputPath)" />
<RemoveDir Directories="$(OutputPath)" />
<MakeDir Directories="$(OutputPath)" />
<ItemGroup>
<_VSTemplateLocatorSrc Include="$(Pkgruntime_win-x86_Microsoft_NETCore_DotNetHostResolver)\runtimes\win-x86\native\hostfxr.dll" Arch="x86\" />
<_VSTemplateLocatorSrc Include="$(Pkgruntime_win-x64_Microsoft_NETCore_DotNetHostResolver)\runtimes\win-x64\native\hostfxr.dll" Arch="x64\" />
<_VSTemplateLocatorSrc Include="$(Pkgmicrosoft_dotnet_templateLocator)\lib\net472\**\*.dll" Arch="" />
<_VSTemplateLocatorDst Include="@(_VSTemplateLocatorSrc->'$(OutputPath)VSTemplateLocator\%(Arch)%(RecursiveDir)%(Filename)%(Extension)')" />
</ItemGroup>
<Copy SourceFiles="@(_VSTemplateLocatorSrc)" DestinationFiles="@(_VSTemplateLocatorDst)" />
</Target>
</Project>

View file

@ -12,6 +12,7 @@
/>
<ProjectReference Include="..\SdkResolver\SdkResolver.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\VSTemplateLocator\VSTemplateLocator.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup>

View file

@ -46,6 +46,10 @@
<SdkMSBuildExtensionsNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.$(FullNugetVersion).nupkg</SdkMSBuildExtensionsNupkgFile>
<SdkMSBuildExtensionsSwrFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.swr</SdkMSBuildExtensionsSwrFile>
<VSTemplateLocatorLayoutPath>$(ArtifactsDir)bin/VSTemplateLocator/Debug</VSTemplateLocatorLayoutPath>
<VSTemplateLocatorNuspecFile>$(MSBuildThisFileDirectory)packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.nuspec</VSTemplateLocatorNuspecFile>
<VSTemplateLocatorNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.$(FullNugetVersion).nupkg</VSTemplateLocatorNupkgFile>
<!-- Temp directory for light command layouts -->
<LightCommandObjDir>$(ArtifactsObjDir)/LightCommandPackages</LightCommandObjDir>
<!-- Directory for the zipped up light command package -->
@ -531,6 +535,23 @@
</Target>
<Target Name="GenerateVSTemplateLocatorNupkg"
DependsOnTargets="GenerateLayout;MsiTargetsSetupInputOutputs"
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' "
Inputs="$(MSBuildExtensionsLayoutDirectory)/**/*;
$(VSTemplateLocatorNuspecFile);
$(GenerateNupkgPowershellScript)"
Outputs="$(VSTemplateLocatorNupkgFile)">
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
'$(ArtifactsDir)' ^
'$(VSTemplateLocatorLayoutPath.TrimEnd('\'))' ^
'$(FullNugetVersion)' ^
'$(VSTemplateLocatorNuspecFile)' ^
'$(VSTemplateLocatorNupkgFile)'" />
</Target>
<Target Name="GenerateMsis"
DependsOnTargets="GenerateLayout;
MsiTargetsSetupInputOutputs;
@ -548,7 +569,8 @@
GenerateSdkPlaceholderNupkg;
GenerateVSToolsNupkg;
GenerateVSToolsResolverNupkg;
GenerateSdkMSBuildExtensionsNupkg"
GenerateSdkMSBuildExtensionsNupkg;
GenerateVSTemplateLocatorNupkg"
Condition=" '$(OS)' == 'Windows_NT' and !$(Architecture.StartsWith('arm')) " />

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>VS.Redist.Common.Net.Core.SDK.VSTemplateLocator</id>
<version>1.0.0</version>
<title>VS.Redist.Common.Net.Core.SDK.VSTemplateLocator</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>https://www.microsoft.com/net/dotnet_library_license.htm</licenseUrl>
<projectUrl>https://github.com/dotnet/core-sdk</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>MSBuild extensions bundled with .NET Core SDK for internal Visual Studio build consumption</description>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
</metadata>
<files>
<file src="$PAYLOAD_FILES$\**\*" />
</files>
</package>