Merge pull request #230 from dsplaisted/additional-known-framework-info

Additional information about shared frameworks to bundled versions
This commit is contained in:
Daniel Plaisted 2018-12-31 10:51:25 -08:00 committed by GitHub
commit 8d071f3d19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 94 additions and 1 deletions

View file

@ -18,6 +18,8 @@ function InitializeCustomSDKToolset {
function CreateBuildEnvScript()
{
InitializeBuildTool | Out-Null # Make sure DOTNET_INSTALL_DIR is set
Create-Directory $ArtifactsDir
$scriptPath = Join-Path $ArtifactsDir "core-sdk-build-env.bat"
$scriptContents = @"

View file

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Newtonsoft.Json.Linq;
namespace Microsoft.DotNet.Cli.Build
{
public class GetRuntimePackRids : Task
{
[Required]
public string MetapackagePath { get; set; }
[Output]
public ITaskItem[] AvailableRuntimePackRuntimeIdentifiers { get; set; }
public override bool Execute()
{
string runtimeJsonPath = Path.Combine(MetapackagePath, "runtime.json");
string runtimeJsonContents = File.ReadAllText(runtimeJsonPath);
var runtimeJsonRoot = JObject.Parse(runtimeJsonContents);
string [] runtimeIdentifiers = ((JObject)runtimeJsonRoot["runtimes"]).Properties().Select(p => p.Name).ToArray();
AvailableRuntimePackRuntimeIdentifiers = runtimeIdentifiers.Select(rid => new TaskItem(rid)).ToArray();
return true;
}
}
}

View file

@ -3,6 +3,7 @@
<TargetFrameworks>$(CoreSdkTargetFramework);net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">$(CoreSdkTargetFramework)</TargetFrameworks>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<RootNamespace>Microsoft.DotNet.Cli.Build</RootNamespace>
</PropertyGroup>
<ItemGroup>
@ -12,7 +13,7 @@
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="NuGet.Versioning" Version="4.3.0" />
<PackageReference Include="System.Reflection.Metadata" Version="1.4.2" />
<PackageReference Include="WindowsAzure.Storage" Version="8.4.0"/>
<PackageReference Include="WindowsAzure.Storage" Version="8.4.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">

View file

@ -6,6 +6,7 @@
</PropertyGroup>
<ItemGroup>
<None Include="targets\DownloadPackage.csproj" />
<None Include="targets\LayoutTool.csproj" />
</ItemGroup>

View file

@ -36,5 +36,6 @@
<UsingTask TaskName="Crossgen" AssemblyFile="$(CoreSdkTaskDll)"/>
<UsingTask TaskName="CopyBlobsToLatest" AssemblyFile="$(CoreSdkTaskDll)"/>
<UsingTask TaskName="GenerateChecksums" AssemblyFile="$(CoreSdkTaskDll)"/>
<UsingTask TaskName="GetRuntimePackRids" AssemblyFile="$(CoreSdkTaskDll)"/>
</Project>

View file

@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<ItemGroup>

View file

@ -44,6 +44,47 @@
<_NETCoreSdkIsPreview Condition=" '$(DropSuffix)' != 'true' ">true</_NETCoreSdkIsPreview>
</PropertyGroup>
<!-- Download "metapackages" for each shared framework in order to get the list of runtime identifers
for which there are runtime packs (from the runtime.json in the metapackage) -->
<ItemGroup>
<MetaPackageDownload Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj">
<Properties>
PackageToRestore=Microsoft.NETCore.App;
PackageVersionToRestore=$(MicrosoftNETCoreAppPackageVersion);
TargetFramework=$(TargetFramework)
</Properties>
</MetaPackageDownload>
<MetaPackageDownload Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj">
<Properties>
PackageToRestore=Microsoft.WindowsDesktop.App;
PackageVersionToRestore=$(MicrosoftWindowsDesktopPackageVersion);
TargetFramework=$(TargetFramework)
</Properties>
</MetaPackageDownload>
<MetaPackageDownload Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj">
<Properties>
PackageToRestore=Microsoft.AspNetCore.App;
PackageVersionToRestore=$(MicrosoftAspNetCoreAppPackageVersion);
TargetFramework=$(TargetFramework)
</Properties>
</MetaPackageDownload>
</ItemGroup>
<MSBuild
BuildInParallel="False"
Projects="@(MetaPackageDownload)">
</MSBuild>
<GetRuntimePackRids MetapackagePath="$(NuGetPackageRoot)/microsoft.netcore.app/$(MicrosoftNETCoreAppPackageVersion)">
<Output TaskParameter="AvailableRuntimePackRuntimeIdentifiers" ItemName="NetCoreRuntimePackRids" />
</GetRuntimePackRids>
<GetRuntimePackRids MetapackagePath="$(NuGetPackageRoot)/microsoft.windowsdesktop.app/$(MicrosoftWindowsDesktopPackageVersion)">
<Output TaskParameter="AvailableRuntimePackRuntimeIdentifiers" ItemName="WindowsDesktopRuntimePackRids" />
</GetRuntimePackRids>
<GetRuntimePackRids MetapackagePath="$(NuGetPackageRoot)/microsoft.aspnetcore.app/$(MicrosoftAspNetCoreAppPackageVersion)">
<Output TaskParameter="AvailableRuntimePackRuntimeIdentifiers" ItemName="AspNetCoreRuntimePackRids" />
</GetRuntimePackRids>
<!--
Setting the property to true if patch == 0 and preview == true. SDK will set DefaultNetCorePatchVersion according to this flag.
So that we don't need to manually update the version selection logic between when we ship a final release and when we ship the first patch
@ -151,6 +192,18 @@ Copyright (c) .NET Foundation. All rights reserved.
@(ImplicitPackageVariable->'<ImplicitPackageReferenceVersion Include="%(Identity)" TargetFrameworkVersion="%(TargetFrameworkVersion)" DefaultVersion="%(DefaultVersion)" LatestVersion="%(LatestVersion)"/>', '
')
<KnownFrameworkReference Include="Microsoft.NETCore.App"
TargetFramework="netcoreapp3.0"
RuntimeFrameworkName="Microsoft.NETCore.App"
DefaultRuntimeFrameworkVersion="$(_NETCoreAppPackageVersion)"
LatestRuntimeFrameworkVersion="$(_NETCoreAppPackageVersion)"
TargetingPackName="Microsoft.NETCore.App"
TargetingPackVersion="$(_NETCoreAppPackageVersion)"
AppHostPackNamePattern="runtime.**RID**.Microsoft.NETCore.DotNetAppHost"
AppHostRuntimeIdentifiers="@(NetCoreRuntimePackRids)"
RuntimePackNamePatterns="runtime.**RID**.Microsoft.NETCore.App;runtime.**RID**.Microsoft.NETCore.DotNetHostResolver;runtime.**RID**.Microsoft.NETCore.DotNetHostPolicy"
RuntimePackRuntimeIdentifiers="@(NetCoreRuntimePackRids)"
/>
<KnownFrameworkReference Include="Microsoft.WindowsDesktop.App"
TargetFramework="netcoreapp3.0"
@ -159,6 +212,8 @@ Copyright (c) .NET Foundation. All rights reserved.
LatestRuntimeFrameworkVersion="$(MicrosoftWindowsDesktopPackageVersion)"
TargetingPackName="Microsoft.WindowsDesktop.App"
TargetingPackVersion="$(MicrosoftWindowsDesktopPackageVersion)"
RuntimePackNamePatterns="runtime.**RID**.Microsoft.WindowsDesktop.App"
RuntimePackRuntimeIdentifiers="@(WindowsDesktopRuntimePackRids)"
/>
<KnownFrameworkReference Include="Microsoft.AspNetCore.App"
@ -168,6 +223,8 @@ Copyright (c) .NET Foundation. All rights reserved.
LatestRuntimeFrameworkVersion="$(MicrosoftAspNetCoreAppPackageVersion)"
TargetingPackName="Microsoft.AspNetCore.App"
TargetingPackVersion="$(MicrosoftAspNetCoreAppPackageVersion)"
RuntimePackNamePatterns="runtime.**RID**.Microsoft.AspNetCore.App"
RuntimePackRuntimeIdentifiers="@(AspNetCoreRuntimePackRids)"
/>
</ItemGroup>
</Project>