Generate bundled versions

This commit is contained in:
Daniel Plaisted 2018-11-12 11:52:19 -08:00
parent b7e4f06bed
commit 45c3817d65
6 changed files with 61 additions and 15 deletions

View file

@ -9,6 +9,7 @@
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.7.177" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="NuGet.Versioning" Version="4.3.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">

View file

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

View file

@ -31,5 +31,6 @@
<UsingTask TaskName="Chmod" AssemblyFile="$(CoreSdkTaskDll)" />
<UsingTask TaskName="DotNetDebTool" AssemblyFile="$(CoreSdkTaskDll)" />
<UsingTask TaskName="BuildFPMToolPreReqs" AssemblyFile="$(CoreSdkTaskDll)"/>
<UsingTask TaskName="GetUseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion" AssemblyFile="$(CoreSdkTaskDll)"/>
</Project>

View file

@ -1,9 +1,9 @@
<Project>
<Target Name="GenerateMSBuildExtensions"
<Target Name="GenerateBundledVersions"
DependsOnTargets="GenerateBundledVersionsProps;GenerateBundledCliToolsProps" />
<Target Name="GenerateBundledVersionsProps" DependsOnTargets="RunResolvePackageDependencies">
<Target Name="GenerateBundledVersionsProps" DependsOnTargets="RunResolvePackageDependencies;SetupBundledComponents">
<PropertyGroup>
<BundledVersionsPropsFileName>Microsoft.NETCoreSdk.BundledVersions.props</BundledVersionsPropsFileName>
</PropertyGroup>
@ -133,13 +133,15 @@ Copyright (c) .NET Foundation. All rights reserved.
<BundledNETStandardTargetFrameworkVersion>$(_NETStandardTargetFrameworkVersion)</BundledNETStandardTargetFrameworkVersion>
<BundledNETStandardPackageVersion>$(_NETStandardLibraryPackageVersion)</BundledNETStandardPackageVersion>
<BundledNETCorePlatformsPackageVersion>$(_NETCorePlatformsPackageVersion)</BundledNETCorePlatformsPackageVersion>
@(BundledVersionsVariable->'<%(Identity)>%(Value)</%(Identity)>', '%0A ')
@(BundledVersionsVariable->'<%(Identity)>%(Value)</%(Identity)>', '
')
<NETCoreSdkVersion>$(SdkVersion)</NETCoreSdkVersion>
<NETCoreSdkRuntimeIdentifier>$(ProductMonikerRid)</NETCoreSdkRuntimeIdentifier>
<_NETCoreSdkIsPreview>$(_NETCoreSdkIsPreview)</_NETCoreSdkIsPreview>
<AddDotnetfeedProjectSource Condition="'%24(AddDotnetfeedProjectSource)' == ''">%24(_NETCoreSdkIsPreview)</AddDotnetfeedProjectSource>
<RestoreAdditionalProjectSources Condition="'%24(AddDotnetfeedProjectSource)' == 'true'">%24(RestoreAdditionalProjectSources);https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</RestoreAdditionalProjectSources>
<RestoreAdditionalProjectSources Condition="'%24(AddDotnetfeedProjectSource)' == 'true'">%24(RestoreAdditionalProjectSources)%3Bhttps://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</RestoreAdditionalProjectSources>
<RestoreAdditionalProjectSources Condition="'%24(AddDotnetfeedProjectSource)' == 'true'">%24(RestoreAdditionalProjectSources)%3Bhttps://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json</RestoreAdditionalProjectSources>
<!-- Default patch versions for each minor version of ASP.NET Core -->
<DefaultPatchVersionForAspNetCoreAll2_1>$(_DefaultPatchVersionForAspNetCoreAll2_1)</DefaultPatchVersionForAspNetCoreAll2_1>
@ -152,7 +154,8 @@ Copyright (c) .NET Foundation. All rights reserved.
<LatestPatchVersionForNetCore2_1 Condition="'%24(LatestPatchVersionForNetCore2_1)' == ''">2.1.2</LatestPatchVersionForNetCore2_1>
</PropertyGroup>
<ItemGroup>
@(ImplicitPackageVariable->'<ImplicitPackageReferenceVersion Include="%(Identity)" TargetFrameworkVersion="%(TargetFrameworkVersion)" DefaultVersion="%(DefaultVersion)" LatestVersion="%(LatestVersion)"/>', '%0A ')
@(ImplicitPackageVariable->'<ImplicitPackageReferenceVersion Include="%(Identity)" TargetFrameworkVersion="%(TargetFrameworkVersion)" DefaultVersion="%(DefaultVersion)" LatestVersion="%(LatestVersion)"/>', '
')
<KnownFrameworkReference Include="Microsoft.DesktopUI"
@ -183,7 +186,7 @@ Copyright (c) .NET Foundation. All rights reserved.
Overwrite="true" />
</Target>
<Target Name="GenerateBundledCliToolsProps">
<Target Name="GenerateBundledCliToolsProps" DependsOnTargets="SetupBundledComponents">
<PropertyGroup>
<BundledBundledCliToolsPropsFileName>Microsoft.NETCoreSdk.BundledCliTools.props</BundledBundledCliToolsPropsFileName>
</PropertyGroup>

View file

@ -7,6 +7,7 @@
<Target Name="SetupBundledComponents" DependsOnTargets="GetCurrentRuntimeInformation;SetupFileExtensions;SetSdkVersionInfo;SetBuildDefaults">
<PropertyGroup>
<SdkOutputDirectory>$(RedistLayoutPath)sdk\$(SdkVersion)</SdkOutputDirectory>
<CoreSetupBlobRootUrl>https://dotnetcli.azureedge.net/dotnet/</CoreSetupBlobRootUrl>
<DotnetExtensionsBlobRootUrl Condition="'$(DotnetExtensionsBlobRootUrl)' == ''">https://dotnetcli.blob.core.windows.net/dotnet/</DotnetExtensionsBlobRootUrl>
@ -190,17 +191,56 @@
<RemoveDir Directories="$(RedistLayoutPath)" />
<MakeDir Directories="$(RedistLayoutPath)" />
</Target>
<Target Name="ExtractBundledComponents">
<ExtractArchiveToDirectory SourceArchive="%(BundledLayoutComponent.DownloadDestination)"
DestinationDirectory="$(RedistLayoutPath)/%(BundledLayoutComponent.RelativeLayoutPath)" />
</Target>
<Target Name="RetargetTools">
<PropertyGroup>
<ReplacementPattern>"version": ".*"</ReplacementPattern>
<ReplacementString>"version": "$(MicrosoftNETCoreAppPackageVersion)"</ReplacementString>
</PropertyGroup>
<ItemGroup>
<ToolRuntimeConfigPath Include="$(RedistLayoutPath)sdk/$(SdkVersion)/**/*.runtimeconfig.json" />
</ItemGroup>
<ReplaceFileContents
InputFiles="@(ToolRuntimeConfigPath)"
DestinationFiles="@(ToolRuntimeConfigPath)"
ReplacementPatterns="$(ReplacementPattern)"
ReplacementStrings="$(ReplacementString)" />
</Target>
<Target Name="GenerateLayout" DependsOnTargets="DownloadBundledComponents;CleanLayoutPath"
<Target Name="GenerateLayout"
DependsOnTargets="DownloadBundledComponents;
CleanLayoutPath;
ExtractBundledComponents;
GenerateBundledVersions;
RetargetTools"
AfterTargets="Build">
<ExtractArchiveToDirectory SourceArchive="%(BundledLayoutComponent.DownloadDestination)"
DestinationDirectory="$(RedistLayoutPath)/%(BundledLayoutComponent.RelativeLayoutPath)" />
<!-- Create "SDK Internal" layout to create the MSI to bundle -->
<ExtractArchiveToDirectory SourceArchive="%(BundledLayoutComponent.DownloadDestination)"
DestinationDirectory="$(SdkInternalLayoutPath)/%(BundledLayoutComponent.RelativeLayoutPath)"
Condition="'%(BundledLayoutComponent.IncludeInInternalLayout)' == 'true'"/>
</Target>
<Target Name="GenerateInternalLayout"
DependsOnTargets="GenerateLayout"
AfterTargets="Build">
<RemoveDir Directories="$(SdkInternalLayoutPath)" />
<MakeDir Directories="$(SdkInternalLayoutPath)" />
<!-- Create "SDK Internal" layout to create the MSI to bundle -->
<ItemGroup>
<SdkInternalFiles Include="$(RedistLayoutPath)sdk/$(SdkVersion)/**/*.*"/>
</ItemGroup>
<Copy SourceFiles="@(SdkInternalFiles)"
DestinationFolder="$(SdkInternalLayoutPath)sdk/$(SdkVersion)"/>
<!--<ExtractArchiveToDirectory SourceArchive="%(BundledLayoutComponent.DownloadDestination)"
DestinationDirectory="$(SdkInternalLayoutPath)/%(BundledLayoutComponent.RelativeLayoutPath)"
Condition="'%(BundledLayoutComponent.IncludeInInternalLayout)' == 'true'"/>-->
</Target>
</Project>