Bläddra i källkod

Flatten the dependency graph of Microsoft.AspNetCore.App (#4061)

This changes the way Microsoft.AspNetCore.App works to follow patterns set by Microsoft.NETCore.App. Instead of being a metapackage with dozens of dependencies, this package has no dependencies. It uses RID-splitting to deliver standalone assets for self-contained deployments.

Changes:
* Implements RID-split packages for Microsoft.AspNetCore.App.
* Update shared fx deps.json generation to only include entries for the RID-specific metapackages
* Include platform-specific packages in publish output
* Remove all nuspec dependencies of Microsoft.AspNetCore.App and collect all references into the package.
Nate McMaster 7 år sedan
förälder
incheckning
0e12274a8e
40 ändrade filer med 326 tillägg och 467 borttagningar
  1. 1 1
      .azure/pipelines/jobs/default-build.yml
  2. 0 1
      Directory.Build.props
  3. 0 1
      Directory.Build.targets
  4. 6 1
      build/Publish.targets
  5. 1 1
      build/SharedFx.targets
  6. 1 1
      build/artifacts.props
  7. 1 1
      build/dependencies.props
  8. 61 54
      build/tasks/ProcessSharedFrameworkDeps.cs
  9. 0 1
      build/tasks/RepoTasks.tasks
  10. 0 68
      build/tasks/ResolveVersionRange.cs
  11. 1 2
      build/tasks/Utilities/RuntimeGraphManager.cs
  12. 0 86
      build/tasks/Utilities/RuntimeReference.cs
  13. 0 36
      eng/targets/SharedFx.Common.props
  14. 0 20
      src/Framework/Directory.Build.props
  15. 0 29
      src/Framework/Directory.Build.targets
  16. 0 51
      src/Framework/Metapackage.targets
  17. 1 1
      src/Framework/Microsoft.AspNetCore.App.props
  18. 0 26
      src/Framework/Microsoft.AspNetCore.App/pkg/Microsoft.AspNetCore.App.pkgproj
  19. 0 21
      src/Framework/Microsoft.AspNetCore.App/pkg/build/netcoreapp3.0/Microsoft.AspNetCore.App.props
  20. 0 18
      src/Framework/Microsoft.AspNetCore.App/pkg/build/netcoreapp3.0/Microsoft.AspNetCore.App.targets
  21. 0 20
      src/Framework/Microsoft.AspNetCore.App/src/Microsoft.AspNetCore.App.shfxproj
  22. 72 0
      src/Framework/pkg/Metapackage.targets
  23. 30 0
      src/Framework/pkg/Microsoft.AspNetCore.App.pkgproj
  24. 7 0
      src/Framework/pkg/Microsoft.AspNetCore.App.targets
  25. 0 0
      src/Framework/pkg/_._
  26. 64 0
      src/Framework/src/Microsoft.AspNetCore.App.shfxproj
  27. 31 19
      src/Framework/src/SharedFx.targets
  28. 0 0
      src/Framework/src/_._
  29. 0 0
      src/Framework/src/runtime.fx.nuspec
  30. 0 0
      src/Framework/test/AssertEx.cs
  31. 1 1
      src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj
  32. 44 3
      src/Framework/test/SharedFxTests.cs
  33. 0 0
      src/Framework/test/TestData.cs
  34. 0 0
      src/Framework/test/TestDataAttribute.cs
  35. 1 1
      src/Installers/Archive/Archive.Internal.zipproj
  36. 1 1
      src/Installers/Archive/Archive.Redist.zipproj
  37. 1 1
      src/Installers/Debian/Runtime.debproj
  38. 1 1
      src/Installers/Rpm/Rpm.props
  39. 0 0
      src/Packages/Microsoft.AspNetCore.All/lib/netcoreapp3.0/_._
  40. 0 0
      src/Packages/Microsoft.AspNetCore.App/lib/netcoreapp3.0/_._

+ 1 - 1
.azure/pipelines/jobs/default-build.yml

@@ -63,7 +63,7 @@ jobs:
 - job: ${{ coalesce(parameters.jobName, parameters.agentOs) }}
   displayName: ${{ coalesce(parameters.jobDisplayName, parameters.agentOs) }}
   dependsOn: ${{ parameters.dependsOn }}
-  timeoutInMinutes: 90
+  timeoutInMinutes: 120
   workspace:
     clean: all
   strategy:

+ 0 - 1
Directory.Build.props

@@ -97,7 +97,6 @@
   <Import Project="eng\targets\RuntimeIdentifiers.props" />
   <Import Project="eng\targets\Cpp.Common.props"  Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />
   <Import Project="eng\targets\CSharp.Common.props"  Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
-  <Import Project="eng\targets\SharedFx.Common.props"  Condition="'$(MSBuildProjectExtension)' == '.shfxproj'" />
   <Import Project="eng\targets\Wix.Common.props"  Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
 
 </Project>

+ 0 - 1
Directory.Build.targets

@@ -54,6 +54,5 @@
 
   <Import Project="eng\targets\Cpp.Common.targets"  Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />
   <Import Project="eng\targets\CSharp.Common.targets"  Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
-  <Import Project="eng\targets\SharedFx.Common.targets"  Condition="'$(MSBuildProjectExtension)' == '.shfxproj'" />
   <Import Project="eng\targets\Wix.Common.targets"  Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
 </Project>

+ 6 - 1
build/Publish.targets

@@ -58,7 +58,7 @@
       Value="$(PackageVersion)" />
   </Target>
 
-  <Target Name="GetFilesToPublish" DependsOnTargets="GetArtifactInfo;GeneratePublishFiles">
+  <Target Name="GetFilesToPublish" DependsOnTargets="GetAllRidPackages;GetArtifactInfo;GeneratePublishFiles">
     <PropertyGroup>
       <BlobBasePath>aspnetcore/Runtime/$(PackageVersion)/</BlobBasePath>
       <NpmBlobBasePath>aspnetcore/npm/</NpmBlobBasePath>
@@ -175,6 +175,11 @@
       <Output TaskParameter="JoinResult" ItemName="_PackageArtifactInfoWithCategory" />
     </RepoTasks.JoinItems>
 
+    <ItemGroup>
+      <_RidSpecificPackages Include="$(SupportedRuntimeIdentifiers)" Exclude="$(SharedFxRid)" />
+      <PackageToPublish Include="$(DependencyPackagesDir)runtime.%(_RidSpecificPackages.Identity).Microsoft.AspNetCore.App.$(SharedFxVersion).nupkg" Category="ship" />
+    </ItemGroup>
+
     <ItemGroup>
       <PackageToPublish Include="%(_PackageArtifactInfoWithCategory.ArtifactPath)" Category="%(_PackageArtifactInfoWithCategory.Category)" />
       <PackageToPublish Include="%(_PackageArtifactInfo.ArtifactPath)" Category="%(_PackageArtifactInfo.Category)" Condition="'%(_PackageArtifactInfo.Category)' != ''" />

+ 1 - 1
build/SharedFx.targets

@@ -1,6 +1,6 @@
 <Project>
   <PropertyGroup>
-    <UnitTestFxProject>$(RepositoryRoot)src\Framework\Framework.UnitTests\Framework.UnitTests.csproj</UnitTestFxProject>
+    <UnitTestFxProject>$(RepositoryRoot)src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj</UnitTestFxProject>
     <UnitTestFxProject>$([MSBuild]::NormalizePath($(UnitTestFxProject)))</UnitTestFxProject>
     <CodeSignDependsOn Condition="'$(_ProjectsOnly)' != 'true'">$(CodeSignDependsOn);GetSharedFxFilesToSign</CodeSignDependsOn>
     <BuildSharedFxDependsOn>_BuildSharedFxProjects;TestSharedFx</BuildSharedFxDependsOn>

+ 1 - 1
build/artifacts.props

@@ -23,7 +23,7 @@
     <PackageArtifact Include="Microsoft.AspNet.Identity.AspNetCoreCompat" Category="noship" />
     <PackageArtifact Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Category="noship" />
     <PackageArtifact Include="Microsoft.AspNetCore.App" Category="ship" />
-    <PackageArtifact Include="runtime.$(SharedFxRid).Microsoft.AspNetCore.App" Category="noship" />
+    <PackageArtifact Include="runtime.$(SharedFxRid).Microsoft.AspNetCore.App" Category="ship" />
     <PackageArtifact Include="Microsoft.AspNetCore.Antiforgery" Category="ship" />
     <PackageArtifact Include="Microsoft.AspNetCore.ApplicationInsights.HostingStartup" Category="ship" />
     <PackageArtifact Include="Microsoft.AspNetCore.AspNetCoreModule" Category="noship" Condition=" '$(OS)' == 'Windows_NT' " />

+ 1 - 1
build/dependencies.props

@@ -142,7 +142,7 @@
 
     <CastleCorePackageVersion>4.2.1</CastleCorePackageVersion>
     <DevDependency_MicrosoftDotNetBuildTasksFeedPackageVersion>2.2.0-preview1-03124-01</DevDependency_MicrosoftDotNetBuildTasksFeedPackageVersion>
-    <DevDependency_MicrosoftExtensionsDependencyModelPackageVersion>2.0.0</DevDependency_MicrosoftExtensionsDependencyModelPackageVersion>
+    <DevDependency_MicrosoftExtensionsDependencyModelPackageVersion>2.1.0</DevDependency_MicrosoftExtensionsDependencyModelPackageVersion>
     <DevDependency_WindowsAzureStoragePackageVersion>8.7.0</DevDependency_WindowsAzureStoragePackageVersion>
     <FSharpCorePackageVersion>4.2.1</FSharpCorePackageVersion>
     <IdentityServer4PackageVersion>2.3.0-preview1-update2</IdentityServer4PackageVersion>

+ 61 - 54
build/tasks/ProcessSharedFrameworkDeps.cs

@@ -1,12 +1,10 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-// Sourced from  https://github.com/dotnet/core-setup/tree/be8d8e3486b2bf598ed69d39b1629a24caaba45e/tools-local/tasks, needs to be kept in sync
 
 using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
-using System.Security.Cryptography;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
 using Microsoft.Extensions.DependencyModel;
@@ -28,21 +26,22 @@ namespace RepoTasks
         public string OutputPath { get; set; }
 
         [Required]
-        public string FrameworkName { get; set; }
+        public string TargetFramework { get; set; }
 
-        // When generating the .deps.json file, these files are used to replace "project" libraries with "packages".
-        public ITaskItem[] ResolvedPackageProjectReferences { get; set; }
+        [Required]
+        public string FrameworkName { get; set; }
 
-        public string[] PackagesToRemove { get; set; }
+        [Required]
+        public string FrameworkVersion { get; set; }
 
         [Required]
-        public string Runtime { get; set; }
+        public string BaseRuntimeIdentifier { get; set; }
 
         public override bool Execute()
         {
             ExecuteCore();
 
-            return true;
+            return !Log.HasLoggedErrors;
         }
 
         private void ExecuteCore()
@@ -61,23 +60,69 @@ namespace RepoTasks
 
             var manager = new RuntimeGraphManager();
             var graph = manager.Collect(lockFile);
-            var expandedGraph = manager.Expand(graph, Runtime);
-
-            // Remove the runtime entry for the project which generates the original deps.json. For example, there is no Microsoft.AspNetCore.App.dll.
-            var trimmedRuntimeLibraries = RuntimeReference.RemoveSharedFxRuntimeEntry(context.RuntimeLibraries, FrameworkName);
+            var expandedGraph = manager.Expand(graph, BaseRuntimeIdentifier);
 
-            trimmedRuntimeLibraries = ResolveProjectsAsPackages(ResolvedPackageProjectReferences, trimmedRuntimeLibraries);
+            var runtimeFiles = new List<RuntimeFile>();
+            var nativeFiles = new List<RuntimeFile>();
+            var resourceAssemblies = new List<ResourceAssembly>();
 
-            if (PackagesToRemove != null && PackagesToRemove.Any())
+            foreach (var library in context.RuntimeLibraries)
             {
-                trimmedRuntimeLibraries = RuntimeReference.RemoveReferences(trimmedRuntimeLibraries, PackagesToRemove);
+                foreach (var file in library.RuntimeAssemblyGroups.SelectMany(g => g.RuntimeFiles))
+                {
+                    var path = $"runtimes/{context.Target.Runtime}/lib/{TargetFramework}/{Path.GetFileName(file.Path)}";
+                    runtimeFiles.Add(
+                        new RuntimeFile(
+                            path,
+                            file.AssemblyVersion,
+                            file.FileVersion));
+                }
+
+                foreach (var file in library.NativeLibraryGroups.SelectMany(g => g.RuntimeFiles))
+                {
+                    var path = $"runtimes/{context.Target.Runtime}/native/{Path.GetFileName(file.Path)}";
+                    nativeFiles.Add(
+                        new RuntimeFile(
+                            path,
+                            file.AssemblyVersion,
+                            file.FileVersion));
+                }
+
+                resourceAssemblies.AddRange(
+                    library.ResourceAssemblies);
             }
 
+            var runtimePackageName = $"runtime.{context.Target.Runtime}.{FrameworkName}";
+
+            var runtimeLibrary = new RuntimeLibrary("package",
+                runtimePackageName,
+                FrameworkVersion,
+                string.Empty,
+                new[] { new RuntimeAssetGroup(string.Empty, runtimeFiles) },
+                new[] { new RuntimeAssetGroup(string.Empty, nativeFiles) },
+                resourceAssemblies,
+                Array.Empty<Dependency>(),
+                hashPath: null,
+                path: $"{runtimePackageName.ToLowerInvariant()}/{FrameworkVersion}",
+                serviceable: true);
+
+            var targetingPackLibrary = new RuntimeLibrary("package",
+                FrameworkName,
+                FrameworkVersion,
+                string.Empty,
+                Array.Empty<RuntimeAssetGroup>(),
+                Array.Empty<RuntimeAssetGroup>(),
+                resourceAssemblies,
+                new[] { new Dependency(runtimeLibrary.Name, runtimeLibrary.Version) },
+                hashPath: null,
+                path: $"{FrameworkName.ToLowerInvariant()}/{FrameworkVersion}",
+                serviceable: true);
+
             context = new DependencyContext(
                 context.Target,
                 CompilationOptions.Default,
                 Array.Empty<CompilationLibrary>(),
-                trimmedRuntimeLibraries,
+                new[] { targetingPackLibrary, runtimeLibrary },
                 expandedGraph
                 );
 
@@ -86,43 +131,5 @@ namespace RepoTasks
                 new DependencyContextWriter().Write(context, depsStream);
             }
         }
