Fix runtime targeting pack (#11582)

This commit is contained in:
Justin Kotalik 2019-06-26 13:09:08 -07:00 committed by GitHub
parent dab27e7867
commit 785cd9abb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -23,6 +23,10 @@ namespace RepoTasks
[Required]
public string TargetFile { get; set; }
public string ManagedRoot { get; set; } = "";
public string NativeRoot { get; set; } = "";
/// <summary>
/// Extra attributes to place on the root node.
///
@ -46,7 +50,6 @@ namespace RepoTasks
{
Item = item,
Filename = Path.GetFileName(item.ItemSpec),
TargetPath = item.GetMetadata("TargetPath"),
AssemblyName = FileUtilities.GetAssemblyName(item.ItemSpec),
FileVersion = FileUtilities.GetFileVersion(item.ItemSpec),
IsNative = item.GetMetadata("IsNativeImage") == "true",
@ -55,15 +58,14 @@ namespace RepoTasks
.Where(f =>
!f.IsSymbolFile &&
(f.Filename.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || f.IsNative))
.OrderBy(f => f.TargetPath, StringComparer.Ordinal)
.ThenBy(f => f.Filename, StringComparer.Ordinal))
.OrderBy(f => f.Filename, StringComparer.Ordinal))
{
var element = new XElement(
"File",
new XAttribute("Type", f.IsNative ? "Native" : "Managed"),
new XAttribute(
"Path",
Path.Combine(f.TargetPath, f.Filename).Replace('\\', '/')));
Path.Combine(f.IsNative ? NativeRoot : ManagedRoot, f.Filename).Replace('\\', '/')));
if (f.AssemblyName != null)
{

View File

@ -25,6 +25,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<!-- NuGet appends target framework to this value. Example: runtimes/win-x64/lib/netcoreapp3.0/ -->
<BuildOutputTargetFolder>runtimes/$(RuntimeIdentifier)/lib/</BuildOutputTargetFolder>
<!-- We still need the native path to these assets though for the RuntimeList.xml manifest -->
<ManagedAssetsPackagePath>$(BuildOutputTargetFolder)$(DefaultNetCoreTargetFramework)</ManagedAssetsPackagePath>
<!-- Target framework is not append to this because native assets to not have a target framework. -->
<NativeAssetsPackagePath>runtimes/$(RuntimeIdentifier)/native/</NativeAssetsPackagePath>
@ -457,6 +459,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<RepoTasks.CreateFrameworkListFile
Files="@(SharedFxContent)"
TargetFile="$(FrameworkListOutputPath)"
ManagedRoot="$(ManagedAssetsPackagePath)"
NativeRoot="$(NativeAssetsPackagePath)"
RootAttributes="@(FrameworkListRootAttributes)" />
<ItemGroup>