Skip to content

Additional information about shared frameworks to bundled versions #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/restore-toolset.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @"
Expand Down
30 changes: 30 additions & 0 deletions src/core-sdk-tasks/GetRuntimePackRids.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
3 changes: 2 additions & 1 deletion src/core-sdk-tasks/core-sdk-tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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'">
Expand Down
1 change: 1 addition & 0 deletions src/redist/redist.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</PropertyGroup>

<ItemGroup>
<None Include="targets\DownloadPackage.csproj" />
<None Include="targets\LayoutTool.csproj" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions src/redist/targets/BuildCoreSdkTasks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -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>
1 change: 1 addition & 0 deletions src/redist/targets/DownloadPackage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>

<ItemGroup>
Expand Down
57 changes: 57 additions & 0 deletions src/redist/targets/GenerateBundledVersions.targets
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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>
Expand Down