Include templates in layout

This commit is contained in:
Daniel Plaisted 2018-11-12 15:23:44 -08:00
parent 45c3817d65
commit b1b9dfda09
5 changed files with 24 additions and 3 deletions

View file

@ -53,6 +53,8 @@
$(RestoreSources);
https://dotnet.myget.org/F/msbuild/api/v3/index.json;
https://dotnet.myget.org/F/nuget-build/api/v3/index.json;
https://dotnet.myget.org/F/templating/api/v3/index.json;
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
</RestoreSources>
</PropertyGroup>

View file

@ -10,6 +10,7 @@
<Import Project="targets\Versions.targets" />
<Import Project="targets\SetBuildDefaults.targets" />
<Import Project="targets\Branding.targets" />
<Import Project="targets\BundledTemplates.targets" />
<Import Project="targets\GenerateBundledVersions.targets" />
<Import Project="targets\GenerateLayout.targets" />
<Import Project="targets\FileExtensions.targets" />

View file

@ -12,4 +12,21 @@
<BundledTemplate Include="NUnit3.DotNetNew.Template" Version="$(NUnit3TemplatesVersion)" />
</ItemGroup>
<!-- Restore bundled templates via PackageReference -->
<ItemGroup>
<PackageReference Include="@(BundledTemplate)" />
</ItemGroup>
<ItemGroup>
<BundledTemplate Update="@(BundledTemplate)">
<NupkgPathRelativeToPackageRoot>%(Identity)/%(Version)/%(Identity).%(Version).nupkg</NupkgPathRelativeToPackageRoot>
<RestoredNupkgPath>$(NuGetPackageRoot)$([MSBuild]::ValueOrDefault('%(NupkgPathRelativeToPackageRoot)', '').ToLower())</RestoredNupkgPath>
</BundledTemplate>
</ItemGroup>
<Target Name="LayoutTemplates" DependsOnTargets="SetupBundledComponents">
<Copy SourceFiles="%(BundledTemplate.RestoredNupkgPath)"
DestinationFolder="$(SdkOutputDirectory)Templates/"/>
</Target>
</Project>

View file

@ -181,7 +181,7 @@ Copyright (c) .NET Foundation. All rights reserved.
</BundledVersionsPropsContent>
</PropertyGroup>
<WriteLinesToFile File="$(SdkOutputDirectory)/$(BundledVersionsPropsFileName)"
<WriteLinesToFile File="$(SdkOutputDirectory)$(BundledVersionsPropsFileName)"
Lines="$(BundledVersionsPropsContent)"
Overwrite="true" />
</Target>
@ -214,7 +214,7 @@ Copyright (c) .NET Foundation. All rights reserved.
</BundledBundledCliToolsPropsContent>
</PropertyGroup>
<WriteLinesToFile File="$(SdkOutputDirectory)/$(BundledBundledCliToolsPropsFileName)"
<WriteLinesToFile File="$(SdkOutputDirectory)$(BundledBundledCliToolsPropsFileName)"
Lines="$(BundledBundledCliToolsPropsContent)"
Overwrite="true" />
</Target>

View file

@ -7,7 +7,7 @@
<Target Name="SetupBundledComponents" DependsOnTargets="GetCurrentRuntimeInformation;SetupFileExtensions;SetSdkVersionInfo;SetBuildDefaults">
<PropertyGroup>
<SdkOutputDirectory>$(RedistLayoutPath)sdk\$(SdkVersion)</SdkOutputDirectory>
<SdkOutputDirectory>$(RedistLayoutPath)sdk\$(SdkVersion)\</SdkOutputDirectory>
<CoreSetupBlobRootUrl>https://dotnetcli.azureedge.net/dotnet/</CoreSetupBlobRootUrl>
<DotnetExtensionsBlobRootUrl Condition="'$(DotnetExtensionsBlobRootUrl)' == ''">https://dotnetcli.blob.core.windows.net/dotnet/</DotnetExtensionsBlobRootUrl>
@ -217,6 +217,7 @@
CleanLayoutPath;
ExtractBundledComponents;
GenerateBundledVersions;
LayoutTemplates;
RetargetTools"
AfterTargets="Build">