From cce50bca7568240a1c71af75013204be05dc1d71 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 25 Feb 2019 22:52:27 -0800 Subject: [PATCH 1/2] Deprecate the Microsoft.AspNetCore.App metapackage in favor of targeting and runtime packs * Stop producing Microsoft.AspNetCore.App, and runtime.$(rid).Microsoft.AspNetCore.App * Generate the shared framework without using 'NuGet' restore * Stop producing intermediate packages for shared-framework only assemblies * Put the platform manifest into the targeting pack (data/Microsoft.AspNetCore.App.PlatformManifest.txt) * Create well-known, shared intermediate directories that installers can use to bundle content --- Directory.Build.props | 20 +- Directory.Build.targets | 5 + build/CodeSign.targets | 2 +- build/SharedFx.targets | 42 +- build/repo.props | 1 + .../tasks/GenerateRestoreSourcesPropsFile.cs | 55 --- .../tasks/GenerateSharedFrameworkDepsFile.cs | 14 +- .../GenerateSharedFrameworkMetadataFiles.cs | 154 ------- build/tasks/RepoTasks.tasks | 2 - build/tasks/RuntimeGraphManager.cs | 65 --- docs/ProjectProperties.md | 2 +- eng/targets/ResolveReferences.targets | 5 + src/Framework/Directory.Build.props | 15 +- src/Framework/pkg/Metapackage.targets | 121 ------ .../pkg/Microsoft.AspNetCore.App.pkgproj | 38 -- .../pkg/Microsoft.AspNetCore.App.targets | 30 -- src/Framework/pkg/_._ | 0 .../ref/Microsoft.AspNetCore.App.Ref.csproj | 32 +- .../Microsoft.AspNetCore.App.Runtime.csproj | 165 +++++++- .../src/Microsoft.AspNetCore.App.shfxproj | 56 --- src/Framework/src/SharedFx.targets | 388 ------------------ src/Framework/src/_._ | 0 src/Framework/src/runtime.fx.nuspec | 24 -- .../Microsoft.AspNetCore.App.UnitTests.csproj | 51 ++- src/Framework/test/SharedFxTests.cs | 106 ++--- src/Framework/test/TargetingPackTests.cs | 79 ++++ src/Framework/test/TestData.cs | 6 +- .../Archive/Archive.Internal.zipproj | 51 --- src/Installers/Archive/Archive.Redist.zipproj | 110 ----- src/Installers/Debian/Directory.Build.props | 2 - src/Installers/Debian/Directory.Build.targets | 7 +- .../Debian/Runtime/Debian.Runtime.debproj | 23 +- .../Debian.TargetingPack.debproj | 14 +- src/Installers/Debian/tools/build.sh | 38 +- src/Installers/Directory.Build.props | 15 - src/Installers/Rpm/Directory.Build.targets | 6 +- src/Installers/Rpm/Rpm.Runtime.Common.targets | 24 +- .../TargetingPack/Rpm.TargetingPack.rpmproj | 2 +- .../test/GenerateTestProps.targets | 1 + .../test/ProjectTemplates.Tests.csproj | 4 + .../test/TemplateTests.props.in | 5 +- .../ts/signalr-protocol-msgpack/package.json | 2 +- src/SignalR/clients/ts/signalr/package.json | 2 +- .../LoggingBranch/LoggingBranch.csproj | 7 +- ...t.AspNetCore.Runtime.SiteExtension.pkgproj | 7 +- 45 files changed, 430 insertions(+), 1368 deletions(-) delete mode 100644 build/tasks/GenerateRestoreSourcesPropsFile.cs delete mode 100644 build/tasks/GenerateSharedFrameworkMetadataFiles.cs delete mode 100644 build/tasks/RuntimeGraphManager.cs delete mode 100644 src/Framework/pkg/Metapackage.targets delete mode 100644 src/Framework/pkg/Microsoft.AspNetCore.App.pkgproj delete mode 100644 src/Framework/pkg/Microsoft.AspNetCore.App.targets delete mode 100644 src/Framework/pkg/_._ delete mode 100644 src/Framework/src/Microsoft.AspNetCore.App.shfxproj delete mode 100644 src/Framework/src/SharedFx.targets delete mode 100644 src/Framework/src/_._ delete mode 100644 src/Framework/src/runtime.fx.nuspec create mode 100644 src/Framework/test/TargetingPackTests.cs delete mode 100644 src/Installers/Archive/Archive.Internal.zipproj delete mode 100644 src/Installers/Archive/Archive.Redist.zipproj delete mode 100644 src/Installers/Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props index 07e500124b8a..b49a722dc7dc 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,6 +30,15 @@ $(Product) $(PackageVersion) Shared Framework Shared Framework for hosting of Microsoft ASP.NET Core applications. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub ($(RepositoryUrl)). We happily accept issues and PRs. + + aspnetcore-runtime + aspnetcore-targeting-pack + + $(RuntimeInstallerBaseName)-internal @@ -61,7 +70,7 @@ false - true + true @@ -94,7 +103,7 @@ - true + true true @@ -179,6 +188,13 @@ true $(ArtifactsObjDir)TargetingPack.Layout\$(Configuration)\ + + $(ArtifactsObjDir)SharedFx.Layout\$(Configuration)\$(TargetRuntimeIdentifier)\ + + $(ArtifactsObjDir)RedistSharedFx.Layout\$(Configuration)\$(TargetRuntimeIdentifier)\ + + .tar.gz + .zip diff --git a/Directory.Build.targets b/Directory.Build.targets index f4c001068d5c..4623263e5431 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -8,6 +8,11 @@ --> false + + false + $(ArtifactsShippingPackagesDir) $(ArtifactsNonShippingPackagesDir) diff --git a/build/CodeSign.targets b/build/CodeSign.targets index e3b5a4726919..96fffe035b10 100644 --- a/build/CodeSign.targets +++ b/build/CodeSign.targets @@ -15,7 +15,7 @@ - $(ArtifactsDir)obj\ar\ + $(ArtifactsDir)obj\RedistSharedFx.Layout\$(Configuration)\ $(BaseRedistNetCorePath)$(TargetRuntimeIdentifier)\ diff --git a/build/SharedFx.targets b/build/SharedFx.targets index 27eb7e65b327..9e244b3fca6c 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -1,17 +1,10 @@ - $(RepositoryRoot)src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj - $([MSBuild]::NormalizePath($(UnitTestFxProject))) - _BuildSharedFxProjects;TestSharedFx + _BuildSharedFxProjects $(BuildSharedFxDependsOn);CodeSign - - - - - @@ -21,7 +14,7 @@ - + <_RestoreGraphProjectInput>@(FxProjectToBuild) @@ -42,35 +35,4 @@ SkipNonexistentTargets="true" /> - - - - - $(LogOutputDir)SharedFx-UnitTests-$(PackageVersion)-$(TargetRuntimeIdentifier).trx - - $(UnitTestFxTrxLogFile) - $(HostMachineRepositoryRoot)/artifacts/logs/SharedFx-UnitTests.trx - - - - - - - - - - - - - - diff --git a/build/repo.props b/build/repo.props index 87c9fbb6f96e..f453c3c5c812 100644 --- a/build/repo.props +++ b/build/repo.props @@ -147,6 +147,7 @@ (); var nativeFiles = new List(); var resourceAssemblies = new List(); + var platformManifest = new List(); foreach (var reference in References) { @@ -62,6 +66,7 @@ private void ExecuteCore() { var nativeFile = new RuntimeFile(fileName, null, fileVersion); nativeFiles.Add(nativeFile); + platformManifest.Add($"{fileName}|{FrameworkName}||{fileVersion}"); } else { @@ -69,6 +74,7 @@ private void ExecuteCore() fileVersion: fileVersion, assemblyVersion: assemblyVersion.ToString()); runtimeFiles.Add(runtimeFile); + platformManifest.Add($"{fileName}|{FrameworkName}|{assemblyVersion}|{fileVersion}"); } } @@ -91,6 +97,12 @@ private void ExecuteCore() Enumerable.Empty()); Directory.CreateDirectory(Path.GetDirectoryName(DepsFilePath)); + Directory.CreateDirectory(Path.GetDirectoryName(PlatformManifestOutputPath)); + + File.WriteAllText( + PlatformManifestOutputPath, + string.Join("\n", platformManifest.OrderBy(n => n)), + Encoding.UTF8); try { diff --git a/build/tasks/GenerateSharedFrameworkMetadataFiles.cs b/build/tasks/GenerateSharedFrameworkMetadataFiles.cs deleted file mode 100644 index 9105cbbb5ac3..000000000000 --- a/build/tasks/GenerateSharedFrameworkMetadataFiles.cs +++ /dev/null @@ -1,154 +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 System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Microsoft.Extensions.DependencyModel; -using NuGet.Common; -using NuGet.ProjectModel; -using RepoTasks.Utilities; - -namespace RepoTasks -{ - public class GenerateSharedFrameworkMetadataFiles : Task - { - [Required] - public string AssetsFilePath { get; set; } - - [Required] - public string DepsFilePath { get; set; } - - [Required] - public string DepsFileOutputPath { get; set; } - - [Required] - public string TargetFramework { get; set; } - - [Required] - public string FrameworkName { get; set; } - - [Required] - public string FrameworkVersion { get; set; } - - [Required] - public string BaseRuntimeIdentifier { get; set; } - - [Required] - public string PlatformManifestOutputPath { get; set; } - - public override bool Execute() - { - ExecuteCore(); - - return !Log.HasLoggedErrors; - } - - private void ExecuteCore() - { - DependencyContext context; - using (var depsStream = File.OpenRead(DepsFilePath)) - { - context = new DependencyContextJsonReader().Read(depsStream); - } - - var lockFile = LockFileUtilities.GetLockFile(AssetsFilePath, NullLogger.Instance); - if (lockFile == null) - { - throw new ArgumentException($"Could not load a LockFile at '{AssetsFilePath}'.", nameof(AssetsFilePath)); - } - - var manager = new RuntimeGraphManager(); - var graph = manager.Collect(lockFile); - var expandedGraph = manager.Expand(graph, BaseRuntimeIdentifier); - - var runtimeFiles = new List(); - var nativeFiles = new List(); - var resourceAssemblies = new List(); - var platformManifest = new List(); - - foreach (var library in context.RuntimeLibraries) - { - foreach (var file in library.RuntimeAssemblyGroups.SelectMany(g => g.RuntimeFiles)) - { - var fileName = Path.GetFileName(file.Path); - var path = $"runtimes/{context.Target.Runtime}/lib/{TargetFramework}/{fileName}"; - runtimeFiles.Add( - new RuntimeFile( - path, - file.AssemblyVersion, - file.FileVersion)); - - platformManifest.Add($"{fileName}|{FrameworkName}|{file.AssemblyVersion}|{file.FileVersion}"); - } - - foreach (var file in library.NativeLibraryGroups.SelectMany(g => g.RuntimeFiles)) - { - var fileName = Path.GetFileName(file.Path); - var path = $"runtimes/{context.Target.Runtime}/native/{fileName}"; - nativeFiles.Add( - new RuntimeFile( - path, - file.AssemblyVersion, - file.FileVersion)); - - if (!Version.TryParse(file.FileVersion, out var fileVersion)) - { - fileVersion = new Version(0, 0, 0, 0); - } - platformManifest.Add($"{fileName}|{FrameworkName}||{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(), - hashPath: null, - path: $"{runtimePackageName.ToLowerInvariant()}/{FrameworkVersion}", - serviceable: true); - - var targetingPackLibrary = new RuntimeLibrary("package", - FrameworkName, - FrameworkVersion, - string.Empty, - Array.Empty(), - Array.Empty(), - 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(), - new[] { targetingPackLibrary, runtimeLibrary }, - expandedGraph - ); - - Directory.CreateDirectory(Path.GetDirectoryName(PlatformManifestOutputPath)); - Directory.CreateDirectory(Path.GetDirectoryName(DepsFileOutputPath)); - - File.WriteAllLines(PlatformManifestOutputPath, platformManifest.OrderBy(n => n)); - - using (var depsStream = File.Create(DepsFileOutputPath)) - { - new DependencyContextWriter().Write(context, depsStream); - } - } - } -} diff --git a/build/tasks/RepoTasks.tasks b/build/tasks/RepoTasks.tasks index c7160bfd924e..39f085fd04f9 100644 --- a/build/tasks/RepoTasks.tasks +++ b/build/tasks/RepoTasks.tasks @@ -3,10 +3,8 @@ <_RepoTaskAssembly>$(MSBuildThisFileDirectory)bin\publish\RepoTasks.dll - - diff --git a/build/tasks/RuntimeGraphManager.cs b/build/tasks/RuntimeGraphManager.cs deleted file mode 100644 index 82f373ef8dfd..000000000000 --- a/build/tasks/RuntimeGraphManager.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. 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 Microsoft.Extensions.DependencyModel; -using NuGet.Packaging; -using NuGet.ProjectModel; -using NuGet.RuntimeModel; - -namespace RepoTasks.Utilities -{ - internal class RuntimeGraphManager - { - private const string RuntimeJsonFileName = "runtime.json"; - - public RuntimeGraph Collect(LockFile lockFile) - { - string userPackageFolder = lockFile.PackageFolders.FirstOrDefault()?.Path; - var fallBackFolders = lockFile.PackageFolders.Skip(1).Select(f => f.Path); - var packageResolver = new FallbackPackagePathResolver(userPackageFolder, fallBackFolders); - - var graph = RuntimeGraph.Empty; - foreach (var library in lockFile.Libraries) - { - if (string.Equals(library.Type, "package", StringComparison.OrdinalIgnoreCase)) - { - var runtimeJson = library.Files.FirstOrDefault(f => f == RuntimeJsonFileName); - if (runtimeJson != null) - { - var libraryPath = packageResolver.GetPackageDirectory(library.Name, library.Version); - var runtimeJsonFullName = Path.Combine(libraryPath, runtimeJson); - graph = RuntimeGraph.Merge(graph, JsonRuntimeFormat.ReadRuntimeGraph(runtimeJsonFullName)); - } - } - } - return graph; - } - - public IEnumerable Expand(RuntimeGraph runtimeGraph, string runtime) - { - var importers = FindImporters(runtimeGraph, runtime); - foreach (var importer in importers) - { - // ExpandRuntime return runtime itself as first item so we are skiping it - yield return new RuntimeFallbacks(importer, runtimeGraph.ExpandRuntime(importer).Skip(1)); - } - } - - private IEnumerable FindImporters(RuntimeGraph runtimeGraph, string runtime) - { - foreach (var runtimePair in runtimeGraph.Runtimes) - { - var expanded = runtimeGraph.ExpandRuntime(runtimePair.Key); - if (expanded.Contains(runtime)) - { - yield return runtimePair.Key; - } - } - } - } -} diff --git a/docs/ProjectProperties.md b/docs/ProjectProperties.md index 939c7c8bcd5f..a05fa69bdeac 100644 --- a/docs/ProjectProperties.md +++ b/docs/ProjectProperties.md @@ -6,4 +6,4 @@ In addition to the standard set of MSBuild properties supported by Microsoft.NET Property name | Meaning -------------------|-------------------------------------------------------------------------------------------- IsShippingPackage | When set to `true`, the package produced by from project is intended for use by customers. Defaults to `false`, which means the package is intended for internal use only by Microsoft teams. -IsAspNetCoreApp | Set to `true` when the assembly is part of the [Microsoft.AspNetCore.App shared framework](./SharedFramework.md) \ No newline at end of file +IsAspNetCoreApp | Set to `true` when the assembly is part of the [Microsoft.AspNetCore.App shared framework](./SharedFramework.md) and is not available as a NuGet package (unless IsShippingPackage is also set to `true`). diff --git a/eng/targets/ResolveReferences.targets b/eng/targets/ResolveReferences.targets index 56e19a596abf..be1f3a9aac68 100644 --- a/eng/targets/ResolveReferences.targets +++ b/eng/targets/ResolveReferences.targets @@ -126,6 +126,11 @@ Text="Cannot reference "%(_InvalidReferenceToNonSharedFxAssembly.Identity)". This dependency is not in the shared framework. See docs/SharedFramework.md for instructions on how to modify what is in the shared framework." /> + + + + - - $(RestoreSources); - $(ArtifactsShippingPackagesDir); - $(ArtifactsNonShippingPackagesDir) - + + Microsoft.AspNetCore.App.PlatformManifest.txt + $(ArtifactsObjDir)$(PlatformManifestFileName) + diff --git a/src/Framework/pkg/Metapackage.targets b/src/Framework/pkg/Metapackage.targets deleted file mode 100644 index d8831bbf4d77..000000000000 --- a/src/Framework/pkg/Metapackage.targets +++ /dev/null @@ -1,121 +0,0 @@ - - - - false - - false - - false - - true - - false - - - true - - $(MSBuildProjectName) - $(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg - - - - - - - - - - - - - - - - - $(PackageId) - - - - - - - - - - <_SupportedRids Include="$(SupportedRuntimeIdentifiers)" /> - - - - - -{ - "runtimes": { - @(_SupportedRids->'"%(Identity)": { "$(PackageId)": { "runtime.%(Identity).$(PackageId)": "$(PackageVersion)" } }', ',%0A ') - } -} - - - - - - - - - - <_AspNetAppPackageConflictOverrides Include="@(AspNetCoreAppReference->'%(Identity)|%(Version)')" Condition=" '%(AspNetCoreAppReference.Version)' != '' " /> - <_AspNetAppPackageConflictOverrides Include="@(AspNetCoreAppReferenceAndPackage->'%(Identity)|%(Version)')" Condition=" '%(AspNetCoreAppReferenceAndPackage.Version)' != '' " /> - <_AspNetAppPackageConflictOverrides Include="@(ExternalAspNetCoreAppReference->'%(Identity)|%(Version)')" Condition=" '%(ExternalAspNetCoreAppReference.Version)' != '' " /> - - - - - - - - - - - - - - @(_AspNetAppPackageConflictOverrides, '%3B%0A ')%3B - - - - -]]> - - - - - - - - - - ref/$(TargetFramework)/%(ReferencePath.FileName)%(ReferencePath.Extension) - - - build/$(TargetFramework)/Microsoft.AspNetCore.App.PlatformManifest.txt - - - build/$(TargetFramework)/Microsoft.AspNetCore.App.props - - - - - - - - diff --git a/src/Framework/pkg/Microsoft.AspNetCore.App.pkgproj b/src/Framework/pkg/Microsoft.AspNetCore.App.pkgproj deleted file mode 100644 index 13cf74ed9e75..000000000000 --- a/src/Framework/pkg/Microsoft.AspNetCore.App.pkgproj +++ /dev/null @@ -1,38 +0,0 @@ - - - true - $(MSBuildProjectName).Pkg - - - false - - - - - - netcoreapp3.0 - aspnetcore - true - 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. - - true - - - - - - - - - - false - true - _ResolvedFxProjects - - - - - - diff --git a/src/Framework/pkg/Microsoft.AspNetCore.App.targets b/src/Framework/pkg/Microsoft.AspNetCore.App.targets deleted file mode 100644 index e173a444084b..000000000000 --- a/src/Framework/pkg/Microsoft.AspNetCore.App.targets +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - <_Parameter1>$(UserSecretsId.Trim()) - - - - diff --git a/src/Framework/pkg/_._ b/src/Framework/pkg/_._ deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj index 5d0b9d964949..65e002ea3f57 100644 --- a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj +++ b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj @@ -25,7 +25,10 @@ This package is an internal implementation of the .NET Core SDK and is not meant DotnetPlatform ref/$(TargetFramework)/ - $(TargetingPackLayoutRoot)packs/Microsoft.AspNetCore.App.Ref/$(PackageVersion)/ + packs\Microsoft.AspNetCore.App.Ref\$(PackageVersion)\ + $(TargetingPackLayoutRoot)$(TargetingPackSubPath) + $(LocalDotNetRoot)$(TargetingPackSubPath) + aspnetcore-targeting-pack-$(PackageVersion).zip aspnetcore-targeting-pack-$(PackageVersion).tar.gz $(InstallersOutputPath)$(ArchiveOutputFileName) @@ -45,7 +48,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant false PackageOverrides.txt - data/ + data/ true @@ -54,6 +57,12 @@ This package is an internal implementation of the .NET Core SDK and is not meant + + + + false + true + @@ -65,6 +74,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant GeneratePackageConflictManifest; _ResolveTargetingPackContent; _BatchCopyToLayoutTargetDir; + _InstallTargetingPackIntoLocalDotNet; _CreateTargetingPackArchive; @@ -93,7 +103,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant - + + <_PackageFiles Include="@(RefPackContent)" /> @@ -125,6 +136,21 @@ This package is an internal implementation of the .NET Core SDK and is not meant + + + + + + + + + + diff --git a/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj b/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj index 024bd9f6a183..57b4f31400df 100644 --- a/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj +++ b/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj @@ -13,6 +13,7 @@ false $(MSBuildProjectName).$(RuntimeIdentifier) + $(SharedFxVersion) true false Provides a default set of APIs for building an ASP.NET Core application. Contains assets used for self-contained deployments. @@ -24,11 +25,29 @@ This package is an internal implementation of the .NET Core SDK and is not meant true DotnetPlatform + shared\$(SharedFxName)\$(SharedFxVersion)\ + $(SharedFrameworkLayoutRoot)$(SharedRuntimeSubPath) + $(RedistSharedFrameworkLayoutRoot)$(SharedRuntimeSubPath) + $(LocalDotNetRoot)$(SharedRuntimeSubPath) + + $(InternalInstallerBaseName)-$(PackageVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension) + $(InstallersOutputPath)$(InternalArchiveOutputFileName) + $(RuntimeInstallerBaseName)-$(PackageVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension) + $(InstallersOutputPath)$(BundleArchiveOutputFileName) + + + aspnetcore_base_runtime.version + $(InstallersOutputPath)$(BaseRuntimeVersionFileName) + runtimes/$(RuntimeIdentifier)/lib/ runtimes/$(RuntimeIdentifier)/native/ + dotnet-runtime-$(MicrosoftNETCoreAppPackageVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension) + $(DotNetAssetRootUrl)Runtime/$(MicrosoftNETCoreAppPackageVersion)/$(DotNetRuntimeArchiveFileName) + $(BaseIntermediateOutputPath)$(DotNetRuntimeArchiveFileName) + .pdb @@ -53,6 +72,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant $(IntermediateOutputPath)ignoreme.dev.runtimeconfig.json + $(IntermediateOutputPath).version + none false @@ -93,6 +114,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant $(NuGetPackageRoot)/runtime.$(RuntimeIdentifier).microsoft.netcore.app/$(MicrosoftNETCoreAppPackageVersion)/ $(RuntimePackageRoot)tools/$(CrossgenToolPackagePath) + $(AssetTargetFallback);native,Version=0.0 @@ -104,12 +126,12 @@ This package is an internal implementation of the .NET Core SDK and is not meant Platform=$(TargetArchitecture) Platform=Win32 - - false - - true - TargetFramework + + true + _ResolvedNativeProjectReferencePaths + + Build;GetTargetPath @@ -130,7 +152,15 @@ This package is an internal implementation of the .NET Core SDK and is not meant $(CoreBuildDependsOn); GenerateSharedFxDepsFile; + GenerateSharedFxVersionsFiles; Crossgen; + _ResolveSharedFrameworkContent; + _DownloadAndExtractDotNetRuntime; + _BatchCopyToSharedFrameworkLayout; + _BatchCopyToRedistLayout; + _CreateInternalSharedFxArchive; + _CreateRedistSharedFxArchive; + _InstallFrameworkIntoLocalDotNet; ResolveReferences; @@ -175,10 +205,10 @@ This package is an internal implementation of the .NET Core SDK and is not meant - + - - + + @@ -198,7 +228,26 @@ This package is an internal implementation of the .NET Core SDK and is not meant FrameworkVersion="$(SharedFxVersion)" References="@(_RuntimeReference)" RuntimeIdentifier="$(RuntimeIdentifier)" - RuntimePackageName="$(PackageId)" /> + RuntimePackageName="$(PackageId)" + PlatformManifestOutputPath="$(PlatformManifestOutputPath)" /> + + + + + + + + + + + + @@ -237,6 +286,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant + + + @@ -294,4 +346,99 @@ This package is an internal implementation of the .NET Core SDK and is not meant StandardOutputImportance="High" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Framework/src/Microsoft.AspNetCore.App.shfxproj b/src/Framework/src/Microsoft.AspNetCore.App.shfxproj deleted file mode 100644 index a5c0d7dd65cd..000000000000 --- a/src/Framework/src/Microsoft.AspNetCore.App.shfxproj +++ /dev/null @@ -1,56 +0,0 @@ - - - true - $(TargetOsName)-$(TargetArchitecture) - fx - - - - - - $(TargetRuntimeIdentifier) - $(DefaultNetCoreTargetFramework) - Microsoft.NETCore.App - true - - - true - - - true - false - - - true - - false - - - false - false - - - none - false - false - false - - - runtime.$(TargetRuntimeIdentifier).$(MSBuildProjectName) - 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. - - true - - true - $(MSBuildThisFileDirectory)runtime.fx.nuspec - aspnetcore;shared-framework - - true - - - - - - diff --git a/src/Framework/src/SharedFx.targets b/src/Framework/src/SharedFx.targets deleted file mode 100644 index 9ecc0338045c..000000000000 --- a/src/Framework/src/SharedFx.targets +++ /dev/null @@ -1,388 +0,0 @@ - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - BuildOnlySettings; - PrepareForBuild; - PreBuildEvent; - ResolveReferences; - GenerateSharedFxVersionsFile; - GenerateBuildDependencyFile; - PrepareForPublish; - GenerateBuildRuntimeConfigurationFiles; - ComputeAndCopyFilesToPublishDirectory; - GeneratePublishDependencyFile; - GenerateSharedFxMetadataFiles; - CopySharedFxToOutput; - CollectSharedFxOutput; - PostBuildEvent; - GetTargetPath; - PrepareForRun; - - - - PrepareForCrossGen; - CrossGenAssemblies; - CrossGenSymbols; - - - - PrepareOutputPaths; - - - - BeforeResolveReferences; - AssignProjectConfiguration; - ResolveProjectReferences; - FindInvalidProjectReferences; - AfterResolveReferences - - - - CollectSharedFxOutput; - GetCopyToSharedFrameworkItems; - InstallFrameworkIntoLocalDotNet; - - - - $(MSBuildProjectName) - - lib - .so - .dll - .dylib - .exe - - : - %3B - - $(IntermediateOutputPath)$(TargetRuntimeIdentifier)\ - - - $(IntermediateOutputPath)u\ - - - false - - $(OutputPath)manifest\ - $(OutputPath)files\ - $(OutputPath)symbols\ - $(OutputPath)native\ - $(OutputPath)lib\$(TargetFramework)\ - $(LocalDotNetRoot)shared\$(SharedFxName)\$(SharedFxVersion)\ - - $(IntermediateOutputPath)crossgen\ - - crossgen - $(CrossGenExecutable).exe - - $(CrossGenExecutable) - - x64_arm\$(CrossGenTool) - x64_arm64\$(CrossGenTool) - x86_arm\$(CrossGenTool) - - - $(BaseSharedFrameworkName) - - $(IntermediateOutputPath)$(SharedFxName).runtimeconfig.dev.json - - $(IntermediateOutputPath)$(SharedFxName).intermediate.deps.json - $(ProjectDepsFilePath) - - - $(MetadataOutputPath)$(SharedFxName).runtimeconfig.json - - $(PublishRuntimeConfigFilePath) - $(MetadataOutputPath)$(SharedFxName).deps.json - $(MetadataOutputPath).version - $(ManifestOutputDir)$(SharedFxName).PlatformManifest.txt - - - - - - - - - - - - - $(MetadataOutputPath); - $(RuntimeAssetsOutputPath); - $(NativeAssetsOutputPath); - - $(MetadataOutputPath) - $(RuntimeAssetsOutputPath) - $(NativeAssetsOutputPath) - - $(ManifestOutputDir) - $(SharedFxName) - $(PackageId) - - - - - - - - - - - Runtime;Native - true - - - - - - - - - - - <_UnknownRid Remove="@(_UnknownRid)" /> - <_UnknownRid Include="$(TargetRuntimeIdentifier)" Exclude="$(SupportedRuntimeIdentifiers)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Microsoft.NETCore.App - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %(FullPath) - $(IntermediateOutputPath)%(RecursiveDir)%(Filename).rsp - $(IntermediateOutputPath)%(RecursiveDir)%(Filename).symbols.rsp - $(SymbolsOutputPath)%(RecursiveDir)%(Filename).ni.pdb - $(RuntimeAssetsOutputPath)%(RecursiveDir)%(Filename)%(Extension) - %(RecursiveDir)%(Filename)%(Extension) - $(SymbolsOutputPath)%(RecursiveDir) - - - - - - - - - - - <_PlatformAssemblyPaths Remove="@(_PlatformAssemblyPaths)" /> - <_PlatformAssemblyPaths Include="$(CrossGenToolDir)" /> - <_PlatformAssemblyPaths Include="$(PublishDir)" /> - - - - @(_PlatformAssemblyPaths->Distinct(), '$(PathSeparator)') - - - - - - - - - - - - - - - - - - - - - - CreatePerfMap - CreatePDB - - - - - - - - - - - - - - - - - - - - - - - id=$(PackageId); - version=$(PackageVersion); - authors=$(Authors); - rid=$(TargetRuntimeIdentifier); - description=$(PackageDescription); - tags=$(PackageTags.Replace(';', ' ')); - licenseUrl=$(PackageLicenseUrl); - projectUrl=$(PackageProjectUrl); - iconUrl=$(PackageIconUrl); - repositoryUrl=$(RepositoryUrl); - repositoryCommit=$(SourceRevisionId); - copyright=$(Copyright); - targetFramework=$(TargetFramework); - symbolsAssets=$([MSBuild]::NormalizeDirectory($(SymbolsOutputPath))); - nativeAssets=$([MSBuild]::NormalizeDirectory($(NativeAssetsOutputPath))); - runtimeAssets=$([MSBuild]::NormalizeDirectory($(RuntimeAssetsOutputPath))); - - - - - - - - - - - - - diff --git a/src/Framework/src/_._ b/src/Framework/src/_._ deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/Framework/src/runtime.fx.nuspec b/src/Framework/src/runtime.fx.nuspec deleted file mode 100644 index 292d128d1b5a..000000000000 --- a/src/Framework/src/runtime.fx.nuspec +++ /dev/null @@ -1,24 +0,0 @@ - - - - $id$ - $version$ - $authors$ - $licenseUrl$ - $projectUrl$ - $iconUrl$ - $description$ - $copyright$ - $tags$ - - true - true - - - - - - - - - diff --git a/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj b/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj index 5ab3b47fc145..87365c13b8a5 100644 --- a/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj +++ b/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj @@ -3,12 +3,21 @@ netcoreapp3.0 Microsoft.AspNetCore + + false + <_ExpectedSharedFrameworkBinaries Include="@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference);@(_TransitiveExternalAspNetCoreAppReference)" /> + <_ExpectedSharedFrameworkBinaries Condition="'$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' != 'arm'" Include="aspnetcorev2_inprocess" /> + + + <_Parameter1>SharedFxVersion + <_Parameter2>$(SharedFxVersion) + - <_Parameter1>PackageVersion - <_Parameter2>$(PackageVersion) + <_Parameter1>TargetingPackVersion + <_Parameter2>$(TargetingPackVersion) <_Parameter1>TargetRuntimeIdentifier @@ -18,6 +27,18 @@ <_Parameter1>MicrosoftNETCoreAppPackageVersion <_Parameter2>$(RuntimeFrameworkVersion) + + <_Parameter1>SharedFxDependencies + <_Parameter2>@(_ExpectedSharedFrameworkBinaries) + + + <_Parameter1>SharedFrameworkLayoutRoot + <_Parameter2>$(SharedFrameworkLayoutRoot) + + + <_Parameter1>TargetingPackLayoutRoot + <_Parameter2>$(TargetingPackLayoutRoot) + @@ -25,34 +46,22 @@ - + false - _ResolvedFrameworkReference + true + + + false + true - + <_Parameter1>RepositoryCommit <_Parameter2>$(SourceRevisionId) - - <_Parameter1>SharedFxDependencies - <_Parameter2>@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference);@(_TransitiveExternalAspNetCoreAppReference) - - - <_Parameter1>MetadataOutputPath - <_Parameter2>%(_ResolvedFrameworkReference.MetadataOutputPath) - - - <_Parameter1>ManifestOutputDir - <_Parameter2>%(_ResolvedFrameworkReference.ManifestOutputDir) - - - <_Parameter1>RuntimeAssetsOutputPath - <_Parameter2>%(_ResolvedFrameworkReference.RuntimeAssetsOutputPath) - diff --git a/src/Framework/test/SharedFxTests.cs b/src/Framework/test/SharedFxTests.cs index 140a1a2ac134..8a3a13320dc9 100644 --- a/src/Framework/test/SharedFxTests.cs +++ b/src/Framework/test/SharedFxTests.cs @@ -15,19 +15,21 @@ public class SharedFxTests { private readonly string _expectedTfm; private readonly string _expectedRid; + private readonly string _sharedFxRoot; private readonly ITestOutputHelper _output; public SharedFxTests(ITestOutputHelper output) { _output = output; - _expectedTfm = "netcoreapp" + TestData.GetPackageVersion().Substring(0, 3); + _expectedTfm = "netcoreapp" + TestData.GetSharedFxVersion().Substring(0, 3); _expectedRid = TestData.GetSharedFxRuntimeIdentifier(); + _sharedFxRoot = Path.Combine(TestData.GetTestDataValue("SharedFrameworkLayoutRoot"), "shared", "Microsoft.AspNetCore.App", TestData.GetSharedFxVersion()); } [Fact] public void SharedFrameworkContainsExpectedFiles() { - var actualAssemblies = Directory.GetFiles(TestData.GetTestDataValue("RuntimeAssetsOutputPath"), "*.dll") + var actualAssemblies = Directory.GetFiles(_sharedFxRoot, "*.dll") .Select(Path.GetFileNameWithoutExtension) .ToHashSet(); var expectedAssemblies = TestData.GetSharedFxDependencies() @@ -51,71 +53,13 @@ public void SharedFrameworkContainsExpectedFiles() Assert.Empty(unexpected); } - [Fact] - public void PlatformManifestListsAllFiles() - { - var platformManifestPath = Path.Combine(TestData.GetManifestOutputDir(), "Microsoft.AspNetCore.App.PlatformManifest.txt"); - var expectedAssemblies = TestData.GetSharedFxDependencies() - .Split(';', StringSplitOptions.RemoveEmptyEntries) - .ToHashSet(); - - _output.WriteLine("==== file contents ===="); - _output.WriteLine(File.ReadAllText(platformManifestPath)); - _output.WriteLine("==== expected assemblies ===="); - _output.WriteLine(string.Join('\n', expectedAssemblies.OrderBy(i => i))); - - AssertEx.FileExists(platformManifestPath); - - var manifestFileLines = File.ReadAllLines(platformManifestPath); - - var actualAssemblies = manifestFileLines - .Where(s => !string.IsNullOrEmpty(s)) - .Select(i => - { - var fileName = i.Split('|')[0]; - return fileName.EndsWith(".dll", StringComparison.Ordinal) - ? fileName.Substring(0, fileName.Length - 4) - : fileName; - }) - .ToHashSet(); - - var missing = expectedAssemblies.Except(actualAssemblies); - var unexpected = actualAssemblies.Except(expectedAssemblies) - .Where(s => !string.Equals(s, "aspnetcorev2_inprocess", StringComparison.Ordinal)); // this native assembly only appears in Windows builds. - - if (_expectedRid.StartsWith("win", StringComparison.Ordinal) && !_expectedRid.Contains("arm")) - { - Assert.Contains("aspnetcorev2_inprocess", actualAssemblies); - } - - _output.WriteLine("==== missing assemblies from the manifest ===="); - _output.WriteLine(string.Join('\n', missing)); - _output.WriteLine("==== unexpected assemblies in the manifest ===="); - _output.WriteLine(string.Join('\n', unexpected)); - - Assert.Empty(missing); - Assert.Empty(unexpected); - - Assert.All(manifestFileLines, line => - { - var parts = line.Split('|'); - Assert.Equal(4, parts.Length); - Assert.Equal("Microsoft.AspNetCore.App", parts[1]); - if (parts[2].Length > 0) - { - Assert.True(Version.TryParse(parts[2], out _), "Assembly version must be convertable to System.Version"); - } - Assert.True(Version.TryParse(parts[3], out _), "File version must be convertable to System.Version"); - }); - } - [Fact] public void ItContainsValidRuntimeConfigFile() { - var runtimeConfigFilePath = Path.Combine(TestData.GetMetadataOutput(), "Microsoft.AspNetCore.App.runtimeconfig.json"); + var runtimeConfigFilePath = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.runtimeconfig.json"); AssertEx.FileExists(runtimeConfigFilePath); - AssertEx.FileDoesNotExists(Path.Combine(TestData.GetMetadataOutput(), "Microsoft.AspNetCore.App.runtimeconfig.dev.json")); + AssertEx.FileDoesNotExists(Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.runtimeconfig.dev.json")); var runtimeConfig = JObject.Parse(File.ReadAllText(runtimeConfigFilePath)); @@ -128,10 +72,11 @@ public void ItContainsValidRuntimeConfigFile() [Fact] public void ItContainsValidDepsJson() { - var depsFilePath = Path.Combine(TestData.GetMetadataOutput(), "Microsoft.AspNetCore.App.deps.json"); + var depsFilePath = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.deps.json"); - var target = $".NETCoreApp,Version=v{TestData.GetPackageVersion().Substring(0, 3)}/{_expectedRid}"; - var ridPackageId = $"runtime.{_expectedRid}.Microsoft.AspNetCore.App"; + var target = $".NETCoreApp,Version=v{TestData.GetSharedFxVersion().Substring(0, 3)}/{_expectedRid}"; + var ridPackageId = $"Microsoft.AspNetCore.App.Runtime.{_expectedRid}"; + var libraryId = $"{ridPackageId}/{TestData.GetSharedFxVersion()}"; AssertEx.FileExists(depsFilePath); @@ -140,7 +85,6 @@ public void ItContainsValidDepsJson() Assert.Equal(target, (string)depsFile["runtimeTarget"]["name"]); Assert.NotNull(depsFile["compilationOptions"]); Assert.Empty(depsFile["compilationOptions"]); - Assert.NotEmpty(depsFile["runtimes"][_expectedRid]); Assert.All(depsFile["libraries"], item => { var prop = Assert.IsType(item); @@ -149,24 +93,22 @@ public void ItContainsValidDepsJson() Assert.Empty(lib["sha512"].Value()); }); - Assert.NotNull(depsFile["libraries"][$"Microsoft.AspNetCore.App/{TestData.GetPackageVersion()}"]); - Assert.NotNull(depsFile["libraries"][$"runtime.{_expectedRid}.Microsoft.AspNetCore.App/{TestData.GetPackageVersion()}"]); - Assert.Equal(2, depsFile["libraries"].Values().Count()); + Assert.NotNull(depsFile["libraries"][libraryId]); + Assert.Single(depsFile["libraries"].Values()); 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.Single(targetLibraries.Values()); + var runtimeLibrary = targetLibraries[libraryId]; Assert.Null(runtimeLibrary["dependencies"]); Assert.All(runtimeLibrary["runtime"], item => { var obj = Assert.IsType(item); - Assert.StartsWith($"runtimes/{_expectedRid}/lib/{_expectedTfm}/", obj.Name); - Assert.NotEmpty(obj.Value["assemblyVersion"].Value()); - Assert.NotEmpty(obj.Value["fileVersion"].Value()); + var assemblyVersion = obj.Value["assemblyVersion"].Value(); + Assert.NotEmpty(assemblyVersion); + Assert.True(Version.TryParse(assemblyVersion, out _), $"{assemblyVersion} should deserialize to System.Version"); + var fileVersion = obj.Value["fileVersion"].Value(); + Assert.NotEmpty(fileVersion); + Assert.True(Version.TryParse(fileVersion, out _), $"{fileVersion} should deserialize to System.Version"); }); if (_expectedRid.StartsWith("win", StringComparison.Ordinal) && !_expectedRid.Contains("arm")) @@ -174,7 +116,9 @@ public void ItContainsValidDepsJson() Assert.All(runtimeLibrary["native"], item => { var obj = Assert.IsType(item); - Assert.StartsWith($"runtimes/{_expectedRid}/native/", obj.Name); + var fileVersion = obj.Value["fileVersion"].Value(); + Assert.NotEmpty(fileVersion); + Assert.True(Version.TryParse(fileVersion, out _), $"{fileVersion} should deserialize to System.Version"); }); } else @@ -186,12 +130,12 @@ public void ItContainsValidDepsJson() [Fact] public void ItContainsVersionFile() { - var versionFile = Path.Combine(TestData.GetMetadataOutput(), ".version"); + var versionFile = Path.Combine(_sharedFxRoot, ".version"); AssertEx.FileExists(versionFile); var lines = File.ReadAllLines(versionFile); Assert.Equal(2, lines.Length); Assert.Equal(TestData.GetRepositoryCommit(), lines[0]); - Assert.Equal(TestData.GetPackageVersion(), lines[1]); + Assert.Equal(TestData.GetSharedFxVersion(), lines[1]); } } } diff --git a/src/Framework/test/TargetingPackTests.cs b/src/Framework/test/TargetingPackTests.cs new file mode 100644 index 000000000000..68832e2842ed --- /dev/null +++ b/src/Framework/test/TargetingPackTests.cs @@ -0,0 +1,79 @@ +// 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 System.Collections.Generic; +using System.IO; +using System.Linq; +using Newtonsoft.Json.Linq; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.AspNetCore +{ + public class TargetingPackTests + { + private readonly string _expectedRid; + private readonly string _targetingPackRoot; + private readonly ITestOutputHelper _output; + + public TargetingPackTests(ITestOutputHelper output) + { + _output = output; + _expectedRid = TestData.GetSharedFxRuntimeIdentifier(); + _targetingPackRoot = Path.Combine(TestData.GetTestDataValue("TargetingPackLayoutRoot"), "packs", "Microsoft.AspNetCore.App.Ref", TestData.GetTestDataValue("TargetingPackVersion")); + } + + [Fact] + public void PlatformManifestListsAllFiles() + { + var platformManifestPath = Path.Combine(_targetingPackRoot, "data", "Microsoft.AspNetCore.App.PlatformManifest.txt"); + var expectedAssemblies = TestData.GetSharedFxDependencies() + .Split(';', StringSplitOptions.RemoveEmptyEntries) + .ToHashSet(); + + _output.WriteLine("==== file contents ===="); + _output.WriteLine(File.ReadAllText(platformManifestPath)); + _output.WriteLine("==== expected assemblies ===="); + _output.WriteLine(string.Join('\n', expectedAssemblies.OrderBy(i => i))); + + AssertEx.FileExists(platformManifestPath); + + var manifestFileLines = File.ReadAllLines(platformManifestPath); + + var actualAssemblies = manifestFileLines + .Where(s => !string.IsNullOrEmpty(s)) + .Select(i => + { + var fileName = i.Split('|')[0]; + return fileName.EndsWith(".dll", StringComparison.Ordinal) + ? fileName.Substring(0, fileName.Length - 4) + : fileName; + }) + .ToHashSet(); + + var missing = expectedAssemblies.Except(actualAssemblies); + var unexpected = actualAssemblies.Except(expectedAssemblies); + + _output.WriteLine("==== missing assemblies from the manifest ===="); + _output.WriteLine(string.Join('\n', missing)); + _output.WriteLine("==== unexpected assemblies in the manifest ===="); + _output.WriteLine(string.Join('\n', unexpected)); + + Assert.Empty(missing); + Assert.Empty(unexpected); + + Assert.All(manifestFileLines, line => + { + var parts = line.Split('|'); + Assert.Equal(4, parts.Length); + Assert.Equal("Microsoft.AspNetCore.App", parts[1]); + if (parts[2].Length > 0) + { + Assert.True(Version.TryParse(parts[2], out _), "Assembly version must be convertable to System.Version"); + } + Assert.True(Version.TryParse(parts[3], out _), "File version must be convertable to System.Version"); + }); + } + } +} diff --git a/src/Framework/test/TestData.cs b/src/Framework/test/TestData.cs index 10d0f2839a30..b81d6af97528 100644 --- a/src/Framework/test/TestData.cs +++ b/src/Framework/test/TestData.cs @@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore { public class TestData { - public static string GetPackageVersion() => GetTestDataValue("PackageVersion"); + public static string GetSharedFxVersion() => GetTestDataValue("SharedFxVersion"); public static string GetMicrosoftNETCoreAppPackageVersion() => GetTestDataValue("MicrosoftNETCoreAppPackageVersion"); @@ -18,10 +18,6 @@ public class TestData public static string GetSharedFxDependencies() => GetTestDataValue("SharedFxDependencies"); - public static string GetMetadataOutput() => GetTestDataValue("MetadataOutputPath"); - - public static string GetManifestOutputDir() => GetTestDataValue("ManifestOutputDir"); - public static string GetTestDataValue(string key) => typeof(TestData).Assembly.GetCustomAttributes().Single(d => d.Key == key).Value; } diff --git a/src/Installers/Archive/Archive.Internal.zipproj b/src/Installers/Archive/Archive.Internal.zipproj deleted file mode 100644 index 35cee32ac934..000000000000 --- a/src/Installers/Archive/Archive.Internal.zipproj +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - $(ArtifactsObjDir)ai\$(TargetRuntimeIdentifier)\ - $(InternalInstallerBaseName)-$(PackageVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension) - $(InstallersOutputPath) - $(InstallersOutputPath)$(OutputFileName) - - - - - false - true - _ResolvedFxProjects - - - - - - - - - - - - - - $(IntermediateOutputPath)shared\%(SharedFxAssetFolder.SharedFxName)\$(PackageVersion)\ - - - - - - - - - - - diff --git a/src/Installers/Archive/Archive.Redist.zipproj b/src/Installers/Archive/Archive.Redist.zipproj deleted file mode 100644 index abb30f65f53d..000000000000 --- a/src/Installers/Archive/Archive.Redist.zipproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - $(ArtifactsObjDir)ar\ - $(BaseIntermediateOutputPath)$(TargetRuntimeIdentifier)\ - $(RuntimeInstallerBaseName)-$(PackageVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension) - $(InstallersOutputPath) - $(InstallersOutputPath)$(OutputFileName) - dotnet-runtime-$(MicrosoftNETCoreAppPackageVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension) - $(DotNetAssetRootUrl)Runtime/$(MicrosoftNETCoreAppPackageVersion)/$(DotNetRuntimeArchiveFileName) - $(BaseIntermediateOutputPath)$(DotNetRuntimeArchiveFileName) - - aspnetcore_base_runtime.version - $(OutputPath)$(BaseRuntimeVersionFileName) - - aspnetcore-runtime-$(TargetRuntimeIdentifier)-version-badge.svg - $(OutputPath)$(SvgBadgeFileName) - - - - - false - true - _ResolvedFxProjects - - - - - - - - - - - - - - - - - version - $(PackageVersion) - #007EC6 - $([MSBuild]::Add(56, $([MSBuild]::Multiply($(PackageVersion.Length), 6.67)))) - - - - - - - - $(SvgBadgeLabel) - $(SvgBadgeLabel) - $(SvgBadgeValue) - $(SvgBadgeValue) - - -]]> - - - - - - - - - - - - - $(IntermediateOutputPath)shared\%(SharedFxAssetFolder.SharedFxName)\$(PackageVersion)\ - - - - - - - - - - - - - - - - - - diff --git a/src/Installers/Debian/Directory.Build.props b/src/Installers/Debian/Directory.Build.props index 80a542cd9b9f..c0e9981de734 100644 --- a/src/Installers/Debian/Directory.Build.props +++ b/src/Installers/Debian/Directory.Build.props @@ -10,8 +10,6 @@ $(InstallersOutputPath) $(IntermediateOutputPath)$(TargetRuntimeIdentifier)\ - - $(IntermediateOutputPath)package_root\ /usr/share/dotnet diff --git a/src/Installers/Debian/Directory.Build.targets b/src/Installers/Debian/Directory.Build.targets index 36e823a338ba..5a5c19191e7f 100644 --- a/src/Installers/Debian/Directory.Build.targets +++ b/src/Installers/Debian/Directory.Build.targets @@ -12,9 +12,10 @@ - + - + + @@ -47,7 +48,7 @@ - + $(PackageId)_$(PackageVersion)-$(PackageRevision)_$(DebianPackageArch).deb diff --git a/src/Installers/Debian/Runtime/Debian.Runtime.debproj b/src/Installers/Debian/Runtime/Debian.Runtime.debproj index cdd7b12d01e2..6baf4c265a4d 100644 --- a/src/Installers/Debian/Runtime/Debian.Runtime.debproj +++ b/src/Installers/Debian/Runtime/Debian.Runtime.debproj @@ -6,6 +6,7 @@ $(RuntimeInstallerBaseName)-$(SharedFxVersion)-x64.deb + $(SharedFrameworkLayoutRoot) $(RuntimeInstallerBaseName)-$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion) @@ -28,29 +29,11 @@ - + + false true - _ResolvedFxProjects - - - $(DebBuildDependsOn);LayoutSharedFramework - - - - - - - - $(IntermediatePackageRoot)shared\%(SharedFxAssetFolder.SharedFxName)\$(SharedFxVersion)\ - - - - - diff --git a/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj b/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj index 5f3508eb2c40..7b78c9f52b1a 100644 --- a/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj +++ b/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj @@ -6,6 +6,8 @@ $(TargetingPackInstallerBaseName)-$(TargetingPackVersion).deb + $(TargetingPackLayoutRoot) + $(TargetingPackInstallerBaseName)-$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion) @@ -19,7 +21,6 @@ - false true @@ -29,19 +30,8 @@ - $(DebBuildDependsOn);LayoutTargetingPack - - - - - - - - diff --git a/src/Installers/Debian/tools/build.sh b/src/Installers/Debian/tools/build.sh index 6bd678c8ef8b..85806ac5aa4f 100755 --- a/src/Installers/Debian/tools/build.sh +++ b/src/Installers/Debian/tools/build.sh @@ -26,7 +26,7 @@ execute(){ package_all generate_all create_source_tarball - + # Actually Build Package Files (cd ${PACKAGE_SOURCE_DIR}; debuild -us -uc) @@ -36,7 +36,7 @@ execute(){ parse_args_and_set_env_vars(){ OPTIND=1 # Reset in case getopts has been used previously in the shell. - while getopts ":n:v:i:o:h" opt; do + while getopts ":n:v:i:o:h:C:" opt; do case $opt in n) export PACKAGE_NAME="$OPTARG" @@ -47,6 +47,9 @@ parse_args_and_set_env_vars(){ i) export INPUT_DIR="$OPTARG" ;; + C) + export CONTENT_DIR="$OPTARG" + ;; o) export OUTPUT_DIR="$OPTARG" ;; @@ -64,21 +67,22 @@ parse_args_and_set_env_vars(){ ;; esac done - + # Special Input Directories + Paths ABSOLUTE_PLACEMENT_DIR="${INPUT_DIR}/\$" - PACKAGE_ROOT_PLACEMENT_DIR="${INPUT_DIR}/package_root" + PACKAGE_ROOT_PLACEMENT_DIR="${CONTENT_DIR}" CONFIG="$INPUT_DIR/debian_config.json" return 0 } print_help(){ - echo "Usage: package_tool [-i ] [-o ] + echo "Usage: package_tool [-i ] [-o ] [-n ] [-v ] [-h] REQUIRED: -i : Input directory conforming to package_tool conventions and debian_config.json + -C : Directory containing the files which should be packaged. -o : Output directory for debian package and other artifacts OPTIONAL: @@ -104,9 +108,11 @@ validate_inputs(){ ret=1 fi - if [[ ! -d "$PACKAGE_ROOT_PLACEMENT_DIR" ]]; then - echo "ERROR: package_root directory does not exist" - echo $PACKAGE_ROOT_PLACEMENT_DIR + if [[ -z "$CONTENT_DIR" ]]; then + echo "ERROR: -C Not Specified." + ret=1 + elif [[ ! -d "$PACKAGE_ROOT_PLACEMENT_DIR" ]]; then + echo "ERROR: '$PACKAGE_ROOT_PLACEMENT_DIR' directory does not exist" ret=1 fi @@ -115,13 +121,13 @@ validate_inputs(){ echo $CONFIG ret=1 fi - + return $ret } parse_config_and_set_env_vars(){ extract_base_cmd="python $SCRIPT_DIR/scripts/extract_json_value.py" - + # Arguments Take Precedence over Config [ -z "$PACKAGE_VERSION" ] && PACKAGE_VERSION="$($extract_base_cmd $CONFIG "release.package_version")" [ -z "$PACKAGE_NAME" ] && PACKAGE_NAME="$($extract_base_cmd $CONFIG "package_name")" @@ -152,7 +158,7 @@ package_all(){ package_absolute_placement package_samples package_docs - package_install_scripts + package_install_scripts } generate_all(){ @@ -187,18 +193,18 @@ package_package_root_placement(){ package_absolute_placement(){ if [[ -d "$ABSOLUTE_PLACEMENT_DIR" ]]; then abs_in_package_dir="\$" - + add_dir_to_install ${ABSOLUTE_PLACEMENT_DIR} $abs_in_package_dir - + # Get List of all files in directory tree, relative to ABSOLUTE_PLACEMENT_DIR abs_files=( $(_get_files_in_dir_tree $ABSOLUTE_PLACEMENT_DIR) ) - + # For each file add a a system placement for abs_file in ${abs_files[@]} do parent_dir=$(dirname $abs_file) filename=$(basename $abs_file) - + add_system_file_placement "$abs_in_package_dir/$abs_file" "/$parent_dir" done fi @@ -232,7 +238,7 @@ generate_config_templates(){ generate_manpages(){ if [[ -f "$DOCS_JSON_PATH" ]]; then mkdir -p $DOCS_DIR - + # Generate the manpages from json spec python ${SCRIPT_DIR}/scripts/manpage_generator.py ${DOCS_JSON_PATH} ${DOCS_DIR} fi diff --git a/src/Installers/Directory.Build.props b/src/Installers/Directory.Build.props deleted file mode 100644 index 8028e6245677..000000000000 --- a/src/Installers/Directory.Build.props +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - aspnetcore-runtime - aspnetcore-targeting-pack - - $(RuntimeInstallerBaseName)-internal - - .tar.gz - .zip - - - diff --git a/src/Installers/Rpm/Directory.Build.targets b/src/Installers/Rpm/Directory.Build.targets index 7f12d09ec823..021da2c25abc 100644 --- a/src/Installers/Rpm/Directory.Build.targets +++ b/src/Installers/Rpm/Directory.Build.targets @@ -16,12 +16,12 @@ - + - + @@ -72,7 +72,7 @@ - + diff --git a/src/Installers/Rpm/Rpm.Runtime.Common.targets b/src/Installers/Rpm/Rpm.Runtime.Common.targets index a64e3eec5c38..141efc28ef12 100644 --- a/src/Installers/Rpm/Rpm.Runtime.Common.targets +++ b/src/Installers/Rpm/Rpm.Runtime.Common.targets @@ -14,34 +14,16 @@ $(SharedFxProductName) $(SharedFxDescription) - $(IntermediateOutputPath)content\ + $(SharedFrameworkLayoutRoot) - + + false true - _ResolvedFxProjects - - - $(RpmBuildDependsOn);LayoutSharedFramework; - - - - - - - $(IntermediatePackageRoot)shared\%(SharedFxAssetFolder.SharedFxName)\$(SharedFxVersion)\ - - - - - - diff --git a/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj b/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj index 6b59d6ddf591..16fc7ecb7ddb 100644 --- a/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj +++ b/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj @@ -5,7 +5,7 @@ /usr/share/dotnet/ $(TargetingPackInstallerBaseName)-$(TargetingPackVersion)-x64.rpm - $(TargetingPackLayoutRoot) + $(TargetingPackLayoutRoot) diff --git a/src/ProjectTemplates/test/GenerateTestProps.targets b/src/ProjectTemplates/test/GenerateTestProps.targets index 5112861a1cae..cd786f2c9210 100644 --- a/src/ProjectTemplates/test/GenerateTestProps.targets +++ b/src/ProjectTemplates/test/GenerateTestProps.targets @@ -7,6 +7,7 @@ MicrosoftNETCorePlatformsPackageVersion=$(MicrosoftNETCorePlatformsPackageVersion); MicrosoftNETSdkRazorPackageVersion=$(MicrosoftNETSdkRazorPackageVersion); MicrosoftAspNetCoreAppPackageVersion=$(SharedFxVersion); + SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers); diff --git a/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj b/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj index 9ab06a140a2e..2b6dbd84735f 100644 --- a/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj +++ b/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj @@ -27,6 +27,10 @@ + + false + true + diff --git a/src/ProjectTemplates/test/TemplateTests.props.in b/src/ProjectTemplates/test/TemplateTests.props.in index ff2c8a9cc41d..807101c20e6b 100644 --- a/src/ProjectTemplates/test/TemplateTests.props.in +++ b/src/ProjectTemplates/test/TemplateTests.props.in @@ -17,7 +17,10 @@ Update="Microsoft.AspNetCore.App" DefaultRuntimeFrameworkVersion="${MicrosoftAspNetCoreAppPackageVersion}" LatestRuntimeFrameworkVersion="${MicrosoftAspNetCoreAppPackageVersion}" - TargetingPackVersion="${MicrosoftAspNetCoreAppPackageVersion}" /> + TargetingPackName="Microsoft.AspNetCore.App.Ref" + TargetingPackVersion="${MicrosoftAspNetCoreAppPackageVersion}" + RuntimePackNamePatterns="Microsoft.NETCore.App.Runtime.**RID**" + RuntimePackRuntimeIdentifiers="${SupportedRuntimeIdentifiers}" /> diff --git a/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json b/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json index 30bf64403a02..bfb196053666 100644 --- a/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json +++ b/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json @@ -1,6 +1,6 @@ { "name": "@aspnet/signalr-protocol-msgpack", - "version": "3.0.0-preview3-t000", + "version": "3.0.0-preview4-t000", "description": "MsgPack Protocol support for ASP.NET Core SignalR", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", diff --git a/src/SignalR/clients/ts/signalr/package.json b/src/SignalR/clients/ts/signalr/package.json index 288d444f2349..c749def5bd8f 100644 --- a/src/SignalR/clients/ts/signalr/package.json +++ b/src/SignalR/clients/ts/signalr/package.json @@ -1,6 +1,6 @@ { "name": "@aspnet/signalr", - "version": "3.0.0-preview3-t000", + "version": "3.0.0-preview4-t000", "description": "ASP.NET Core SignalR Client", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", diff --git a/src/SiteExtensions/LoggingBranch/LoggingBranch.csproj b/src/SiteExtensions/LoggingBranch/LoggingBranch.csproj index b0ad58a7cfef..e2e8ce34fc5c 100644 --- a/src/SiteExtensions/LoggingBranch/LoggingBranch.csproj +++ b/src/SiteExtensions/LoggingBranch/LoggingBranch.csproj @@ -29,14 +29,11 @@ - - Pack + false true - - - Pack + false true diff --git a/src/SiteExtensions/Runtime/Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj b/src/SiteExtensions/Runtime/Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj index 0bd58e2bad24..c439e70ddd17 100644 --- a/src/SiteExtensions/Runtime/Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj +++ b/src/SiteExtensions/Runtime/Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj @@ -11,7 +11,7 @@ aspnetcore;AzureSiteExtension AspNetCoreRuntime.$(TrimmedVersion).$(TargetArchitecture) true - $(ArtifactsObjDir)ar\$(TargetRuntimeIdentifier)\ + $(RedistSharedFrameworkLayoutRoot) true @@ -25,7 +25,10 @@ - + + false + true + From 7e1684318980ac5699d853265650e95b7122c6e6 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 26 Feb 2019 09:02:25 -0800 Subject: [PATCH 2/2] Run RemoveSharedFrameworkOnlyRefsFromNuspec before BuildSharedFx --- build/SharedFx.targets | 2 +- build/repo.targets | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/SharedFx.targets b/build/SharedFx.targets index 9e244b3fca6c..a616306a7024 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -1,6 +1,6 @@ - _BuildSharedFxProjects + _BuildSharedFxProjects;RemoveSharedFrameworkOnlyRefsFromNuspec $(BuildSharedFxDependsOn);CodeSign diff --git a/build/repo.targets b/build/repo.targets index 0d5f9b60f2e3..10dd90399aec 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -24,7 +24,7 @@ $(CompileDependsOn);BuildProjects $(PackageDependsOn);PackProjects - $(PackageDependsOn);BuildSharedFx;RemoveSharedFrameworkOnlyRefsFromNuspec + $(PackageDependsOn);RemoveSharedFrameworkOnlyRefsFromNuspec;BuildSharedFx $(TestDependsOn);Compile