-
-        private IEnumerable<RuntimeLibrary> ResolveProjectsAsPackages(ITaskItem[] resolvedProjects, IEnumerable<RuntimeLibrary> compilationLibraries)
-        {
-            var projects = resolvedProjects.ToDictionary(k => k.GetMetadata("PackageId"), k => k, StringComparer.OrdinalIgnoreCase);
-
-            foreach (var library in compilationLibraries)
-            {
-                if (projects.TryGetValue(library.Name, out var project))
-                {
-                    Log.LogMessage("Replacing the library entry for {0}", library.Name);
-
-                    var packagePath = project.ItemSpec;
-                    var packageId = library.Name;
-                    var version = library.Version;
-                    string packageHash;
-                    using (var sha512 = SHA512.Create())
-                    {
-                        packageHash = "sha512-" + sha512.ComputeHashAsBase64(File.OpenRead(packagePath), leaveStreamOpen: false);
-                    }
-
-                    yield return new RuntimeLibrary("package",
-                        library.Name,
-                        library.Version,
-                        packageHash,
-                        library.RuntimeAssemblyGroups,
-                        library.NativeLibraryGroups,
-                        library.ResourceAssemblies,
-                        library.Dependencies,
-                        serviceable: true,
-                        path: $"{library.Name}/{library.Version}".ToLowerInvariant(),
-                        hashPath: $"{library.Name}.{library.Version}.nupkg.sha512".ToLowerInvariant());
-                }
-                else
-                {
-                    yield return library;
-                }
-            }
-        }
     }
 }

