瀏覽代碼

Fix runtime targeting pack (#11582)

Justin Kotalik 6 年之前
父節點
當前提交
785cd9abb1

+ 6 - 4
eng/tools/RepoTasks/CreateFrameworkListFile.cs

@@ -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)
                 {

+ 4 - 0
src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj

@@ -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>