+ 0 - 1
build/tasks/RepoTasks.tasks

@@ -11,7 +11,6 @@
   <UsingTask TaskName="RepoTasks.JoinItems" AssemblyFile="$(_RepoTaskAssembly)" />
   <UsingTask TaskName="RepoTasks.OrderBy" AssemblyFile="$(_RepoTaskAssembly)" />
   <UsingTask TaskName="RepoTasks.ProcessSharedFrameworkDeps" AssemblyFile="$(_RepoTaskAssembly)" />
-  <UsingTask TaskName="RepoTasks.ResolveVersionRange" AssemblyFile="$(_RepoTaskAssembly)" />
   <UsingTask TaskName="RepoTasks.PublishToAzureBlob" AssemblyFile="$(_RepoTaskAssembly)" />
 
   <!-- tools from dotnet-buildtools -->

+ 0 - 68
build/tasks/ResolveVersionRange.cs

@@ -1,68 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-using NuGet.Versioning;
-using RepoTasks.Utilities;
-
-namespace RepoTasks
-{
-    public class ResolveVersionRange : Task
-    {
-        [Required]
-        [Output]
-        public ITaskItem[] Items { get; set; }
-
-        [Required]
-        public string Version { get; set; }
-
-        [Required]
-        public string RangeType { get; set; }
-
-        // MSBuild doesn't allow binding to enums directly.
-        private enum VersionRangeType
-        {
-            Minimum, // [1.1.1, )
-            MajorMinor, // [1.1.1, 1.2.0)
-        }
-
-        public override bool Execute()
-        {
-            if (!Enum.TryParse<VersionRangeType>(RangeType, out var rangeType))
-            {
-                Log.LogError("Unexpected value {0} for RangeType", RangeType);
-                return false;
-            }
-
-            var versionRange = GetVersionRange(rangeType, Version);
-
-            foreach (var item in Items)
-            {
-                item.SetMetadata("_OriginalVersion", Version);
-                item.SetMetadata("Version", versionRange);
-            }
-
-            return !Log.HasLoggedErrors;
-        }
-
-        private string GetVersionRange(VersionRangeType rangeType, string packageVersion)
-        {
-            switch (rangeType)
-            {
-                case VersionRangeType.MajorMinor:
-                    if (!NuGetVersion.TryParse(packageVersion, out var nugetVersion))
-                    {
-                        Log.LogError("Invalid NuGet version '{0}'", packageVersion);
-                        return null;
-                    }
-                    return $"[{packageVersion}, {nugetVersion.Major}.{nugetVersion.Minor + 1}.0)";
-                case VersionRangeType.Minimum:
-                    return packageVersion;
-                default:
-                    throw new NotImplementedException();
-            }
-        }
-    }
-}

+ 1 - 2
build/tasks/Utilities/RuntimeGraphManager.cs

@@ -7,7 +7,6 @@ using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using Microsoft.Extensions.DependencyModel;
-using NuGet.Frameworks;
 using NuGet.Packaging;
 using NuGet.ProjectModel;
 using NuGet.RuntimeModel;
@@ -63,4 +62,4 @@ namespace RepoTasks.Utilities
             }
         }
     }
-}
+}

+ 0 - 86
build/tasks/Utilities/RuntimeReference.cs

@@ -1,86 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-// Sourced from  https://github.com/dotnet/core-setup/tree/be8d8e3486b2bf598ed69d39b1629a24caaba45e/tools-local/tasks, needs to be kept in sync
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.Extensions.DependencyModel;
-
-namespace RepoTasks.Utilities
-{
-    internal class RuntimeReference
-    {
-        public static IEnumerable<RuntimeLibrary> RemoveSharedFxRuntimeEntry(IEnumerable<RuntimeLibrary> runtimeLibraries, string fxName)
-        {
-            foreach (var runtimeLib in runtimeLibraries)
-            {
-                if (string.Equals(runtimeLib.Name, fxName, StringComparison.OrdinalIgnoreCase))
-                {
-                    yield return new RuntimeLibrary(runtimeLib.Type,
-                                                    runtimeLib.Name,
-                                                    runtimeLib.Version,
-                                                    runtimeLib.Hash,
-                                                    Array.Empty<RuntimeAssetGroup>(), // runtimeLib.RuntimeAssemblyGroups,
-                                                    runtimeLib.NativeLibraryGroups,
-                                                    runtimeLib.ResourceAssemblies,
-                                                    runtimeLib.Dependencies,
-                                                    runtimeLib.Serviceable);
-                }
-                else
-                {
-                    yield return runtimeLib;
-                }
-            }
-        }
-
-        public static List<RuntimeLibrary> RemoveReferences(IEnumerable<RuntimeLibrary> runtimeLibraries, IEnumerable<string> packages)
-        {
-            List<RuntimeLibrary> result = new List<RuntimeLibrary>();
-
-            foreach (var runtimeLib in runtimeLibraries)
-            {
-                if (string.IsNullOrEmpty(packages.FirstOrDefault(elem => runtimeLib.Name.Equals(elem, StringComparison.OrdinalIgnoreCase))))
-                {
-                    List<Dependency> toRemoveDependecy = new List<Dependency>();
-                    foreach (var dependency in runtimeLib.Dependencies)
-                    {
-                        if (!string.IsNullOrEmpty(packages.FirstOrDefault(elem => dependency.Name.Equals(elem, StringComparison.OrdinalIgnoreCase))))
-                        {
-                            toRemoveDependecy.Add(dependency);
-                        }
-                    }
-
-                    if (toRemoveDependecy.Count > 0)
-                    {
-                        List<Dependency> modifiedDependencies = new List<Dependency>();
-                        foreach (var dependency in runtimeLib.Dependencies)
-                        {
-                            if (!toRemoveDependecy.Contains(dependency))
-                            {
-                                modifiedDependencies.Add(dependency);
-                            }
-                        }
-
-
-                        result.Add(new RuntimeLibrary(runtimeLib.Type,
-                                                      runtimeLib.Name,
-                                                      runtimeLib.Version,
-                                                      runtimeLib.Hash,
-                                                      runtimeLib.RuntimeAssemblyGroups,
-                                                      runtimeLib.NativeLibraryGroups,
-                                                      runtimeLib.ResourceAssemblies,
-                                                      modifiedDependencies,
-                                                      runtimeLib.Serviceable));
-
-                    }
-                    else if (string.IsNullOrEmpty(packages.FirstOrDefault(elem => runtimeLib.Name.Equals(elem, StringComparison.OrdinalIgnoreCase))))
-                    {
-                        result.Add(runtimeLib);
-                    }
-                }
-            }
-            return result;
-        }
-    }
-}

+ 0 - 36
eng/targets/SharedFx.Common.props

@@ -1,36 +0,0 @@
-<!--
-This file defines properties for building a shared framework.
-This targets file should only be imported by .shfxproj files.
--->
-<Project>
-  <PropertyGroup>
-    <!-- shfxproj must be explicit about its dependencies. -->
-    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
-
-    <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">$(SharedFxRID)</RuntimeIdentifier>
-    <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">$(HostRid)</RuntimeIdentifier>
-    <SharedFxRid Condition="'$(SharedFxRid)' == ''">$(RuntimeIdentifier)</SharedFxRid>
-
-    <!-- Optimize the framework using the crossgen tool -->
-    <CrossgenOutput>true</CrossgenOutput>
-
-    <!-- Produce crossgen symbols when running the crossgen tool -->
-    <CrossgenSymbolsOutput>true</CrossgenSymbolsOutput>
-
-    <!-- Always generated, even though output type == Library -->
-    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
-    <!-- Even though RuntimeIdentifier is set, shared framework projects are not self-contained projects -->
-    <SelfContained>false</SelfContained>
-
-    <!-- Don't add TFM to the project output path of shared framework projects -->
-    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
-    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
-
-    <!-- The project representing the shared framework doesn't produce a .NET assembly or symbols -->
-    <DebugType>none</DebugType>
-    <CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
-    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
-    <IncludeMainProjectInDepsFile>false</IncludeMainProjectInDepsFile>
-  </PropertyGroup>
-
-</Project>

+ 0 - 20
src/Framework/Directory.Build.props

@@ -5,12 +5,6 @@
     <IsFrameworkMetapackage>true</IsFrameworkMetapackage>
   </PropertyGroup>
 
-  <PropertyGroup Condition=" '$(MSBuildProjectExtension)' == '.pkgproj' ">
-    <IsPackable Condition=" '$([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))' == 'pkg'">true</IsPackable>
-
-    <BaseIntermediateOutputPath>$(RepositoryRoot)obj\pkg\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
-  </PropertyGroup>
-
   <!--
     Currently, the shared framework builds by using PackageReference to internally generate the deps.json files and move bits between projects.
     For local builds, this import is required to point to packages which actually exists. Run "build.cmd /t:GeneratePropsFiles /p:BuildNumber=xyz" to
@@ -18,18 +12,4 @@
   -->
   <Import Condition="Exists('..\..\obj\dependencies.g.props') AND '$(DotNetPackageVersionPropsPath)' == ''" Project="..\..\obj\dependencies.g.props" />
 
-  <PropertyGroup Condition=" '$(MSBuildProjectExtension)' == '.shfxproj' ">
-    <OutputPath>$(RepositoryRoot)bin\fx\$(SharedFxRid)\$(MSBuildProjectName)\</OutputPath>
-    <BaseIntermediateOutputPath>$(RepositoryRoot)obj\fx\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
-
-    <CrossgenOutput Condition="'$(SharedFxRid)' == 'linux-arm'">false</CrossgenOutput>
-    <CrossgenSymbolsOutput Condition=" '$(CrossgenOutput)' == 'false' OR '$(SharedFxRid)' == 'osx-x64'">false</CrossgenSymbolsOutput>
-
-    <IncludeSymbols>true</IncludeSymbols>
-    <NuspecFile>$(MSBuildThisFileDirectory)runtime.fx.nuspec</NuspecFile>
-    <PackageTags>aspnetcore;shared-framework</PackageTags>
-    <!-- Workaround for invalid NU5109 error when packing on macOS. -->
-    <NoPackageAnalysis>true</NoPackageAnalysis>
-  </PropertyGroup>
-
 </Project>

+ 0 - 29
src/Framework/Directory.Build.targets

@@ -1,29 +0,0 @@
-<Project>
-  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" />
-
-  <Import Condition=" '$(MSBuildProjectExtension)' == '.pkgproj' " Project="Metapackage.targets" />
-
-  <Target Name="PopulateNuspec" BeforeTargets="GenerateNuspec" Condition=" '$(MSBuildProjectExtension)' == '.shfxproj' ">
-    <PropertyGroup>
-      <NuspecProperties>
-        id=$(PackageId);
-        version=$(PackageVersion);
-        authors=$(Authors);
-        rid=$(SharedFxRid);
-        description=$(PackageDescription);
-        tags=$(PackageTags.Replace(';', ' '));
-        licenseUrl=$(PackageLicenseUrl);
-        projectUrl=$(PackageProjectUrl);
-        iconUrl=$(PackageIconUrl);
-        repositoryUrl=$(RepositoryUrl);
-        repositoryCommit=$(RepositoryCommit);
-        copyright=$(Copyright);
-        targetFramework=$(TargetFramework);
-        symbolsAssets=$([MSBuild]::NormalizeDirectory($(SymbolsOutputPath)));
-        nativeAssets=$([MSBuild]::NormalizeDirectory($(NativeAssetsOutputPath)));
-        runtimeAssets=$([MSBuild]::NormalizeDirectory($(RuntimeAssetsOutputPath)));
-      </NuspecProperties>
-    </PropertyGroup>
-  </Target>
-
-</Project>

+ 0 - 51
src/Framework/Metapackage.targets

@@ -1,51 +0,0 @@
-<Project>
-  <PropertyGroup>
-    <!-- There is no build output -->
-    <IncludeBuildOutput>false</IncludeBuildOutput>
-    <!-- There are no symbols. -->
-    <IncludeSymbols>false</IncludeSymbols>
-    <!-- There is no API to check -->
-    <EnableApiCheck>false</EnableApiCheck>
-    <!-- Manually control dependencies -->
-    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
-    <!-- The only build output of a pkgproj is the project -->
-    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
-
-    <PackageId>$(MSBuildProjectName)</PackageId>
-    <TargetPath>$(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg</TargetPath>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Microsoft.NETCore.App" Version="$(MicrosoftNETCoreAppPackageVersion)" PrivateAssets="All" Publish="false" />
-  </ItemGroup>
-
-  <ItemDefinitionGroup>
-    <TargetPathWithTargetPlatformMoniker>
-      <PackageId>$(PackageId)</PackageId>
-    </TargetPathWithTargetPlatformMoniker>
-  </ItemDefinitionGroup>
-
-  <Import Project="$(RepositoryRoot)build\tasks\RepoTasks.tasks" />
-
-  <Target Name="ResolveDependenciesToPackageReferences" BeforeTargets="CollectPackageReferences">
-    <Error Text="Missing version information for dependencies:%0A - @(Dependency, '%0A - ')" Condition=" '%(Dependency.Version)' == '' " />
-
-    <RepoTasks.ResolveVersionRange
-      Items="@(Dependency)"
-      Version="%(Version)"
-      RangeType="%(VersionRangeType)">
-      <Output TaskParameter="Items" ItemName="_CustomPackageReference" />
-    </RepoTasks.ResolveVersionRange>
-
-    <ItemGroup>
-      <PackageReference Include="@(_CustomPackageReference)">
-        <!-- Ensure that the metapackage does not exclude build or analyzer assets. -->
-        <PrivateAssets>None</PrivateAssets>
-      </PackageReference>
-    </ItemGroup>
-  </Target>
-
-  <Target Name="CopyFilesToOutputDirectory" />
-  <Target Name="CoreCompile" />
-  <Target Name="CreateManifestResourceNames" />
-</Project>

+ 1 - 1
src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.props → src/Framework/Microsoft.AspNetCore.App.props

@@ -125,7 +125,7 @@
     <Dependency Include="Microsoft.Extensions.Primitives"                              Version="$(MicrosoftExtensionsPrimitivesPackageVersion)" />
     <Dependency Include="Microsoft.Extensions.WebEncoders"                             Version="$(MicrosoftExtensionsWebEncodersPackageVersion)" />
     <Dependency Include="Microsoft.Net.Http.Headers"                                   Version="$(MicrosoftNetHttpHeadersPackageVersion)" />
-    <Dependency Include="System.IO.Pipelines"                                          Version="$(SystemIOPipelinesPackageVersion)" VersionRangeType="Minimum" />
+    <Dependency Include="System.IO.Pipelines"                                          Version="$(SystemIOPipelinesPackageVersion)" />
   </ItemGroup>
 
 </Project>

+ 0 - 26
src/Framework/Microsoft.AspNetCore.App/pkg/Microsoft.AspNetCore.App.pkgproj

@@ -1,26 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>netcoreapp3.0</TargetFramework>
-    <PackageTags>aspnetcore</PackageTags>
-    <PackageDescription>Provides a default set of APIs for building an ASP.NET Core application.
-
-This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
-    </PackageDescription>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Content Include="build\$(TargetFramework)\*.props" PackagePath="%(Identity)" />
-    <Content Include="build\$(TargetFramework)\*.targets" PackagePath="%(Identity)" />
-    <Content Include="lib\$(TargetFramework)\_._" PackagePath="%(Identity)" />
-  </ItemGroup>
-
-  <ItemDefinitionGroup>
-    <Dependency>
-      <VersionRangeType>MajorMinor</VersionRangeType>
-    </Dependency>
-  </ItemDefinitionGroup>
-
-  <Import Project="..\Microsoft.AspNetCore.App.props" />
-
-</Project>

+ 0 - 21
src/Framework/Microsoft.AspNetCore.App/pkg/build/netcoreapp3.0/Microsoft.AspNetCore.App.props

@@ -1,21 +0,0 @@
-<Project>
-  <!--
-    The _AspNetCoreAppSharedFxIsEnabled property is meant for internal use only. When set to 'false',
-    the default value of MicrosoftNETPlatformLibrary will be used. It was added to support
-    a better SDK exprience on platforms where the ASP.NET Core shared framework is not avaiable.
-    In these cases, ASP.NET Core can still be as if it were just a set of NuGet packages.
-
-    NB: this is _AspNetCore*App*SharedFxIsEnabled, not _AspNetCore*All*SharedFxIsEnabled
-  -->
-  <PropertyGroup>
-    <_AspNetCoreAppSharedFxIsEnabled Condition=" '$(_AspNetCoreAppSharedFxIsEnabled)' == '' ">true</_AspNetCoreAppSharedFxIsEnabled>
-  </PropertyGroup>
-
-  <!--
-    Capability that enables Visual Studio support for hosting Asp.Net Core applications in the IIS process
-  -->
-  <ItemGroup>
-    <ProjectCapability Include="AspNetCoreInProcessHosting" />
-  </ItemGroup>
-
-</Project>

+ 0 - 18
src/Framework/Microsoft.AspNetCore.App/pkg/build/netcoreapp3.0/Microsoft.AspNetCore.App.targets

@@ -1,18 +0,0 @@
-<Project>
-  <!--
-    This property instructs the .NET Core SDK to treat this package as the shared framework platform.
-    This affects how the SDK will trim references and publish output, determines how the runtimeconfig
-    files are generated, and may affect how optimizations are preformed by other tools.
-
-    NB: this is _AspNetCore*App*SharedFxIsEnabled, not _AspNetCore*All*SharedFxIsEnabled
-  -->
-  <PropertyGroup Condition=" '$(_AspNetCoreAppSharedFxIsEnabled)' == 'true' ">
-    <MicrosoftNETPlatformLibrary>Microsoft.AspNetCore.App</MicrosoftNETPlatformLibrary>
-  </PropertyGroup>
-
-  <Target Name="EnsureTFMCompatibility" BeforeTargets="_CheckForInvalidConfigurationAndPlatform">
-    <Error
-      Text="This version of Microsoft.AspNetCore.App is only compatible with the netcoreapp3.0 target framework. Please target netcoreapp3.0 or choose a version of Microsoft.AspNetCore.App compatible with $(TargetFramework)."
-      Condition="'$(TargetFramework)' != 'netcoreapp3.0'"/>
-  </Target>
-</Project>

+ 0 - 20
src/Framework/Microsoft.AspNetCore.App/src/Microsoft.AspNetCore.App.shfxproj

@@ -1,20 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>netcoreapp3.0</TargetFramework>
-    <BaseSharedFrameworkName>Microsoft.NETCore.App</BaseSharedFrameworkName>
-    <RuntimeFrameworkVersion>$(MicrosoftNETCoreAppPackageVersion)</RuntimeFrameworkVersion>
-
-    <!-- The runtime Package ID is for self-contained assets. -->
-    <PackageId>runtime.$(SharedFxRid).$(MSBuildProjectName)</PackageId>
-    <PackageDescription>This package provides assets used for self-contained deployments of an ASP.NET Core application. It is an internal implementation package not meant for direct consumption. Please do not reference directly.
-
-$(MSBuildProjectName) provides a default set of APIs for building an ASP.NET Core application.
-    </PackageDescription>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageProjectReference Include="..\pkg\Microsoft.AspNetCore.App.pkgproj" />
-  </ItemGroup>
-
-</Project>

+ 72 - 0
src/Framework/pkg/Metapackage.targets

@@ -0,0 +1,72 @@
+<Project>
+  <PropertyGroup>
+    <!-- There is no build output -->
+    <IncludeBuildOutput>false</IncludeBuildOutput>
+    <!-- There are no symbols. -->
+    <IncludeSymbols>false</IncludeSymbols>
+    <!-- There is no API to check -->
+    <EnableApiCheck>false</EnableApiCheck>
+    <!-- Manually control dependencies -->
+    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
+    <!-- The only build output of a pkgproj is the project -->
+    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
+
+    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+
+    <!-- Do not include dependencies in the genreate nuspec. -->
+    <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
+
+    <PackageId>$(MSBuildProjectName)</PackageId>
+    <TargetPath>$(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg</TargetPath>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Content Include="$(IntermediateOutputPath)\runtime.json" PackagePath="\" />
+
+    <PackageReference Include="Microsoft.NETCore.App">
+      <Version>$(MicrosoftNETCoreAppPackageVersion)</Version>
+      <PrivateAssets>All</PrivateAssets>
+      <AllowExplicitVersion>true</AllowExplicitVersion>
+    </PackageReference>
+
+    <PackageReference Include="@(Dependency)" />
+  </ItemGroup>
+
+  <ItemDefinitionGroup>
+    <TargetPathWithTargetPlatformMoniker>
+      <PackageId>$(PackageId)</PackageId>
+    </TargetPathWithTargetPlatformMoniker>
+  </ItemDefinitionGroup>
+
+  <Import Project="$(RepositoryRoot)build\tasks\RepoTasks.tasks" />
+
+  <Target Name="GenerateRuntimeJson" BeforeTargets="BeforeBuild">
+    <ItemGroup>
+      <_SupportedRids Include="$(SupportedRuntimeIdentifiers)" />
+    </ItemGroup>
+
+    <PropertyGroup>
+      <RuntimeJsonFileContent>
+{
+  "runtimes": {
+    @(_SupportedRids->'"%(Identity)": { "$(PackageId)": { "runtime.%(Identity).$(PackageId)": "$(PackageVersion)" } }', ',%0A    ')
+  }
+}
+      </RuntimeJsonFileContent>
+    </PropertyGroup>
+
+    <WriteLinesToFile Lines="$(RuntimeJsonFileContent)" File="$(IntermediateOutputPath)\runtime.json" Overwrite="true" />
+  </Target>
+
+  <Target Name="ResolveReferenceItemsForPackage" DependsOnTargets="ResolveReferences" BeforeTargets="_GetPackageFiles">
+    <ItemGroup>
+      <Content Include="@(ReferencePath)" Condition="'%(ReferencePath.NuGetPackageId)' != 'Microsoft.NETCore.App'">
+        <PackagePath>ref/$(TargetFramework)/%(ReferencePath.FileName)%(ReferencePath.Extension)</PackagePath>
+      </Content>
+    </ItemGroup>
+  </Target>
+
+  <Target Name="CopyFilesToOutputDirectory" />
+  <Target Name="CoreCompile" DependsOnTargets="ResolveReferenceItemsForPackage" />
+  <Target Name="CreateManifestResourceNames" />
+</Project>

+ 30 - 0
src/Framework/pkg/Microsoft.AspNetCore.App.pkgproj

@@ -0,0 +1,30 @@
+<Project>
+  <PropertyGroup>
+    <BaseIntermediateOutputPath>$(RepositoryRoot)obj\pkg\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
+
+    <!-- Don't add TFM to the project output path of shared framework projects -->
+    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+  </PropertyGroup>
+
+  <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
+
+  <PropertyGroup>
+    <TargetFramework>netcoreapp3.0</TargetFramework>
+    <PackageTags>aspnetcore</PackageTags>
+    <IsPackable>true</IsPackable>
+    <PackageDescription>Provides a default set of APIs for building an ASP.NET Core application.
+
+This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
+    </PackageDescription>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Content Include="$(MSBuildProjectName).targets" PackagePath="build\$(TargetFramework)\" />
+    <Content Include="_._" PackagePath="lib\$(TargetFramework)\" />
+  </ItemGroup>
+
+  <Import Project="..\Microsoft.AspNetCore.App.props" />
+
+  <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
+  <Import Project="Metapackage.targets" />
+</Project>

+ 7 - 0
src/Framework/pkg/Microsoft.AspNetCore.App.targets

@@ -0,0 +1,7 @@
+<Project>
+  <Target Name="EnsureTFMCompatibility" BeforeTargets="_CheckForInvalidConfigurationAndPlatform">
+    <Error
+      Text="This version of Microsoft.AspNetCore.App is only compatible with the netcoreapp3.0 target framework. Please target netcoreapp3.0 or choose a version of Microsoft.AspNetCore.App compatible with $(TargetFramework)."
+      Condition="'$(TargetFramework)' != 'netcoreapp3.0'"/>
+  </Target>
+</Project>

+ 0 - 0
src/Framework/Microsoft.AspNetCore.App/pkg/lib/netcoreapp3.0/_._ → src/Framework/pkg/_._


+ 64 - 0
src/Framework/src/Microsoft.AspNetCore.App.shfxproj

@@ -0,0 +1,64 @@
+<Project>
+  <PropertyGroup>
+    <TargetFramework>netcoreapp3.0</TargetFramework>
+    <BaseSharedFrameworkName>Microsoft.NETCore.App</BaseSharedFrameworkName>
+    <RuntimeFrameworkVersion>$(MicrosoftNETCoreAppPackageVersion)</RuntimeFrameworkVersion>
+
+    <OutputPath>$(RepositoryRoot)bin\fx\$(SharedFxRid)\$(MSBuildProjectName)\</OutputPath>
+    <BaseIntermediateOutputPath>$(RepositoryRoot)obj\fx\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
+
+    <!-- shfxproj must be explicit about its dependencies. -->
+    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
+
+    <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">$(SharedFxRID)</RuntimeIdentifier>
+    <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">$(HostRid)</RuntimeIdentifier>
+    <SharedFxRid Condition="'$(SharedFxRid)' == ''">$(RuntimeIdentifier)</SharedFxRid>
+
+    <!-- Optimize the framework using the crossgen tool -->
+    <CrossgenOutput>true</CrossgenOutput>
+
+    <!-- Produce crossgen symbols when running the crossgen tool -->
+    <CrossgenSymbolsOutput>true</CrossgenSymbolsOutput>
+
+    <CrossgenOutput Condition="'$(SharedFxRid)' == 'linux-arm'">false</CrossgenOutput>
+    <CrossgenSymbolsOutput Condition=" '$(CrossgenOutput)' == 'false' OR '$(SharedFxRid)' == 'osx-x64'">false</CrossgenSymbolsOutput>
+
+    <!-- Always generated, even though output type == Library -->
+    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
+    <!-- Even though RuntimeIdentifier is set, shared framework projects are not self-contained projects -->
+    <SelfContained>false</SelfContained>
+
+    <!-- Don't add TFM to the project output path of shared framework projects -->
+    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
+
+    <!-- The project representing the shared framework doesn't produce a .NET assembly or symbols -->
+    <DebugType>none</DebugType>
+    <CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
+    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+    <IncludeMainProjectInDepsFile>false</IncludeMainProjectInDepsFile>
+  </PropertyGroup>
+
+  <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
+
+  <PropertyGroup>
+    <!-- The runtime Package ID is for self-contained assets. -->
+    <PackageId>runtime.$(SharedFxRid).$(MSBuildProjectName)</PackageId>
+    <PackageDescription>This package provides assets used for self-contained deployments of an ASP.NET Core application. It is an internal implementation package not meant for direct consumption. Please do not reference directly.
+
+$(MSBuildProjectName) provides a default set of APIs for building an ASP.NET Core application.
+    </PackageDescription>
+
+    <IncludeSymbols>true</IncludeSymbols>
+    <NuspecFile>$(MSBuildThisFileDirectory)runtime.fx.nuspec</NuspecFile>
+    <PackageTags>aspnetcore;shared-framework</PackageTags>
+    <!-- Workaround for invalid NU5109 error when packing on macOS. -->
+    <NoPackageAnalysis>true</NoPackageAnalysis>
+  </PropertyGroup>
+
+  <Import Project="..\Microsoft.AspNetCore.App.props" />
+
+  <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
+  <Import Project="SharedFx.targets" />
+
+</Project>

+ 31 - 19
eng/targets/SharedFx.Common.targets → src/Framework/src/SharedFx.targets

@@ -4,7 +4,7 @@ This targets file should only be imported by .shfxproj files.
 -->
 <Project>
 
-  <Import Project="..\..\build\tasks\RepoTasks.tasks" />
+  <Import Project="$(RepositoryRoot)build\tasks\RepoTasks.tasks" />
 
   <PropertyGroup>
     <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
@@ -94,21 +94,14 @@ This targets file should only be imported by .shfxproj files.
     <PublishDepsFilePath>$(IntermediateOutputPath)$(SharedFxName).publish.deps.json</PublishDepsFilePath>
 
     <!-- The output path of generated files -->
-    <ProjectRuntimeConfigFilePath>$(MetadataOutputPath)$(SharedFxName).runtimeconfig.json</ProjectRuntimeConfigFilePath>
+    <PublishRuntimeConfigFilePath>$(MetadataOutputPath)$(SharedFxName).runtimeconfig.json</PublishRuntimeConfigFilePath>
+    <!-- The SDK renamed PublishRuntimeConfigFilePath to PublishRuntimeConfigFilePath, so set both to be safe. -->
+    <ProjectRuntimeConfigFilePath>$(PublishRuntimeConfigFilePath)</ProjectRuntimeConfigFilePath>
     <SharedFxDepsFilePath>$(MetadataOutputPath)$(SharedFxName).deps.json</SharedFxDepsFilePath>
     <VersionFileOutputPath>$(MetadataOutputPath).version</VersionFileOutputPath>
   </PropertyGroup>
 
   <ItemDefinitionGroup>
-    <!-- Defines different types of project references. -->
-    <FrameworkProjectReference>
-      <OutputItemType>_ResolvedFrameworkProjectReferencePaths</OutputItemType>
-    </FrameworkProjectReference>
-
-    <PackageProjectReference>
-      <OutputItemType>_ResolvedPackageProjectReferencePaths</OutputItemType>
-    </PackageProjectReference>
-
     <TargetPathWithTargetPlatformMoniker>
       <!--
         This lists all folders of assets which should be collected into the same folder in a shared framework installer.
@@ -129,7 +122,6 @@ This targets file should only be imported by .shfxproj files.
 
   <ItemGroup>
     <PackageReference Include="Microsoft.NETCore.App" Version="$(RuntimeFrameworkVersion)">
-      <IsImplicitlyDefined>true</IsImplicitlyDefined>
       <Publish>true</Publish>
       <PrivateAssets>All</PrivateAssets>
       <ExcludeAssets>Native</ExcludeAssets>
@@ -138,10 +130,8 @@ This targets file should only be imported by .shfxproj files.
 
     <PackageReference Include="@(Dependency)">
       <IncludeAssets>Runtime;Native</IncludeAssets>
+      <Publish>true</Publish>
     </PackageReference>
-
-    <ProjectReference Include="@(FrameworkProjectReference)" />
-    <ProjectReference Include="@(PackageProjectReference)" />
   </ItemGroup>
 
   <!-- Check some required properties before building a shared framework/ -->
@@ -186,12 +176,12 @@ This targets file should only be imported by .shfxproj files.
           Outputs="$(SharedFxDepsFilePath)">
     <ProcessSharedFrameworkDeps
       FrameworkName="$(SharedFxName)"
+      FrameworkVersion="$(SharedFxVersion)"
       AssetsFilePath="$(ProjectAssetsFile)"
+      TargetFramework="$(TargetFramework)"
       DepsFilePath="$(PublishDepsFilePath)"
       OutputPath="$(SharedFxDepsFilePath)"
-      PackagesToRemove="@(_ResolvedFrameworkProjectReferencePaths->'%(PackageId)')"
-      ResolvedPackageProjectReferences="@(_ResolvedPackageProjectReferencePaths)"
-      Runtime="$(BaseSharedFxRid)" />
+      BaseRuntimeIdentifier="$(BaseSharedFxRid)" />
   </Target>
 
   <!-- Optimizes shared framework output -->
@@ -274,7 +264,6 @@ This targets file should only be imported by .shfxproj files.
       <_PlatformAssemblyPaths Remove="@(_PlatformAssemblyPaths)" />
       <_PlatformAssemblyPaths Include="$(CrossGenToolDir)" />
       <_PlatformAssemblyPaths Include="$(PublishDir)" />
-      <_PlatformAssemblyPaths Include="%(_ResolvedFrameworkProjectReferencePaths.RuntimeAssetsOutputPath)" Condition="'%(_ResolvedFrameworkProjectReferencePaths.RuntimeAssetsOutputPath)' != ''" />
     </ItemGroup>
 
     <PropertyGroup>
@@ -360,4 +349,27 @@ This targets file should only be imported by .shfxproj files.
       </ArtifactInfo>
     </ItemGroup>
   </Target>
+
+  <Target Name="PopulateNuspec" BeforeTargets="GenerateNuspec">
+    <PropertyGroup>
+      <NuspecProperties>
+        id=$(PackageId);
+        version=$(PackageVersion);
+        authors=$(Authors);
+        rid=$(SharedFxRid);
+        description=$(PackageDescription);
+        tags=$(PackageTags.Replace(';', ' '));
+        licenseUrl=$(PackageLicenseUrl);
+        projectUrl=$(PackageProjectUrl);
+        iconUrl=$(PackageIconUrl);
+        repositoryUrl=$(RepositoryUrl);
+        repositoryCommit=$(RepositoryCommit);
+        copyright=$(Copyright);
+        targetFramework=$(TargetFramework);
+        symbolsAssets=$([MSBuild]::NormalizeDirectory($(SymbolsOutputPath)));
+        nativeAssets=$([MSBuild]::NormalizeDirectory($(NativeAssetsOutputPath)));
+        runtimeAssets=$([MSBuild]::NormalizeDirectory($(RuntimeAssetsOutputPath)));
+      </NuspecProperties>
+    </PropertyGroup>
+  </Target>
 </Project>

+ 0 - 0
src/Framework/_._ → src/Framework/src/_._


+ 0 - 0
src/Framework/runtime.fx.nuspec → src/Framework/src/runtime.fx.nuspec


+ 0 - 0
src/Framework/Framework.UnitTests/AssertEx.cs → src/Framework/test/AssertEx.cs


+ 1 - 1
src/Framework/Framework.UnitTests/Framework.UnitTests.csproj → src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj

@@ -30,7 +30,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <ProjectReference Include="..\**\*.shfxproj">
+    <ProjectReference Include="..\src\Microsoft.AspNetCore.App.shfxproj">
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
       <OutputItemType>_ResolvedFrameworkReference</OutputItemType>
     </ProjectReference>

+ 44 - 3
src/Framework/Framework.UnitTests/SharedFxTests.cs → src/Framework/test/SharedFxTests.cs

@@ -2,6 +2,7 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 using System.IO;
+using System.Linq;
 using Newtonsoft.Json.Linq;
 using Xunit;
 
@@ -9,6 +10,13 @@ namespace Microsoft.AspNetCore
 {
     public class SharedFxTests
     {
+        private readonly string _expectedTfm;
+
+        public SharedFxTests()
+        {
+            _expectedTfm = "netcoreapp" + TestData.GetPackageVersion().Substring(0, 3);
+        }
+
         [Fact]
         public void ItContainsValidRuntimeConfigFile()
         {
@@ -20,7 +28,7 @@ namespace Microsoft.AspNetCore
             var runtimeConfig = JObject.Parse(File.ReadAllText(runtimeConfigFilePath));
 
             Assert.Equal("Microsoft.NETCore.App", (string)runtimeConfig["runtimeOptions"]["framework"]["name"]);
-            Assert.Equal("netcoreapp" + TestData.GetPackageVersion().Substring(0, 3), (string)runtimeConfig["runtimeOptions"]["tfm"]);
+            Assert.Equal(_expectedTfm, (string)runtimeConfig["runtimeOptions"]["tfm"]);
 
             Assert.Equal(TestData.GetMicrosoftNETCoreAppPackageVersion(), (string)runtimeConfig["runtimeOptions"]["framework"]["version"]);
         }
@@ -32,13 +40,13 @@ namespace Microsoft.AspNetCore
             var rid = TestData.GetSharedFxRuntimeIdentifier();
 
             var target = $".NETCoreApp,Version=v{TestData.GetPackageVersion().Substring(0, 3)}/{rid}";
+            var ridPackageId = $"runtime.{rid}.Microsoft.AspNetCore.App";
 
             AssertEx.FileExists(depsFilePath);
 
             var depsFile = JObject.Parse(File.ReadAllText(depsFilePath));
 
             Assert.Equal(target, (string)depsFile["runtimeTarget"]["name"]);
-            Assert.NotNull(depsFile["targets"][target]);
             Assert.NotNull(depsFile["compilationOptions"]);
             Assert.Empty(depsFile["compilationOptions"]);
             Assert.NotEmpty(depsFile["runtimes"][rid]);
@@ -47,8 +55,41 @@ namespace Microsoft.AspNetCore
                 var prop = Assert.IsType<JProperty>(item);
                 var lib = Assert.IsType<JObject>(prop.Value);
                 Assert.Equal("package", lib["type"].Value<string>());
-                Assert.StartsWith("sha512-", lib["sha512"].Value<string>());
+                Assert.Empty(lib["sha512"].Value<string>());
+            });
+
+            Assert.NotNull(depsFile["libraries"][$"Microsoft.AspNetCore.App/{TestData.GetPackageVersion()}"]);
+            Assert.NotNull(depsFile["libraries"][$"runtime.{rid}.Microsoft.AspNetCore.App/{TestData.GetPackageVersion()}"]);
+            Assert.Equal(2, depsFile["libraries"].Values().Count());
+
+            var targetLibraries = depsFile["targets"][target];
+            Assert.Equal(2, targetLibraries.Values().Count());
+            var metapackage = targetLibraries[$"Microsoft.AspNetCore.App/{TestData.GetPackageVersion()}"];
+            Assert.Null(metapackage["runtime"]);
+            Assert.Null(metapackage["native"]);
+
+            var runtimeLibrary = targetLibraries[$"{ridPackageId}/{TestData.GetPackageVersion()}"];
+            Assert.Null(runtimeLibrary["dependencies"]);
+            Assert.All(runtimeLibrary["runtime"], item =>
+            {
+                var obj = Assert.IsType<JProperty>(item);
+                Assert.StartsWith($"runtimes/{rid}/lib/{_expectedTfm}/", obj.Name);
+                Assert.NotEmpty(obj.Value["assemblyVersion"].Value<string>());
+                Assert.NotEmpty(obj.Value["fileVersion"].Value<string>());
             });
+
+            if (TestData.GetSharedFxRuntimeIdentifier().StartsWith("win"))
+            {
+                Assert.All(runtimeLibrary["native"], item =>
+                {
+                    var obj = Assert.IsType<JProperty>(item);
+                    Assert.StartsWith($"runtimes/{rid}/native/", obj.Name);
+                });
+            }
+            else
+            {
+                Assert.Null(runtimeLibrary["native"]);
+            }
         }
 
         [Fact]

+ 0 - 0
src/Framework/Framework.UnitTests/TestData.cs → src/Framework/test/TestData.cs


+ 0 - 0
src/Framework/Framework.UnitTests/TestDataAttribute.cs → src/Framework/test/TestDataAttribute.cs


+ 1 - 1
src/Installers/Archive/Archive.Internal.zipproj

@@ -16,7 +16,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <ProjectReference Include="..\..\Framework\**\*.shfxproj">
+    <ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
       <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
       <OutputItemType>_ResolvedFxProjects</OutputItemType>
     </ProjectReference>

+ 1 - 1
src/Installers/Archive/Archive.Redist.zipproj

@@ -19,7 +19,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <ProjectReference Include="..\..\Framework\*\src\*.shfxproj">
+    <ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
       <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
       <OutputItemType>_ResolvedFxProjects</OutputItemType>
     </ProjectReference>

+ 1 - 1
src/Installers/Debian/Runtime.debproj

@@ -40,7 +40,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <ProjectReference Include="..\..\Framework\**\Microsoft.AspNetCore.App.shfxproj">
+    <ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
       <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
       <OutputItemType>_ResolvedFxProjects</OutputItemType>
     </ProjectReference>

+ 1 - 1
src/Installers/Rpm/Rpm.props

@@ -25,7 +25,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <ProjectReference Include="..\..\Framework\**\Microsoft.AspNetCore.App.shfxproj">
+    <ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
       <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
       <OutputItemType>_ResolvedFxProjects</OutputItemType>
     </ProjectReference>

+ 0 - 0
src/Packages/Microsoft.AspNetCore.All/lib/netcoreapp3.0/_._


+ 0 - 0
src/Packages/Microsoft.AspNetCore.App/lib/netcoreapp3.0/_._