From 7afbe0cb37a0f2b9a06c96bf2350ce816114110a Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 22 Oct 2018 17:04:56 -0700 Subject: [PATCH 1/7] Refactor shared framework build targets This moves the targets used to build the shared framework into a project file. It also makes a few other improvements * No need to generate an intermediate package to run restore * Lays the foundation for future refactorings of hte framework, such as flattening the package graph * Remove shared framework targets from the KoreBuild context --- .editorconfig | 2 +- Directory.Build.props | 19 +- Directory.Build.targets | 3 +- build/SharedFx.props | 9 +- build/SharedFx.targets | 271 +--------------- build/tasks/ProcessSharedFrameworkDeps.cs | 13 +- build/tasks/RepoTasks.tasks | 1 - build/tasks/TrimDeps.cs | 60 ---- build/tasks/Utilities/RuntimeReference.cs | 23 ++ .../tools/templates/SharedFx/SharedFx.csproj | 35 --- eng/targets/SharedFx.Common.props | 43 +++ eng/targets/SharedFx.Common.targets | 294 ++++++++++++++++++ src/Framework/Directory.Build.props | 18 ++ src/Framework/Directory.Build.targets | 6 + .../Microsoft.AspNetCore.All.shfxproj | 37 +++ .../Microsoft.AspNetCore.App.shfxproj | 168 ++++++++++ src/Installers/Directory.Build.props | 14 + src/Installers/Windows/Directory.Build.props | 4 - .../SharedFrameworkLib.wixproj | 3 +- 19 files changed, 638 insertions(+), 385 deletions(-) delete mode 100644 build/tasks/TrimDeps.cs delete mode 100644 build/tools/templates/SharedFx/SharedFx.csproj create mode 100644 eng/targets/SharedFx.Common.props create mode 100644 eng/targets/SharedFx.Common.targets create mode 100644 src/Framework/Directory.Build.props create mode 100644 src/Framework/Directory.Build.targets create mode 100644 src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj create mode 100644 src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj create mode 100644 src/Installers/Directory.Build.props diff --git a/.editorconfig b/.editorconfig index 4eb7559fcef6..35147d7db8a6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,7 +11,7 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.{cs}] +[*.cs] indent_size = 4 dotnet_sort_system_directives_first = true:warning diff --git a/Directory.Build.props b/Directory.Build.props index 813f3db1f2d0..9161640bd45f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -17,12 +17,29 @@ $(RepositoryRoot)artifacts\ $(ArtifactsDir)obj\ + Debug $(ArtifactsDir)$(Configuration)\ $(ArtifactsConfigurationDir)bin\ $(ArtifactsConfigurationDir)packages\ + + AnyCPU + win-$(TargetPlatform) + osx-$(TargetPlatform) + linux-$(TargetPlatform) + + + + win-x64; + win-x86; + osx-x64; + linux-musl-x64; + linux-x64; + linux-arm + - + + diff --git a/Directory.Build.targets b/Directory.Build.targets index ebda4d3771d0..8ad5f961270b 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -8,6 +8,7 @@ 99.9 - + + diff --git a/build/SharedFx.props b/build/SharedFx.props index a32a5f1851ee..14595bab891f 100644 --- a/build/SharedFx.props +++ b/build/SharedFx.props @@ -13,17 +13,10 @@ <_SymbolsSourceDir>$(RepositoryRoot).deps\symbols\ <_DockerRootDir>/opt/code/ <_InstallersOutputDir>$(ArtifactsDir)installers\ - - : - %3B + .tar.gz .zip - lib - .so - .dll - .dylib - .exe netcoreapp2.2 diff --git a/build/SharedFx.targets b/build/SharedFx.targets index b612e5cb2e92..c5fb4c8c3718 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -109,17 +109,7 @@ - - true - false - true - false - true - - - - - + $(_WorkRoot)AppSharedFx\ $(_WorkRoot)AllSharedFx\ $(_WorkRoot)Publish\ @@ -131,10 +121,6 @@ $(SharedFxIntermediateOutputPath)shared\Microsoft.AspNetCore.All\$(PackageVersion)\ $(SharedFxRID) - - : - %3B - Configuration=$(Configuration);RuntimeIdentifier=$(SharedFxRestoreRid) $(CommonSharedFxProps);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath) $(CommonSharedFxProps);DotNetBuildOffline=true @@ -142,261 +128,6 @@ - - - $(CommonSharedFxProps) - $(RestoreProps);SharedFxPackage=$(SharedFxPackage) - $(RestoreProps);SharedFxPackageVersion=$(PackageVersion) - $(RestoreProps);SharedFxBase=$(SharedFxBase) - $(RestoreProps);SharedFxBaseVersion=$(SharedFxBaseVersion) - - - - - - - - - - - - - - - - RepositoryCommit=$(RepositoryCommit);SharedFxWorkDirectory=$(AppSharedFxWorkDirectory) - $(AppSharedFxProps);RuntimeFrameworkVersion=$(MicrosoftNETCoreApp22PackageVersion) - $(AppSharedFxProps);SharedFxPackage=Microsoft.AspNetCore.App - RepositoryCommit=$(RepositoryCommit);SharedFxWorkDirectory=$(AllSharedFxWorkDirectory) - $(AllSharedFxProps);RuntimeFrameworkVersion=$(MicrosoftNETCoreApp22PackageVersion) - $(AllSharedFxProps);SharedFxPackage=Microsoft.AspNetCore.All - $(AllSharedFxProps);SharedFxDep=Microsoft.AspNetCore.App - $(AllSharedFxProps);SharedFxDepVersion=$(PackageVersion) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - win - linux - osx - - - - - - - - - - - - - - - SharedFxPackage=Microsoft.AspNetCore.App - $(AppSharedFxProps);SharedFxWorkDirectory=$(AppSharedFxWorkDirectory) - $(AppSharedFxProps);SharedFxPublishDirectory=$(AppSharedFxPublishDirectory) - SharedFxPackage=Microsoft.AspNetCore.All - $(AllSharedFxProps);SharedFxWorkDirectory=$(AllSharedFxWorkDirectory) - $(AllSharedFxProps);SharedFxPublishDirectory=$(AllSharedFxPublishDirectory) - - - - - - - - - - - Microsoft.NETCore.App - crossgen - $(CrossGenTool).exe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_AppRuntimeAssemblies Include="@(AppPublishAssemblies)" Condition="'%(AssetType)' == 'runtime'"> - %(PackageName).%(PackageVersion).symbols.nupkg - %(RootDir)%(Directory)%(Filename).pdb - - <_AllRuntimeAssemblies Include="@(AllPublishAssemblies)" Exclude="@(_AppRuntimeAssemblies)" Condition="'%(AssetType)' == 'runtime'"> - %(PackageName).%(PackageVersion).symbols.nupkg - %(RootDir)%(Directory)%(Filename).pdb - - - <_AssembliesToCrossgen Include="$(SharedFxIntermediateOutputPath)**\*.dll" /> - - - - - - - - - - - - - - - - - - - - %(FullPath) - $(SharedFxCrossGenRspDirectory)%(RecursiveDir)%(Filename).rsp - $(SharedFxCrossGenRspDirectory)%(RecursiveDir)%(Filename).symbols.rsp - $(SharedFxCrossGenDirectory)%(RecursiveDir)%(Filename)%(Extension) - $(SharedFxCrossGenDirectory)%(RecursiveDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CreatePerfMap - CreatePDB - - - - - - - - - - - - - - - - - runtime.$(SharedFxRID).$(SymbolsNuspecIdSuffix) diff --git a/build/tasks/ProcessSharedFrameworkDeps.cs b/build/tasks/ProcessSharedFrameworkDeps.cs index 87250780a818..db12ad55c663 100644 --- a/build/tasks/ProcessSharedFrameworkDeps.cs +++ b/build/tasks/ProcessSharedFrameworkDeps.cs @@ -14,7 +14,7 @@ namespace RepoTasks { - public partial class ProcessSharedFrameworkDeps : Task + public class ProcessSharedFrameworkDeps : Task { [Required] public string AssetsFilePath { get; set; } @@ -22,6 +22,12 @@ public partial class ProcessSharedFrameworkDeps : Task [Required] public string DepsFilePath { get; set; } + [Required] + public string OutputPath { get; set; } + + [Required] + public string FrameworkName { get; set; } + public string[] PackagesToRemove { get; set; } [Required] @@ -52,7 +58,8 @@ private void ExecuteCore() var graph = manager.Collect(lockFile); var expandedGraph = manager.Expand(graph, Runtime); - var trimmedRuntimeLibraries = context.RuntimeLibraries; + // 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); if (PackagesToRemove != null && PackagesToRemove.Any()) { @@ -67,7 +74,7 @@ private void ExecuteCore() expandedGraph ); - using (var depsStream = File.Create(DepsFilePath)) + using (var depsStream = File.Create(OutputPath)) { new DependencyContextWriter().Write(context, depsStream); } diff --git a/build/tasks/RepoTasks.tasks b/build/tasks/RepoTasks.tasks index 5339c01d0107..23e71f2fc14e 100644 --- a/build/tasks/RepoTasks.tasks +++ b/build/tasks/RepoTasks.tasks @@ -14,7 +14,6 @@ - diff --git a/build/tasks/TrimDeps.cs b/build/tasks/TrimDeps.cs deleted file mode 100644 index b63bdb35cc4c..000000000000 --- a/build/tasks/TrimDeps.cs +++ /dev/null @@ -1,60 +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.IO; -using System.Linq; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace RepoTasks -{ - public class TrimDeps : Task - { - [Required] - public ITaskItem[] DepsFiles { get; set; } - - public override bool Execute() - { - foreach (var depsFile in DepsFiles) - { - ChangeEntryPointLibraryName(depsFile.GetMetadata("Identity")); - } - - // Parse input - return true; - } - - - private void ChangeEntryPointLibraryName(string depsFile) - { - JToken deps; - using (var file = File.OpenText(depsFile)) - using (JsonTextReader reader = new JsonTextReader(file)) - { - deps = JObject.ReadFrom(reader); - } - - foreach (JProperty target in deps["targets"]) - { - var targetLibrary = target.Value.Children().FirstOrDefault(); - if (targetLibrary == null) - { - continue; - } - - targetLibrary.Remove(); - } - - var library = deps["libraries"].Children().First(); - library.Remove(); - - using (var file = File.CreateText(depsFile)) - using (var writer = new JsonTextWriter(file) { Formatting = Formatting.Indented }) - { - deps.WriteTo(writer); - } - } - } -} diff --git a/build/tasks/Utilities/RuntimeReference.cs b/build/tasks/Utilities/RuntimeReference.cs index 4907a7372345..989491e6e29f 100644 --- a/build/tasks/Utilities/RuntimeReference.cs +++ b/build/tasks/Utilities/RuntimeReference.cs @@ -11,6 +11,29 @@ namespace RepoTasks.Utilities { internal class RuntimeReference { + public static IEnumerable RemoveSharedFxRuntimeEntry(IEnumerable 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(), // runtimeLib.RuntimeAssemblyGroups, + runtimeLib.NativeLibraryGroups, + runtimeLib.ResourceAssemblies, + runtimeLib.Dependencies, + runtimeLib.Serviceable); + } + else + { + yield return runtimeLib; + } + } + } + public static List RemoveReferences(IReadOnlyList runtimeLibraries, IEnumerable packages) { List result = new List(); diff --git a/build/tools/templates/SharedFx/SharedFx.csproj b/build/tools/templates/SharedFx/SharedFx.csproj deleted file mode 100644 index 60d28275ec87..000000000000 --- a/build/tools/templates/SharedFx/SharedFx.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - netcoreapp2.2 - true - true - - - - - - - - - - - - - - - - - - - - diff --git a/eng/targets/SharedFx.Common.props b/eng/targets/SharedFx.Common.props new file mode 100644 index 000000000000..f21be380a69e --- /dev/null +++ b/eng/targets/SharedFx.Common.props @@ -0,0 +1,43 @@ + + + + + true + + + $([MSBuild]::ValueOrDefault('$(RuntimeIdentifier)', '$(_RuntimeIdentifier)')) + $(SharedFxRID) + $(HostRid) + + + true + + + true + + + true + + false + + + false + false + + + none + false + false + + + + + + _RuntimeIdentifier=$(RuntimeIdentifier) + _ResolvedFrameworkProjectReferencePaths + + + diff --git a/eng/targets/SharedFx.Common.targets b/eng/targets/SharedFx.Common.targets new file mode 100644 index 000000000000..82978be35dcb --- /dev/null +++ b/eng/targets/SharedFx.Common.targets @@ -0,0 +1,294 @@ + + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + BuildOnlySettings; + PrepareForBuild; + PreBuildEvent; + ResolveReferences; + GenerateSharedFxVersionsFile; + PrepareForPublish; + ComputeAndCopyFilesToPublishDirectory; + GeneratePublishDependencyFile; + GenerateSharedFxDependencyFile; + GeneratePublishRuntimeConfigurationFile; + OptimizeOutput; + PostBuildEvent; + GetTargetPath; + + + + PrepareForCrossGen; + CrossGenAssemblies; + + + + $(OptimizeOutputDependsOn); + CrossGenSymbols; + + + + + + BeforeResolveReferences; + AssignProjectConfiguration; + ResolveProjectReferences; + FindInvalidProjectReferences; + AfterResolveReferences + + + + $(MSBuildProjectName) + + + win + osx + linux + linux-musl + unix + + lib + .so + .dll + .dylib + .exe + + : + %3B + + $(IntermediateOutputPath)$(RuntimeIdentifier)\ + + + $(OutputPath) + $(IntermediateOutputPath)u\ + + $(IntermediateOutputPath)crossgen\ + + + $(BaseSharedFrameworkName) + + $(IntermediateOutputPath)$(SharedFxName).runtimeconfig.dev.json + + $(IntermediateOutputPath)$(SharedFxName).publish.deps.json + $(OutputPath)$(SharedFxName).deps.json + + + + + true + true + All + Native + true + + + + Runtime;Native + + + + + + + + + + + + + <_UnknownRid Remove="@(_UnknownRid)" /> + <_UnknownRid Include="$(RuntimeIdentifier)" Exclude="$(SupportedRuntimeIdentifiers)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Microsoft.NETCore.App + crossgen + $(CrossGenTool).exe + + + + + + + + + + + + + + + + + + + + + + + + + + + <_AppRuntimeAssemblies Include="@(ResolvedAssembliesToPublish)" Condition="'%(AssetType)' == 'runtime'"> + %(PackageName).%(PackageVersion).symbols.nupkg + %(RootDir)%(Directory)%(Filename).pdb + + + <_AssembliesToCrossgen Include="$(PublishDir)**\*.dll" /> + + + + + + + + + + + + + + + + + %(FullPath) + $(IntermediateOutputPath)%(RecursiveDir)%(Filename).rsp + $(IntermediateOutputPath)%(RecursiveDir)%(Filename).symbols.rsp + $(IntermediateOutputPath)%(RecursiveDir)%(Filename).ni.pdb + $(OutputPath)%(RecursiveDir)%(Filename)%(Extension) + $(OutputPath)%(RecursiveDir) + + + + + + + + + + + + + + + + + + <_PlatformAssemblyPaths Remove="@(_PlatformAssemblyPaths)" /> + <_PlatformAssemblyPaths Include="$(CrossGenToolDir)" /> + <_PlatformAssemblyPaths Include="$(PublishDir)" /> + <_PlatformAssemblyPaths Include="$([System.IO.Path]::GetDirectoryName(%(_ResolvedFrameworkProjectReferencePaths.Identity)))" Condition="'%(_ResolvedFrameworkProjectReferencePaths.Identity)' != ''" /> + + + + @(_PlatformAssemblyPaths->Distinct(), '$(PathSeparator)') + + + + + + + + + + + + + + + + + + + + + + CreatePerfMap + CreatePDB + + + + + + + + + + + + + + + + + diff --git a/src/Framework/Directory.Build.props b/src/Framework/Directory.Build.props new file mode 100644 index 000000000000..8468aea3d3b9 --- /dev/null +++ b/src/Framework/Directory.Build.props @@ -0,0 +1,18 @@ + + + + x64 + + + + + + + $(ArtifactsConfigurationDir)$(RuntimeIdentifier)\$(MSBuildProjectName)\ + $(RepositoryRoot)obj\fx\$(MSBuildProjectName)\ + + false + false + + + diff --git a/src/Framework/Directory.Build.targets b/src/Framework/Directory.Build.targets new file mode 100644 index 000000000000..65a3ac6c8a63 --- /dev/null +++ b/src/Framework/Directory.Build.targets @@ -0,0 +1,6 @@ + + + + $(RestoreSources);https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json + + diff --git a/src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj b/src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj new file mode 100644 index 000000000000..8232fb3f40a8 --- /dev/null +++ b/src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj @@ -0,0 +1,37 @@ + + + + netcoreapp2.2 + Microsoft.AspNetCore.App + $(MicrosoftNETCoreAppPackageVersion) + + + + + Minimum + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj b/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj new file mode 100644 index 000000000000..6364058a6a0d --- /dev/null +++ b/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj @@ -0,0 +1,168 @@ + + + + netcoreapp2.2 + Microsoft.NETCore.App + $(MicrosoftNETCoreAppPackageVersion) + + + + + MajorMinor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Installers/Directory.Build.props b/src/Installers/Directory.Build.props new file mode 100644 index 000000000000..bca17a2ab185 --- /dev/null +++ b/src/Installers/Directory.Build.props @@ -0,0 +1,14 @@ + + + + + + aspnetcore-runtime + + $(RuntimeInstallerBaseName)-internal + + .tar.gz + .zip + + + diff --git a/src/Installers/Windows/Directory.Build.props b/src/Installers/Windows/Directory.Build.props index 096863e2450a..af15a651bd21 100644 --- a/src/Installers/Windows/Directory.Build.props +++ b/src/Installers/Windows/Directory.Build.props @@ -8,10 +8,6 @@ $(RootOutputPath)obj/$(MSBuildProjectName)/ $(BaseIntermediateOutputPath)$(Configuration)/ $(IntermediateOutputPath)$(Platform)/ - - aspnetcore-runtime - - $(RuntimeInstallerBaseName)-internal diff --git a/src/Installers/Windows/SharedFrameworkLib/SharedFrameworkLib.wixproj b/src/Installers/Windows/SharedFrameworkLib/SharedFrameworkLib.wixproj index 672ca7de6600..40fd51c943ce 100644 --- a/src/Installers/Windows/SharedFrameworkLib/SharedFrameworkLib.wixproj +++ b/src/Installers/Windows/SharedFrameworkLib/SharedFrameworkLib.wixproj @@ -4,7 +4,8 @@ AspNetCoreSharedFrameworkLib$(Platform) - $(WixlibBaseFileName)-$(PackageVersion)-win-$(Platform) + + $(InternalInstallerBaseName)-$(PackageVersion)-win-$(Platform) Library true $(SharedFrameworkNamespaceGuid) From 84c93c7f2314878601be61147d71f43a992c5aec Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 23 Oct 2018 10:14:58 -0700 Subject: [PATCH 2/7] Generate rid-specific packages from the shared frameworks * Change the output of shared framework projects to keep files in distinct groups * Generate rid-specific packages for shared frameworks --- Directory.Build.props | 17 +++++ build/SharedFx.targets | 11 --- eng/targets/SharedFx.Common.targets | 67 ++++++++++--------- src/Framework/Directory.Build.props | 4 ++ src/Framework/Directory.Build.targets | 23 +++++++ .../Microsoft.AspNetCore.All.shfxproj | 9 +++ .../Microsoft.AspNetCore.App.shfxproj | 9 +++ src/Framework/_._ | 0 src/Framework/runtime.fx.nuspec | 24 +++++++ 9 files changed, 122 insertions(+), 42 deletions(-) create mode 100644 src/Framework/_._ create mode 100644 src/Framework/runtime.fx.nuspec diff --git a/Directory.Build.props b/Directory.Build.props index 9161640bd45f..4ef13f4dcdce 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,12 +3,29 @@ Microsoft ASP.NET Core + + Microsoft + Microsoft Corporation. + © Microsoft Corporation. All rights reserved. + en-US + https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt + https://go.microsoft.com/fwlink/?LinkID=288859 + https://asp.net + true + true + $(MSBuildThisFileDirectory) https://github.com/aspnet/AspNetCore git + $(MSBuildThisFileDirectory)eng\AspNetCore.snk true true + + + SHA256 + + true diff --git a/build/SharedFx.targets b/build/SharedFx.targets index c5fb4c8c3718..11db9426ec44 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -110,21 +110,10 @@ - $(_WorkRoot)AppSharedFx\ - $(_WorkRoot)AllSharedFx\ $(_WorkRoot)Publish\ $(_WorkRoot)CrossGen\ - $(_WorkRoot)CrossGenSymbols\ - $(_WorkRoot)CrossGenTool\ - $(_WorkRoot)CrossGenRsp\ $(SharedFxIntermediateOutputPath)shared\Microsoft.AspNetCore.App\$(PackageVersion)\ $(SharedFxIntermediateOutputPath)shared\Microsoft.AspNetCore.All\$(PackageVersion)\ - $(SharedFxRID) - - Configuration=$(Configuration);RuntimeIdentifier=$(SharedFxRestoreRid) - $(CommonSharedFxProps);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath) - $(CommonSharedFxProps);DotNetBuildOffline=true - $(CommonSharedFxProps);AspNetUniverseBuildOffline=true diff --git a/eng/targets/SharedFx.Common.targets b/eng/targets/SharedFx.Common.targets index 82978be35dcb..d3ac069f6b1b 100644 --- a/eng/targets/SharedFx.Common.targets +++ b/eng/targets/SharedFx.Common.targets @@ -35,7 +35,9 @@ This targets file should only be imported by .shfxproj files. CrossGenSymbols; - + + PrepareOutputPaths; + BeforeResolveReferences; @@ -73,6 +75,11 @@ This targets file should only be imported by .shfxproj files. $(OutputPath) $(IntermediateOutputPath)u\ + $(OutputPath)files\ + $(OutputPath)symbols\ + $(OutputPath)native\ + $(OutputPath)lib\$(TargetFramework)\ + $(IntermediateOutputPath)crossgen\ @@ -80,8 +87,13 @@ This targets file should only be imported by .shfxproj files. $(IntermediateOutputPath)$(SharedFxName).runtimeconfig.dev.json + $(IntermediateOutputPath)$(SharedFxName).project.deps.json $(IntermediateOutputPath)$(SharedFxName).publish.deps.json - $(OutputPath)$(SharedFxName).deps.json + + + $(MetadataOutputPath)$(SharedFxName).runtimeconfig.json + $(MetadataOutputPath)$(SharedFxName).deps.json + $(MetadataOutputPath).version @@ -115,6 +127,12 @@ This targets file should only be imported by .shfxproj files. + + + + + + @@ -125,7 +143,7 @@ This targets file should only be imported by .shfxproj files. @@ -180,45 +198,30 @@ This targets file should only be imported by .shfxproj files. - - <_AppRuntimeAssemblies Include="@(ResolvedAssembliesToPublish)" Condition="'%(AssetType)' == 'runtime'"> - %(PackageName).%(PackageVersion).symbols.nupkg - %(RootDir)%(Directory)%(Filename).pdb - - - <_AssembliesToCrossgen Include="$(PublishDir)**\*.dll" /> + + + + + - - - - - - - - - - + - + %(FullPath) $(IntermediateOutputPath)%(RecursiveDir)%(Filename).rsp $(IntermediateOutputPath)%(RecursiveDir)%(Filename).symbols.rsp - $(IntermediateOutputPath)%(RecursiveDir)%(Filename).ni.pdb - $(OutputPath)%(RecursiveDir)%(Filename)%(Extension) - $(OutputPath)%(RecursiveDir) + $(SymbolsOutputPath)%(RecursiveDir)%(Filename).ni.pdb + $(RuntimeAssetsOutputPath)%(RecursiveDir)%(Filename)%(Extension) + $(SymbolsOutputPath)%(RecursiveDir) - - - - - - - + + + + $(MSBuildProjectName) + + runtime.$(RuntimeIdentifier).$(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. + +$(PackageId) provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. + diff --git a/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj b/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj index 6364058a6a0d..453e3698119d 100644 --- a/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj +++ b/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj @@ -4,6 +4,15 @@ netcoreapp2.2 Microsoft.NETCore.App $(MicrosoftNETCoreAppPackageVersion) + + + $(MSBuildProjectName) + + runtime.$(RuntimeIdentifier).$(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. + +$(PackageId) provides a default set of APIs for building an ASP.NET Core application. + diff --git a/src/Framework/_._ b/src/Framework/_._ new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/src/Framework/runtime.fx.nuspec b/src/Framework/runtime.fx.nuspec new file mode 100644 index 000000000000..bbfbe70ec335 --- /dev/null +++ b/src/Framework/runtime.fx.nuspec @@ -0,0 +1,24 @@ + + + + $id$ + $version$ + $authors$ + $licenseUrl$ + $projectUrl$ + $iconUrl$ + $description$ + $copyright$ + $tags$ + + true + true + + + + + + + + + From 4903b91fb2dd6ca9151bc63a251db789d24b6b2b Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 23 Oct 2018 13:59:23 -0700 Subject: [PATCH 3/7] Update shared framework unit tests to use a project ref --- Directory.Build.props | 9 +- Microsoft.AspNetCore.sln | 39 ---- build/SharedFx.targets | 168 +++--------------- build/sources.props | 5 + build/tasks/RepoTasks.tasks | 1 - build/tasks/ResolveSymbolsRecursivePath.cs | 29 --- .../SharedFrameworkSymbols.nuspec | 18 -- eng/targets/SharedFx.Common.props | 4 - eng/targets/SharedFx.Common.targets | 60 ++++--- src/Framework/Directory.Build.props | 23 +-- src/Framework/Directory.Build.targets | 6 +- .../Framework.UnitTests}/AssertEx.cs | 0 .../Framework.UnitTests.csproj | 25 ++- .../Framework.UnitTests}/SharedFxTests.cs | 16 +- .../Framework.UnitTests}/TestData.cs | 6 +- .../Framework.UnitTests}/TestDataAttribute.cs | 0 .../Microsoft.AspNetCore.All.shfxproj | 2 +- .../Microsoft.AspNetCore.App.shfxproj | 2 +- .../Archive.Internal/Archive.Internal.zipproj | 49 +++++ .../Archive.Redist/Archive.Redist.zipproj | 68 +++++++ src/Installers/Directory.Build.props | 2 +- 21 files changed, 233 insertions(+), 299 deletions(-) delete mode 100644 Microsoft.AspNetCore.sln delete mode 100644 build/tasks/ResolveSymbolsRecursivePath.cs delete mode 100644 build/tools/templates/SharedFxSymbols/SharedFrameworkSymbols.nuspec rename {test/SharedFx.UnitTests => src/Framework/Framework.UnitTests}/AssertEx.cs (100%) rename test/SharedFx.UnitTests/SharedFx.UnitTests.csproj => src/Framework/Framework.UnitTests/Framework.UnitTests.csproj (62%) rename {test/SharedFx.UnitTests => src/Framework/Framework.UnitTests}/SharedFxTests.cs (83%) rename {test/SharedFx.UnitTests => src/Framework/Framework.UnitTests}/TestData.cs (80%) rename {test/SharedFx.UnitTests => src/Framework/Framework.UnitTests}/TestDataAttribute.cs (100%) create mode 100644 src/Installers/Archive.Internal/Archive.Internal.zipproj create mode 100644 src/Installers/Archive.Redist/Archive.Redist.zipproj diff --git a/Directory.Build.props b/Directory.Build.props index 4ef13f4dcdce..9b175f082dbe 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -37,12 +37,13 @@ Debug $(ArtifactsDir)$(Configuration)\ $(ArtifactsConfigurationDir)bin\ + $(ArtifactsConfigurationDir)installers\ $(ArtifactsConfigurationDir)packages\ - AnyCPU - win-$(TargetPlatform) - osx-$(TargetPlatform) - linux-$(TargetPlatform) + + win-x64 + osx-x64 + linux-x64 diff --git a/Microsoft.AspNetCore.sln b/Microsoft.AspNetCore.sln deleted file mode 100644 index 809b017e25f3..000000000000 --- a/Microsoft.AspNetCore.sln +++ /dev/null @@ -1,39 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26124.0 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EE2CAA71-82AA-41C0-AE87-5B4FB77D6CFE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedFx.UnitTests", "test\SharedFx.UnitTests\SharedFx.UnitTests.csproj", "{99CC38EC-902B-4B3F-AD33-177018110199}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|x64.ActiveCfg = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|x64.Build.0 = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|x86.ActiveCfg = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|x86.Build.0 = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|Any CPU.Build.0 = Release|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|x64.ActiveCfg = Release|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|x64.Build.0 = Release|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|x86.ActiveCfg = Release|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {99CC38EC-902B-4B3F-AD33-177018110199} = {EE2CAA71-82AA-41C0-AE87-5B4FB77D6CFE} - EndGlobalSection -EndGlobal diff --git a/build/SharedFx.targets b/build/SharedFx.targets index 11db9426ec44..d05493056d77 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -2,7 +2,7 @@ - $([MSBuild]::NormalizeDirectory($(ArtifactsDir)))runtime\ + $(RepositoryRoot)\src\Framework\Framework.UnitTests\Framework.UnitTests.csproj @@ -108,172 +108,46 @@ BuildInParallel="false" /> - - - $(_WorkRoot)Publish\ - $(_WorkRoot)CrossGen\ - $(SharedFxIntermediateOutputPath)shared\Microsoft.AspNetCore.App\$(PackageVersion)\ - $(SharedFxIntermediateOutputPath)shared\Microsoft.AspNetCore.All\$(PackageVersion)\ - - - - - - runtime.$(SharedFxRID).$(SymbolsNuspecIdSuffix) - - + - <_SymbolFiles Include="$(SymbolsWorkDir)**\*.pdb;$(SymbolsWorkDir)**\*.map;$(SymbolsWorkDir)**\*.dll" /> - - %(RecursiveDir)%(Filename)%(Extension) - + + - - + - - + - - - $(SharedFxCrossGenDirectory)shared\Microsoft.AspNetCore.App\$(PackageVersion)\ - $(SharedFxCrossGenDirectory)shared\Microsoft.AspNetCore.All\$(PackageVersion)\ - $(_WorkRoot)Symbols\Microsoft.AspNetCore.App\ - $(_WorkRoot)Symbols\Microsoft.AspNetCore.All\ - - - - - - - - + - - - - - - - - - - - - - - - + - SymbolsWorkDir=$(AppSharedFxSymbolsDirectory) - $(AppSymbolsArguments);SymbolsNuspecIdSuffix=Microsoft.AspNetCore.App - $(AppSymbolsArguments);Description=Symbol packages for Microsoft.AspNetCore.App shared framework - SymbolsWorkDir=$(AllSharedFxSymbolsDirectory) - $(AllSymbolsArguments);SymbolsNuspecIdSuffix=Microsoft.AspNetCore.All - $(AllSymbolsArguments);Description=Symbol packages for Microsoft.AspNetCore.All shared framework - - - - - - - - - - - - - - - - - - - - - - - $(RepositoryRoot)\test\SharedFx.UnitTests\SharedFx.UnitTests.csproj $(LogOutputDir)SharedFx-UnitTests-$(Version).trx $(UnitTestFxTrxLogFile) $(HostMachineRepositoryRoot)/artifacts/logs/SharedFx-UnitTests.trx - - - DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath); - DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath); - SharedFxOutputPath=$(SharedFxIntermediateOutputPath); - RepositoryCommit=$(RepositoryCommit); - VSTestLogger=$([MSBuild]::Escape('trx;LogFileName=$(UnitTestFxTrxLogFile)')); - SharedFxRuntimeIdentifier=$(SharedFXRid) - - - + + - + --;RunConfiguration.NoAutoReporters=true"> diff --git a/build/sources.props b/build/sources.props index 5b458ddf090d..a08e49dfdb41 100644 --- a/build/sources.props +++ b/build/sources.props @@ -21,5 +21,10 @@ https://vside.myget.org/F/vssdk/api/v3/index.json; https://vside.myget.org/F/vsmac/api/v3/index.json + + https://dotnetcli.blob.core.windows.net/dotnet/ + + + $(PublicCoreFeedPrefix) diff --git a/build/tasks/RepoTasks.tasks b/build/tasks/RepoTasks.tasks index 23e71f2fc14e..d3c257b5d224 100644 --- a/build/tasks/RepoTasks.tasks +++ b/build/tasks/RepoTasks.tasks @@ -13,7 +13,6 @@ - diff --git a/build/tasks/ResolveSymbolsRecursivePath.cs b/build/tasks/ResolveSymbolsRecursivePath.cs deleted file mode 100644 index 21dd795fcd88..000000000000 --- a/build/tasks/ResolveSymbolsRecursivePath.cs +++ /dev/null @@ -1,29 +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.IO; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using RepoTasks.Utilities; - -namespace RepoTasks -{ - public class ResolveSymbolsRecursivePath : Task - { - [Required] - [Output] - public ITaskItem[] Symbols { get; set; } - - public override bool Execute() - { - foreach (var symbol in Symbols) - { - var fullPath = symbol.GetMetadata("PortablePDB"); - symbol.SetMetadata("SymbolsRecursivePath", fullPath.Substring(fullPath.IndexOf($"{Path.DirectorySeparatorChar}lib{Path.DirectorySeparatorChar}"))); - } - - return true; - } - } -} diff --git a/build/tools/templates/SharedFxSymbols/SharedFrameworkSymbols.nuspec b/build/tools/templates/SharedFxSymbols/SharedFrameworkSymbols.nuspec deleted file mode 100644 index 1ba4b6c85df1..000000000000 --- a/build/tools/templates/SharedFxSymbols/SharedFrameworkSymbols.nuspec +++ /dev/null @@ -1,18 +0,0 @@ - - - - $ID$ - $VERSION$ - $DESCRIPTION$ - Microsoft - Microsoft - Copyright © Microsoft Corporation - https://raw.githubusercontent.com/aspnet/Home/2.0.0/LICENSE.txt - https://go.microsoft.com/fwlink/?LinkID=288859 - https://asp.net - true - true - aspnetcore - - - diff --git a/eng/targets/SharedFx.Common.props b/eng/targets/SharedFx.Common.props index f21be380a69e..cc3d5a3faeec 100644 --- a/eng/targets/SharedFx.Common.props +++ b/eng/targets/SharedFx.Common.props @@ -7,8 +7,6 @@ This targets file should only be imported by .shfxproj files. true - - $([MSBuild]::ValueOrDefault('$(RuntimeIdentifier)', '$(_RuntimeIdentifier)')) $(SharedFxRID) $(HostRid) @@ -35,8 +33,6 @@ This targets file should only be imported by .shfxproj files. - - _RuntimeIdentifier=$(RuntimeIdentifier) _ResolvedFrameworkProjectReferencePaths diff --git a/eng/targets/SharedFx.Common.targets b/eng/targets/SharedFx.Common.targets index d3ac069f6b1b..7ec37078e17f 100644 --- a/eng/targets/SharedFx.Common.targets +++ b/eng/targets/SharedFx.Common.targets @@ -54,22 +54,22 @@ This targets file should only be imported by .shfxproj files. Defines the base RID for a vertical of related runtimes, e.g. Windows, macOS, Linux. This is used during runtime graph generation to determine which RIDs to include in the .deps.json file. --> - win - osx - linux - linux-musl - unix + win + osx + linux + linux-musl + unix - lib + lib .so - .dll - .dylib - .exe + .dll + .dylib + .exe : - %3B + %3B - $(IntermediateOutputPath)$(RuntimeIdentifier)\ + $(IntermediateOutputPath)$(SharedFxRid)\ $(OutputPath) @@ -96,6 +96,24 @@ This targets file should only be imported by .shfxproj files. $(MetadataOutputPath).version + + + + + $(MetadataOutputPath); + $(RuntimeAssetsOutputPath); + $(NativeAssetsOutputPath); + + $(MetadataOutputPath) + $(RuntimeAssetsOutputPath) + $(NativeAssetsOutputPath) + $(SharedFxName) + + + true @@ -117,18 +135,18 @@ This targets file should only be imported by .shfxproj files. - + <_UnknownRid Remove="@(_UnknownRid)" /> - <_UnknownRid Include="$(RuntimeIdentifier)" Exclude="$(SupportedRuntimeIdentifiers)" /> + <_UnknownRid Include="$(SharedFxRid)" Exclude="$(SupportedRuntimeIdentifiers)" /> + Text=""$(SharedFxRid)" not acceptable runtime identifier. Please specify an acceptable value: {$(SupportedRuntimeIdentifiers)}." /> - + @@ -157,12 +175,12 @@ This targets file should only be imported by .shfxproj files. AssetsFilePath="$(ProjectAssetsFile)" DepsFilePath="$(PublishDepsFilePath)" OutputPath="$(SharedFxDepsFilePath)" - Runtime="$(BaseRuntimeIdentifier)" /> + Runtime="$(BaseSharedFxRid)" /> - + @@ -179,7 +197,7 @@ This targets file should only be imported by .shfxproj files. - + @@ -201,7 +219,6 @@ This targets file should only be imported by .shfxproj files. - @@ -221,7 +238,6 @@ This targets file should only be imported by .shfxproj files. - - x64 - - - - - $(ArtifactsConfigurationDir)$(RuntimeIdentifier)\$(MSBuildProjectName)\ + + + + + + + $(ArtifactsConfigurationDir)$(SharedFxRid)\$(MSBuildProjectName)\ $(RepositoryRoot)obj\fx\$(MSBuildProjectName)\ - false - false + false + false true $(MSBuildThisFileDirectory)runtime.fx.nuspec diff --git a/src/Framework/Directory.Build.targets b/src/Framework/Directory.Build.targets index 8234266e433a..4c37c1289b22 100644 --- a/src/Framework/Directory.Build.targets +++ b/src/Framework/Directory.Build.targets @@ -1,16 +1,16 @@ - + $(RestoreSources);https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json - + id=$(RuntimePackageId); version=$(PackageVersion); authors=$(Authors); - rid=$(RuntimeIdentifier); + rid=$(SharedFxRid); description=$(RuntimePackageDescription); tags=$(PackageTags.Replace(';', ' ')); licenseUrl=$(PackageLicenseUrl); diff --git a/test/SharedFx.UnitTests/AssertEx.cs b/src/Framework/Framework.UnitTests/AssertEx.cs similarity index 100% rename from test/SharedFx.UnitTests/AssertEx.cs rename to src/Framework/Framework.UnitTests/AssertEx.cs diff --git a/test/SharedFx.UnitTests/SharedFx.UnitTests.csproj b/src/Framework/Framework.UnitTests/Framework.UnitTests.csproj similarity index 62% rename from test/SharedFx.UnitTests/SharedFx.UnitTests.csproj rename to src/Framework/Framework.UnitTests/Framework.UnitTests.csproj index 77d020f3dc19..2a2385b724eb 100644 --- a/test/SharedFx.UnitTests/SharedFx.UnitTests.csproj +++ b/src/Framework/Framework.UnitTests/Framework.UnitTests.csproj @@ -3,6 +3,7 @@ netcoreapp2.2 Microsoft.AspNetCore + false @@ -11,12 +12,8 @@ <_Parameter2>$(PackageVersion) - <_Parameter1>DotNetRoot - <_Parameter2>$(SharedFxOutputPath) - - - <_Parameter1>SharedFxRuntimeIdentifier - <_Parameter2>$(SharedFxRuntimeIdentifier) + <_Parameter1>SharedFxRid + <_Parameter2>$(SharedFxRid) <_Parameter1>RepositoryCommit @@ -36,4 +33,20 @@ + + + false + _ResolvedFrameworkReference + + + + + + + <_Parameter1>SharedFxMetadataOutput:%(_ResolvedFrameworkReference.SharedFxName) + <_Parameter2>%(_ResolvedFrameworkReference.MetadataOutputPath) + + + + diff --git a/test/SharedFx.UnitTests/SharedFxTests.cs b/src/Framework/Framework.UnitTests/SharedFxTests.cs similarity index 83% rename from test/SharedFx.UnitTests/SharedFxTests.cs rename to src/Framework/Framework.UnitTests/SharedFxTests.cs index d18fa17ef805..614a9074dc6f 100644 --- a/test/SharedFx.UnitTests/SharedFxTests.cs +++ b/src/Framework/Framework.UnitTests/SharedFxTests.cs @@ -13,12 +13,10 @@ public class SharedFxTests [MemberData(nameof(GetSharedFxConfig))] public void ItContainsValidRuntimeConfigFile(SharedFxConfig config) { - var root = TestData.GetDotNetRoot(); - var dir = Path.Combine(root, "shared", config.Name, config.Version); - var runtimeConfigFilePath = Path.Combine(dir, config.Name + ".runtimeconfig.json"); + var runtimeConfigFilePath = Path.Combine(config.MetadataOutput, config.Name + ".runtimeconfig.json"); AssertEx.FileExists(runtimeConfigFilePath); - AssertEx.FileDoesNotExists(Path.Combine(dir, config.Name + ".runtimeconfig.dev.json")); + AssertEx.FileDoesNotExists(Path.Combine(config.MetadataOutput, config.Name + ".runtimeconfig.dev.json")); var runtimeConfig = JObject.Parse(File.ReadAllText(runtimeConfigFilePath)); @@ -32,9 +30,7 @@ public void ItContainsValidRuntimeConfigFile(SharedFxConfig config) [MemberData(nameof(GetSharedFxConfig))] public void ItContainsValidDepsJson(SharedFxConfig config) { - var root = TestData.GetDotNetRoot(); - var dir = Path.Combine(root, "shared", config.Name, config.Version); - var depsFilePath = Path.Combine(dir, config.Name + ".deps.json"); + var depsFilePath = Path.Combine(config.MetadataOutput, config.Name + ".deps.json"); var target = $".NETCoreApp,Version=v{config.Version.Substring(0, 3)}/{config.RuntimeIdentifier}"; @@ -53,8 +49,7 @@ public void ItContainsValidDepsJson(SharedFxConfig config) [MemberData(nameof(GetSharedFxConfig))] public void ItContainsVersionFile(SharedFxConfig config) { - var root = TestData.GetDotNetRoot(); - var versionFile = Path.Combine(root, "shared", config.Name, config.Version, ".version"); + var versionFile = Path.Combine(config.MetadataOutput, ".version"); AssertEx.FileExists(versionFile); var lines = File.ReadAllLines(versionFile); Assert.Equal(2, lines.Length); @@ -74,6 +69,7 @@ public static TheoryData GetSharedFxConfig() BaseSharedFxVersion = TestData.GetPackageVersion(), BaseSharedFxName = "Microsoft.AspNetCore.App", RuntimeIdentifier = TestData.GetSharedFxRuntimeIdentifier(), + MetadataOutput = TestData.GetTestDataValue("SharedFxMetadataOutput:Microsoft.AspNetCore.All") }, new SharedFxConfig { @@ -82,6 +78,7 @@ public static TheoryData GetSharedFxConfig() BaseSharedFxName = "Microsoft.NETCore.App", BaseSharedFxVersion = TestData.GetMicrosoftNETCoreAppPackageVersion(), RuntimeIdentifier = TestData.GetSharedFxRuntimeIdentifier(), + MetadataOutput = TestData.GetTestDataValue("SharedFxMetadataOutput:Microsoft.AspNetCore.App") }, }; @@ -92,6 +89,7 @@ public class SharedFxConfig public string BaseSharedFxName { get; set; } public string BaseSharedFxVersion { get; set; } public string RuntimeIdentifier { get; set; } + public string MetadataOutput { get; set; } } } } diff --git a/test/SharedFx.UnitTests/TestData.cs b/src/Framework/Framework.UnitTests/TestData.cs similarity index 80% rename from test/SharedFx.UnitTests/TestData.cs rename to src/Framework/Framework.UnitTests/TestData.cs index eb01f60e8b2d..a33613aff80e 100644 --- a/test/SharedFx.UnitTests/TestData.cs +++ b/src/Framework/Framework.UnitTests/TestData.cs @@ -12,13 +12,11 @@ public class TestData public static string GetMicrosoftNETCoreAppPackageVersion() => GetTestDataValue("MicrosoftNETCoreAppPackageVersion"); - public static string GetDotNetRoot() => GetTestDataValue("DotNetRoot"); - public static string GetRepositoryCommit() => GetTestDataValue("RepositoryCommit"); - public static string GetSharedFxRuntimeIdentifier() => GetTestDataValue("SharedFxRuntimeIdentifier"); + public static string GetSharedFxRuntimeIdentifier() => GetTestDataValue("SharedFxRid"); - private static string GetTestDataValue(string key) + public static string GetTestDataValue(string key) => typeof(TestData).Assembly.GetCustomAttributes().Single(d => d.Key == key).Value; } } diff --git a/test/SharedFx.UnitTests/TestDataAttribute.cs b/src/Framework/Framework.UnitTests/TestDataAttribute.cs similarity index 100% rename from test/SharedFx.UnitTests/TestDataAttribute.cs rename to src/Framework/Framework.UnitTests/TestDataAttribute.cs diff --git a/src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj b/src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj index 30f4af7ddd26..f9a6cf76c567 100644 --- a/src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj +++ b/src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj @@ -8,7 +8,7 @@ $(MSBuildProjectName) - runtime.$(RuntimeIdentifier).$(MSBuildProjectName) + runtime.$(SharedFxRid).$(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. $(PackageId) provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. diff --git a/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj b/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj index 453e3698119d..722be0063dac 100644 --- a/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj +++ b/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj @@ -8,7 +8,7 @@ $(MSBuildProjectName) - runtime.$(RuntimeIdentifier).$(MSBuildProjectName) + runtime.$(SharedFxRid).$(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. $(PackageId) provides a default set of APIs for building an ASP.NET Core application. diff --git a/src/Installers/Archive.Internal/Archive.Internal.zipproj b/src/Installers/Archive.Internal/Archive.Internal.zipproj new file mode 100644 index 000000000000..31b3bb5cbeb7 --- /dev/null +++ b/src/Installers/Archive.Internal/Archive.Internal.zipproj @@ -0,0 +1,49 @@ + + + + + + + + $(RepositoryRoot)obj\ai\$(SharedFxRid)\ + $(InternalInstallerBaseName)-$(PackageVersion)-$(SharedFxRid)$(ArchiveExtension) + $(InstallersOutputPath) + $(InstallersOutputPath)$(OutputFileName) + + + + + true + _ResolvedFxProjects + + + + + + + + + + + + + + $(IntermediateOutputPath)shared\%(SharedFxAssetFolder.SharedFxName)\$(PackageVersion)\ + + + + + + + + + + diff --git a/src/Installers/Archive.Redist/Archive.Redist.zipproj b/src/Installers/Archive.Redist/Archive.Redist.zipproj new file mode 100644 index 000000000000..3d71f9fc8123 --- /dev/null +++ b/src/Installers/Archive.Redist/Archive.Redist.zipproj @@ -0,0 +1,68 @@ + + + + + + + + $(RepositoryRoot)obj\ar\ + $(BaseIntermediateOutputPath)$(SharedFxRid)\ + $(RuntimeInstallerBaseName)-$(PackageVersion)-$(SharedFxRid)$(ArchiveExtension) + $(InstallersOutputPath) + $(InstallersOutputPath)$(OutputFileName) + dotnet-runtime-$(MicrosoftNETCoreAppPackageVersion)-$(SharedFxRid)$(ArchiveExtension) + $(DotNetAssetRootUrl)Runtime/$(MicrosoftNETCoreAppPackageVersion)/$(DotNetRuntimeArchiveFileName) + $(BaseIntermediateOutputPath)$(DotNetRuntimeArchiveFileName) + + + + + true + _ResolvedFxProjects + + + + + + + + + + + + + + + + $(IntermediateOutputPath)shared\%(SharedFxAssetFolder.SharedFxName)\$(PackageVersion)\ + + + + + + + + + + + + + + + + + diff --git a/src/Installers/Directory.Build.props b/src/Installers/Directory.Build.props index bca17a2ab185..489a37b2c871 100644 --- a/src/Installers/Directory.Build.props +++ b/src/Installers/Directory.Build.props @@ -8,7 +8,7 @@ $(RuntimeInstallerBaseName)-internal .tar.gz - .zip + .zip From 0ef78e920124d84a6277a795e3888c14f791eb43 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 23 Oct 2018 14:02:41 -0700 Subject: [PATCH 4/7] Include archives in shared fx build --- build/SharedFx.targets | 4 +- build/SharedFxInstaller.targets | 63 +------------------ .../Framework.UnitTests.csproj | 2 +- .../Microsoft.AspNetCore.All.shfxproj | 2 +- .../Microsoft.AspNetCore.App.shfxproj | 0 .../Archive.Internal/Archive.Internal.zipproj | 2 +- .../Archive.Redist/Archive.Redist.zipproj | 2 +- 7 files changed, 8 insertions(+), 67 deletions(-) rename src/Framework/Microsoft.AspNetCore.All/{ => src}/Microsoft.AspNetCore.All.shfxproj (96%) rename src/Framework/Microsoft.AspNetCore.App/{ => src}/Microsoft.AspNetCore.App.shfxproj (100%) diff --git a/build/SharedFx.targets b/build/SharedFx.targets index d05493056d77..e43e8666f46f 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -110,8 +110,10 @@ - + + + - + @@ -20,67 +20,6 @@ Condition="!Exists('$(SharedFxIntermediateArchiveFilePrefix)-%(NonWindowsSharedFxRIDs.Identity).tar.gz')" /> - - - - - - - - - - .tar.gz - .zip - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Framework/Framework.UnitTests/Framework.UnitTests.csproj b/src/Framework/Framework.UnitTests/Framework.UnitTests.csproj index 2a2385b724eb..5b3faf326a8d 100644 --- a/src/Framework/Framework.UnitTests/Framework.UnitTests.csproj +++ b/src/Framework/Framework.UnitTests/Framework.UnitTests.csproj @@ -34,7 +34,7 @@ - + false _ResolvedFrameworkReference diff --git a/src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj b/src/Framework/Microsoft.AspNetCore.All/src/Microsoft.AspNetCore.All.shfxproj similarity index 96% rename from src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj rename to src/Framework/Microsoft.AspNetCore.All/src/Microsoft.AspNetCore.All.shfxproj index f9a6cf76c567..8c676393212b 100644 --- a/src/Framework/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.shfxproj +++ b/src/Framework/Microsoft.AspNetCore.All/src/Microsoft.AspNetCore.All.shfxproj @@ -22,7 +22,7 @@ $(PackageId) provides a default set of APIs for building an ASP.NET Core applica - + diff --git a/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj b/src/Framework/Microsoft.AspNetCore.App/src/Microsoft.AspNetCore.App.shfxproj similarity index 100% rename from src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.shfxproj rename to src/Framework/Microsoft.AspNetCore.App/src/Microsoft.AspNetCore.App.shfxproj diff --git a/src/Installers/Archive.Internal/Archive.Internal.zipproj b/src/Installers/Archive.Internal/Archive.Internal.zipproj index 31b3bb5cbeb7..2501b67be85e 100644 --- a/src/Installers/Archive.Internal/Archive.Internal.zipproj +++ b/src/Installers/Archive.Internal/Archive.Internal.zipproj @@ -16,7 +16,7 @@ - + true _ResolvedFxProjects diff --git a/src/Installers/Archive.Redist/Archive.Redist.zipproj b/src/Installers/Archive.Redist/Archive.Redist.zipproj index 3d71f9fc8123..b667e2634c73 100644 --- a/src/Installers/Archive.Redist/Archive.Redist.zipproj +++ b/src/Installers/Archive.Redist/Archive.Redist.zipproj @@ -19,7 +19,7 @@ - + true _ResolvedFxProjects From 0acdeb721c6fb8932ec164efbcc9e923482d9753 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 23 Oct 2018 15:09:45 -0700 Subject: [PATCH 5/7] Run /t:Pack and prevent double builds when NoBuild=true --- Directory.Build.props | 3 +++ build/SharedFx.targets | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 9b175f082dbe..a75b38991795 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -26,6 +26,9 @@ SHA256 true + + + false diff --git a/build/SharedFx.targets b/build/SharedFx.targets index e43e8666f46f..b7af20e64aee 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -124,6 +124,12 @@ + + From ae03a5e724948e14a5e06ab1edb08aac81e12c6c Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 23 Oct 2018 18:33:15 -0700 Subject: [PATCH 6/7] Refactor metapackage generation * Tie together metapackage and shared framework generation * Add tests to ensure deps.json for the shared framework only has "package" entries * Remove Microsoft.AspNetCore.Analyzers (this package isn't shipping anyways) * Cleanup artifacts.props to only include the shipping category --- build/SharedFx.targets | 104 +---- build/artifacts.props | 358 +++++++++--------- build/external-dependencies.props | 8 +- build/repo.targets | 12 - build/tasks/AddMetapackageReferences.cs | 134 ------- build/tasks/ProcessSharedFrameworkDeps.cs | 55 ++- build/tasks/RepoTasks.tasks | 2 +- build/tasks/ResolveVersionRange.cs | 68 ++++ build/tasks/Utilities/RuntimeReference.cs | 4 +- eng/targets/SharedFx.Common.props | 7 +- eng/targets/SharedFx.Common.targets | 13 + src/Framework/Directory.Build.props | 20 +- src/Framework/Directory.Build.targets | 7 +- .../Framework.UnitTests/SharedFxTests.cs | 8 +- src/Framework/Metapackage.targets | 59 +++ .../pkg/Microsoft.AspNetCore.All.pkgproj | 44 +++ .../Microsoft.AspNetCore.All.props | 0 .../Microsoft.AspNetCore.All.targets | 0 .../pkg}/lib/netcoreapp2.2/_._ | 0 .../src/Microsoft.AspNetCore.All.shfxproj | 35 +- .../Microsoft.AspNetCore.App.props | 159 ++++++++ .../pkg/Microsoft.AspNetCore.App.pkgproj} | 11 +- .../Microsoft.AspNetCore.App.props | 0 .../Microsoft.AspNetCore.App.targets | 0 .../pkg}/lib/netcoreapp2.2/_._ | 0 .../src/Microsoft.AspNetCore.App.shfxproj | 167 +------- src/Packages/Directory.Build.props | 7 - src/Packages/Directory.Build.targets | 11 - .../Microsoft.AspNetCore.All.csproj | 21 - .../Microsoft.AspNetCore.Analyzers.csproj | 18 - 30 files changed, 619 insertions(+), 713 deletions(-) delete mode 100644 build/tasks/AddMetapackageReferences.cs create mode 100644 build/tasks/ResolveVersionRange.cs create mode 100644 src/Framework/Metapackage.targets create mode 100644 src/Framework/Microsoft.AspNetCore.All/pkg/Microsoft.AspNetCore.All.pkgproj rename src/{Packages/Microsoft.AspNetCore.All => Framework/Microsoft.AspNetCore.All/pkg}/build/netcoreapp2.2/Microsoft.AspNetCore.All.props (100%) rename src/{Packages/Microsoft.AspNetCore.All => Framework/Microsoft.AspNetCore.All/pkg}/build/netcoreapp2.2/Microsoft.AspNetCore.All.targets (100%) rename src/{Packages/Microsoft.AspNetCore.All => Framework/Microsoft.AspNetCore.All/pkg}/lib/netcoreapp2.2/_._ (100%) create mode 100644 src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.props rename src/{Packages/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.csproj => Framework/Microsoft.AspNetCore.App/pkg/Microsoft.AspNetCore.App.pkgproj} (79%) rename src/{Packages/Microsoft.AspNetCore.App => Framework/Microsoft.AspNetCore.App/pkg}/build/netcoreapp2.2/Microsoft.AspNetCore.App.props (100%) rename src/{Packages/Microsoft.AspNetCore.App => Framework/Microsoft.AspNetCore.App/pkg}/build/netcoreapp2.2/Microsoft.AspNetCore.App.targets (100%) rename src/{Packages/Microsoft.AspNetCore.App => Framework/Microsoft.AspNetCore.App/pkg}/lib/netcoreapp2.2/_._ (100%) delete mode 100644 src/Packages/Directory.Build.props delete mode 100644 src/Packages/Directory.Build.targets delete mode 100644 src/Packages/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj delete mode 100644 src/Packages/Microsoft.AspNetCore.Analyzers/Microsoft.AspNetCore.Analyzers.csproj diff --git a/build/SharedFx.targets b/build/SharedFx.targets index b7af20e64aee..fd39e7f06542 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -5,111 +5,9 @@ $(RepositoryRoot)\src\Framework\Framework.UnitTests\Framework.UnitTests.csproj - - - <_MetapackageProject Include="$(RepositoryRoot)src\Packages\Microsoft.AspNetCore.All\Microsoft.AspNetCore.All.csproj" /> - <_MetapackageProject Include="$(RepositoryRoot)src\Packages\Microsoft.AspNetCore.App\Microsoft.AspNetCore.App.csproj" /> - <_MetapackageProject Include="$(RepositoryRoot)src\Packages\Microsoft.AspNetCore.Analyzers\Microsoft.AspNetCore.Analyzers.csproj" /> - - - - - - - - - <_SharedFrameworkSymbolsPackage Include="@(SharedFrameworkName)" Condition="'%(AllSharedFxRIDs.CrossgenSymbols)' != 'false' AND '%(AllSharedFxRIDs.Crossgen)' != 'false'"> - %(AllSharedFxRIDs.Identity) - - <_SharedFrameworkSymbolsPackage Update="@(_SharedFrameworkSymbolsPackage)" PackageId="runtime.%(Rid).%(Identity)" /> - - NuGetSymbolsPackage - %(_SharedFrameworkSymbolsPackage.PackageId) - $(PackageVersion) - shipoob - - - - - - - $(_MetapackageSrcRoot)$(MetapackageName)\ - $(_WorkRoot)pkg\$(MetapackageName)\ - - $(CommonProps);Configuration=$(Configuration) - $(CommonProps);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath) - $(CommonProps);DotNetBuildOffline=true - $(CommonProps);AspNetUniverseBuildOffline=true - $(CommonProps);RuntimeFrameworkVersion=$(MicrosoftNETCoreApp22PackageVersion) - $(CommonProps);AppMetapackageVersion=$(PackageVersion) - - - - - - - - - - - - - - - - - - - - - - - - - - - <_MetapackageBuilderProject Include="$(MSBuildProjectFullPath)"> - - MetapackageName=Microsoft.AspNetCore.App; - MetapackageReferenceType=AppMetapackage; - MetapackageDependencyVersionRangeType=MajorMinor - - - - <_MetapackageBuilderProject Include="$(MSBuildProjectFullPath)"> - - MetapackageName=Microsoft.AspNetCore.All; - MetapackageReferenceType=AllMetapackage; - MetapackageDependencyVersionRangeType=Minimum - - - - <_MetapackageBuilderProject Include="$(MSBuildProjectFullPath)"> - - MetapackageName=Microsoft.AspNetCore.Analyzers; - MetapackageReferenceType=Analyzer; - MetapackageDependencyVersionRangeType=Minimum - - - - - - - + diff --git a/build/artifacts.props b/build/artifacts.props index 8d364a1c2403..9cef5eedf9fc 100644 --- a/build/artifacts.props +++ b/build/artifacts.props @@ -2,18 +2,13 @@ - - false - - false - - false - - Dependency + @@ -26,76 +21,75 @@ - + - - + - + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - + - + - + - - + + - - - - + + + + - - - + + + - - - - - - - + + + + + + + - + @@ -105,168 +99,168 @@ - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - + - + - - + + - - - + + + - - - - - - + + + + + + - - - - + + + + - - - - - - - + + + + + + + - - - + + + - + - - - - + + + + - - - + + + - + - - + + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - + + + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - + + + + - + - - + + - - - - + + + + - + @@ -276,14 +270,14 @@ - - + + - + diff --git a/build/external-dependencies.props b/build/external-dependencies.props index f5e24cf2a192..c5ab17609bdd 100644 --- a/build/external-dependencies.props +++ b/build/external-dependencies.props @@ -5,10 +5,6 @@ - - false - - false @@ -24,7 +20,7 @@ - + @@ -151,7 +147,7 @@ - + diff --git a/build/repo.targets b/build/repo.targets index d6c00978c36d..dd7bf5e5ac6f 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -238,18 +238,6 @@ - - - - - - - - diff --git a/build/tasks/AddMetapackageReferences.cs b/build/tasks/AddMetapackageReferences.cs deleted file mode 100644 index 3cb11666ab2f..000000000000 --- a/build/tasks/AddMetapackageReferences.cs +++ /dev/null @@ -1,134 +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.Linq; -using System.Xml; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using NuGet.Versioning; -using RepoTasks.Utilities; - -namespace RepoTasks -{ - public class AddMetapackageReferences : Task - { - [Required] - public string ReferencePackagePath { get; set; } - - [Required] - public string MetapackageReferenceType { get; set; } - - [Required] - public string DependencyVersionRangeType { get; set; } - - // MSBuild doesn't allow binding to enums directly. - private enum VersionRangeType - { - Minimum, // [1.1.1, ) - MajorMinor, // [1.1.1, 1.2.0) - } - - [Required] - public ITaskItem[] PackageArtifacts { get; set; } - - [Required] - public ITaskItem[] ExternalDependencies { get; set; } - - public override bool Execute() - { - if (!Enum.TryParse(DependencyVersionRangeType, out var dependencyVersionType)) - { - Log.LogError("Unexpected value {0} for DependencyVersionRangeType", DependencyVersionRangeType); - return false; - } - - // Parse input - var metapackageArtifacts = PackageArtifacts.Where(p => p.GetMetadata(MetapackageReferenceType) == "true"); - var externalArtifacts = ExternalDependencies.Where(p => p.GetMetadata(MetapackageReferenceType) == "true"); - - var xmlDoc = new XmlDocument(); - xmlDoc.Load(ReferencePackagePath); - - // Project - var projectElement = xmlDoc.FirstChild; - - // Items - var itemGroupElement = xmlDoc.CreateElement("ItemGroup"); - Log.LogMessage(MessageImportance.High, $"{MetapackageReferenceType} will include the following packages"); - - foreach (var package in metapackageArtifacts) - { - var packageName = package.ItemSpec; - var packageVersion = package.GetMetadata("Version"); - if (string.IsNullOrEmpty(packageVersion)) - { - Log.LogError("Missing version information for package {0}", packageName); - continue; - } - - var packageVersionValue = GetDependencyVersion(dependencyVersionType, packageName, packageVersion); - Log.LogMessage(MessageImportance.High, $" - Package: {packageName} Version: {packageVersionValue}"); - - var packageReferenceElement = xmlDoc.CreateElement("PackageReference"); - packageReferenceElement.SetAttribute("Include", packageName); - packageReferenceElement.SetAttribute("Version", packageVersionValue); - packageReferenceElement.SetAttribute("PrivateAssets", "None"); - - itemGroupElement.AppendChild(packageReferenceElement); - } - - foreach (var package in externalArtifacts) - { - var packageName = package.ItemSpec; - var packageVersion = package.GetMetadata("Version"); - - if (string.IsNullOrEmpty(packageVersion)) - { - Log.LogError("Missing version information for package {0}", packageName); - continue; - } - - var packageVersionValue = - Enum.TryParse(package.GetMetadata("MetapackageVersionRangeType"), out var packageVersionType) - ? GetDependencyVersion(packageVersionType, packageName, packageVersion) - : GetDependencyVersion(dependencyVersionType, packageName, packageVersion); - - Log.LogMessage(MessageImportance.High, $" - Package: {packageName} Version: {packageVersionValue}"); - - var packageReferenceElement = xmlDoc.CreateElement("PackageReference"); - packageReferenceElement.SetAttribute("Include", packageName); - packageReferenceElement.SetAttribute("Version", packageVersionValue); - packageReferenceElement.SetAttribute("PrivateAssets", "None"); - - itemGroupElement.AppendChild(packageReferenceElement); - } - - projectElement.AppendChild(itemGroupElement); - - // Save updated file - xmlDoc.AppendChild(projectElement); - xmlDoc.Save(ReferencePackagePath); - - return !Log.HasLoggedErrors; - } - - private string GetDependencyVersion(VersionRangeType dependencyVersionType, string packageName, string packageVersion) - { - switch (dependencyVersionType) - { - case VersionRangeType.MajorMinor: - if (!NuGetVersion.TryParse(packageVersion, out var nugetVersion)) - { - Log.LogError("Invalid NuGet version '{0}' for package {1}", packageVersion, packageName); - return null; - } - return $"[{packageVersion}, {nugetVersion.Major}.{nugetVersion.Minor + 1}.0)"; - case VersionRangeType.Minimum: - return packageVersion; - default: - throw new NotImplementedException(); - } - } - } -} diff --git a/build/tasks/ProcessSharedFrameworkDeps.cs b/build/tasks/ProcessSharedFrameworkDeps.cs index db12ad55c663..49189544f3a9 100644 --- a/build/tasks/ProcessSharedFrameworkDeps.cs +++ b/build/tasks/ProcessSharedFrameworkDeps.cs @@ -3,8 +3,10 @@ // 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,6 +30,9 @@ public class ProcessSharedFrameworkDeps : Task [Required] public string FrameworkName { get; set; } + // When generating the .deps.json file, these files are used to replace "project" libraries with "packages". + public ITaskItem[] ResolvedPackageProjectReferences { get; set; } + public string[] PackagesToRemove { get; set; } [Required] @@ -48,7 +53,7 @@ private void ExecuteCore() context = new DependencyContextJsonReader().Read(depsStream); } - LockFile lockFile = LockFileUtilities.GetLockFile(AssetsFilePath, NullLogger.Instance); + var lockFile = LockFileUtilities.GetLockFile(AssetsFilePath, NullLogger.Instance); if (lockFile == null) { throw new ArgumentException($"Could not load a LockFile at '{AssetsFilePath}'.", nameof(AssetsFilePath)); @@ -61,15 +66,17 @@ private void ExecuteCore() // 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); + trimmedRuntimeLibraries = ResolveProjectsAsPackages(ResolvedPackageProjectReferences, trimmedRuntimeLibraries); + if (PackagesToRemove != null && PackagesToRemove.Any()) { - trimmedRuntimeLibraries = RuntimeReference.RemoveReferences(context.RuntimeLibraries, PackagesToRemove); + trimmedRuntimeLibraries = RuntimeReference.RemoveReferences(trimmedRuntimeLibraries, PackagesToRemove); } context = new DependencyContext( context.Target, - context.CompilationOptions, - context.CompileLibraries, + CompilationOptions.Default, + Array.Empty(), trimmedRuntimeLibraries, expandedGraph ); @@ -79,5 +86,43 @@ private void ExecuteCore() new DependencyContextWriter().Write(context, depsStream); } } + + private IEnumerable ResolveProjectsAsPackages(ITaskItem[] resolvedProjects, IEnumerable 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; + } + } + } } -} \ No newline at end of file +} diff --git a/build/tasks/RepoTasks.tasks b/build/tasks/RepoTasks.tasks index d3c257b5d224..5df75df38555 100644 --- a/build/tasks/RepoTasks.tasks +++ b/build/tasks/RepoTasks.tasks @@ -3,7 +3,6 @@ <_RepoTaskAssembly>$(MSBuildThisFileDirectory)bin\publish\RepoTasks.dll - @@ -12,6 +11,7 @@ + diff --git a/build/tasks/ResolveVersionRange.cs b/build/tasks/ResolveVersionRange.cs new file mode 100644 index 000000000000..cedc94b40472 --- /dev/null +++ b/build/tasks/ResolveVersionRange.cs @@ -0,0 +1,68 @@ +// 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(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(); + } + } + } +} diff --git a/build/tasks/Utilities/RuntimeReference.cs b/build/tasks/Utilities/RuntimeReference.cs index 989491e6e29f..8f682eaa52fb 100644 --- a/build/tasks/Utilities/RuntimeReference.cs +++ b/build/tasks/Utilities/RuntimeReference.cs @@ -34,7 +34,7 @@ public static IEnumerable RemoveSharedFxRuntimeEntry(IEnumerable } } - public static List RemoveReferences(IReadOnlyList runtimeLibraries, IEnumerable packages) + public static List RemoveReferences(IEnumerable runtimeLibraries, IEnumerable packages) { List result = new List(); @@ -83,4 +83,4 @@ public static List RemoveReferences(IReadOnlyList$(SharedFxRID) $(HostRid) + $(RuntimeIdentifier) true @@ -29,11 +30,7 @@ This targets file should only be imported by .shfxproj files. none false false + false - - - _ResolvedFrameworkProjectReferencePaths - - diff --git a/eng/targets/SharedFx.Common.targets b/eng/targets/SharedFx.Common.targets index 7ec37078e17f..c0dc68296377 100644 --- a/eng/targets/SharedFx.Common.targets +++ b/eng/targets/SharedFx.Common.targets @@ -97,6 +97,15 @@ This targets file should only be imported by .shfxproj files. + + + _ResolvedFrameworkProjectReferencePaths + + + + _ResolvedPackageProjectReferencePaths + + @@ -175,6 +186,8 @@ This targets file should only be imported by .shfxproj files. AssetsFilePath="$(ProjectAssetsFile)" DepsFilePath="$(PublishDepsFilePath)" OutputPath="$(SharedFxDepsFilePath)" + PackagesToRemove="@(_ResolvedFrameworkProjectReferencePaths->'%(PackageId)')" + ResolvedPackageProjectReferences="@(_ResolvedPackageProjectReferencePaths)" Runtime="$(BaseSharedFxRid)" /> diff --git a/src/Framework/Directory.Build.props b/src/Framework/Directory.Build.props index 2611bb7f8e24..e914efbc027b 100644 --- a/src/Framework/Directory.Build.props +++ b/src/Framework/Directory.Build.props @@ -1,14 +1,18 @@ - - - - + + true + + $(RepositoryRoot)obj\pkg\$(MSBuildProjectName)\ + + + + $(ArtifactsConfigurationDir)$(SharedFxRid)\$(MSBuildProjectName)\ diff --git a/src/Framework/Directory.Build.targets b/src/Framework/Directory.Build.targets index 4c37c1289b22..0decec61d4bd 100644 --- a/src/Framework/Directory.Build.targets +++ b/src/Framework/Directory.Build.targets @@ -1,5 +1,8 @@ + + + $(RestoreSources);https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json @@ -7,11 +10,11 @@ - id=$(RuntimePackageId); + id=$(PackageId); version=$(PackageVersion); authors=$(Authors); rid=$(SharedFxRid); - description=$(RuntimePackageDescription); + description=$(PackageDescription); tags=$(PackageTags.Replace(';', ' ')); licenseUrl=$(PackageLicenseUrl); projectUrl=$(PackageProjectUrl); diff --git a/src/Framework/Framework.UnitTests/SharedFxTests.cs b/src/Framework/Framework.UnitTests/SharedFxTests.cs index 614a9074dc6f..2d255fe35e3f 100644 --- a/src/Framework/Framework.UnitTests/SharedFxTests.cs +++ b/src/Framework/Framework.UnitTests/SharedFxTests.cs @@ -43,6 +43,13 @@ public void ItContainsValidDepsJson(SharedFxConfig config) Assert.NotNull(depsFile["compilationOptions"]); Assert.Empty(depsFile["compilationOptions"]); Assert.NotEmpty(depsFile["runtimes"][config.RuntimeIdentifier]); + Assert.All(depsFile["libraries"], item => + { + var prop = Assert.IsType(item); + var lib = Assert.IsType(prop.Value); + Assert.Equal("package", lib["type"].Value()); + Assert.StartsWith("sha512-", lib["sha512"].Value()); + }); } [Theory] @@ -57,7 +64,6 @@ public void ItContainsVersionFile(SharedFxConfig config) Assert.Equal(config.Version, lines[1]); } - public static TheoryData GetSharedFxConfig() => new TheoryData { diff --git a/src/Framework/Metapackage.targets b/src/Framework/Metapackage.targets new file mode 100644 index 000000000000..14ba454616d9 --- /dev/null +++ b/src/Framework/Metapackage.targets @@ -0,0 +1,59 @@ + + + + false + + false + + false + + true + + true + + $(MSBuildProjectName) + $(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg + + + + + + + + + $(PackageId) + + + + + + + + + + + + + + None + + + + + + + + NuGetPackage + $(PackageId) + $(PackageVersion) + + + + + + + + \ No newline at end of file diff --git a/src/Framework/Microsoft.AspNetCore.All/pkg/Microsoft.AspNetCore.All.pkgproj b/src/Framework/Microsoft.AspNetCore.All/pkg/Microsoft.AspNetCore.All.pkgproj new file mode 100644 index 000000000000..7f4153e2b689 --- /dev/null +++ b/src/Framework/Microsoft.AspNetCore.All/pkg/Microsoft.AspNetCore.All.pkgproj @@ -0,0 +1,44 @@ + + + + netcoreapp2.2 + aspnetcore + Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. + +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. + + + + + + + + + + + + Minimum + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Packages/Microsoft.AspNetCore.All/build/netcoreapp2.2/Microsoft.AspNetCore.All.props b/src/Framework/Microsoft.AspNetCore.All/pkg/build/netcoreapp2.2/Microsoft.AspNetCore.All.props similarity index 100% rename from src/Packages/Microsoft.AspNetCore.All/build/netcoreapp2.2/Microsoft.AspNetCore.All.props rename to src/Framework/Microsoft.AspNetCore.All/pkg/build/netcoreapp2.2/Microsoft.AspNetCore.All.props diff --git a/src/Packages/Microsoft.AspNetCore.All/build/netcoreapp2.2/Microsoft.AspNetCore.All.targets b/src/Framework/Microsoft.AspNetCore.All/pkg/build/netcoreapp2.2/Microsoft.AspNetCore.All.targets similarity index 100% rename from src/Packages/Microsoft.AspNetCore.All/build/netcoreapp2.2/Microsoft.AspNetCore.All.targets rename to src/Framework/Microsoft.AspNetCore.All/pkg/build/netcoreapp2.2/Microsoft.AspNetCore.All.targets diff --git a/src/Packages/Microsoft.AspNetCore.All/lib/netcoreapp2.2/_._ b/src/Framework/Microsoft.AspNetCore.All/pkg/lib/netcoreapp2.2/_._ similarity index 100% rename from src/Packages/Microsoft.AspNetCore.All/lib/netcoreapp2.2/_._ rename to src/Framework/Microsoft.AspNetCore.All/pkg/lib/netcoreapp2.2/_._ diff --git a/src/Framework/Microsoft.AspNetCore.All/src/Microsoft.AspNetCore.All.shfxproj b/src/Framework/Microsoft.AspNetCore.All/src/Microsoft.AspNetCore.All.shfxproj index 8c676393212b..63dfa9f68a08 100644 --- a/src/Framework/Microsoft.AspNetCore.All/src/Microsoft.AspNetCore.All.shfxproj +++ b/src/Framework/Microsoft.AspNetCore.All/src/Microsoft.AspNetCore.All.shfxproj @@ -5,42 +5,17 @@ Microsoft.AspNetCore.App $(MicrosoftNETCoreAppPackageVersion) - - $(MSBuildProjectName) - runtime.$(SharedFxRid).$(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. + runtime.$(SharedFxRid).$(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. -$(PackageId) provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. - +$(MSBuildProjectName) provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. + - - - Minimum - - - + - - - - - - - - - - - - - - - - - - diff --git a/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.props b/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.props new file mode 100644 index 000000000000..d0dd45255792 --- /dev/null +++ b/src/Framework/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.props @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Packages/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.csproj b/src/Framework/Microsoft.AspNetCore.App/pkg/Microsoft.AspNetCore.App.pkgproj similarity index 79% rename from src/Packages/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.csproj rename to src/Framework/Microsoft.AspNetCore.App/pkg/Microsoft.AspNetCore.App.pkgproj index b1de4b7fe890..38fc9b7543d0 100644 --- a/src/Packages/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.csproj +++ b/src/Framework/Microsoft.AspNetCore.App/pkg/Microsoft.AspNetCore.App.pkgproj @@ -1,11 +1,8 @@ - false - false netcoreapp2.2 aspnetcore - false 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. @@ -18,4 +15,12 @@ This package requires the ASP.NET Core runtime. This runtime is installed by the + + + MajorMinor + + + + + diff --git a/src/Packages/Microsoft.AspNetCore.App/build/netcoreapp2.2/Microsoft.AspNetCore.App.props b/src/Framework/Microsoft.AspNetCore.App/pkg/build/netcoreapp2.2/Microsoft.AspNetCore.App.props similarity index 100% rename from src/Packages/Microsoft.AspNetCore.App/build/netcoreapp2.2/Microsoft.AspNetCore.App.props rename to src/Framework/Microsoft.AspNetCore.App/pkg/build/netcoreapp2.2/Microsoft.AspNetCore.App.props diff --git a/src/Packages/Microsoft.AspNetCore.App/build/netcoreapp2.2/Microsoft.AspNetCore.App.targets b/src/Framework/Microsoft.AspNetCore.App/pkg/build/netcoreapp2.2/Microsoft.AspNetCore.App.targets similarity index 100% rename from src/Packages/Microsoft.AspNetCore.App/build/netcoreapp2.2/Microsoft.AspNetCore.App.targets rename to src/Framework/Microsoft.AspNetCore.App/pkg/build/netcoreapp2.2/Microsoft.AspNetCore.App.targets diff --git a/src/Packages/Microsoft.AspNetCore.App/lib/netcoreapp2.2/_._ b/src/Framework/Microsoft.AspNetCore.App/pkg/lib/netcoreapp2.2/_._ similarity index 100% rename from src/Packages/Microsoft.AspNetCore.App/lib/netcoreapp2.2/_._ rename to src/Framework/Microsoft.AspNetCore.App/pkg/lib/netcoreapp2.2/_._ diff --git a/src/Framework/Microsoft.AspNetCore.App/src/Microsoft.AspNetCore.App.shfxproj b/src/Framework/Microsoft.AspNetCore.App/src/Microsoft.AspNetCore.App.shfxproj index 722be0063dac..f0e2af18d92e 100644 --- a/src/Framework/Microsoft.AspNetCore.App/src/Microsoft.AspNetCore.App.shfxproj +++ b/src/Framework/Microsoft.AspNetCore.App/src/Microsoft.AspNetCore.App.shfxproj @@ -5,173 +5,16 @@ Microsoft.NETCore.App $(MicrosoftNETCoreAppPackageVersion) - - $(MSBuildProjectName) - runtime.$(SharedFxRid).$(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. + runtime.$(SharedFxRid).$(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. -$(PackageId) provides a default set of APIs for building an ASP.NET Core application. - +$(MSBuildProjectName) provides a default set of APIs for building an ASP.NET Core application. + - - - MajorMinor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/Packages/Directory.Build.props b/src/Packages/Directory.Build.props deleted file mode 100644 index 02d2ee4d231a..000000000000 --- a/src/Packages/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/Packages/Directory.Build.targets b/src/Packages/Directory.Build.targets deleted file mode 100644 index db9b73869a71..000000000000 --- a/src/Packages/Directory.Build.targets +++ /dev/null @@ -1,11 +0,0 @@ - - - - - NuGetPackage - $(PackageId) - $(PackageVersion) - - - - diff --git a/src/Packages/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj b/src/Packages/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj deleted file mode 100644 index c5bb332ad845..000000000000 --- a/src/Packages/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - false - false - netcoreapp2.2 - aspnetcore - false - Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. - -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. - - - - - - - - - - diff --git a/src/Packages/Microsoft.AspNetCore.Analyzers/Microsoft.AspNetCore.Analyzers.csproj b/src/Packages/Microsoft.AspNetCore.Analyzers/Microsoft.AspNetCore.Analyzers.csproj deleted file mode 100644 index a9f907171997..000000000000 --- a/src/Packages/Microsoft.AspNetCore.Analyzers/Microsoft.AspNetCore.Analyzers.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - false - false - netstandard2.0 - aspnetcore - Microsoft.AspNetCore.Analyzers - - $(ExperimentalVersionPrefix) - $(ExperimentalVersionSuffix) - $(ExperimentalPackageVersion) - false - - false - - - From ecf1bd55079df74db0babb9097e7ad9362431611 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 24 Oct 2018 13:41:28 -0700 Subject: [PATCH 7/7] Fixup artifact info analysis --- .azure/pipelines/ci-official.yml | 2 + build/SharedFx.targets | 21 +++++----- build/artifacts.props | 10 ++--- build/external-dependencies.props | 59 +++++++++++---------------- build/repo.beforecommon.props | 10 ----- build/repo.targets | 12 +++++- src/Framework/Directory.Build.targets | 4 -- src/Framework/Metapackage.targets | 4 +- version.props | 2 +- 9 files changed, 54 insertions(+), 70 deletions(-) delete mode 100644 build/repo.beforecommon.props diff --git a/.azure/pipelines/ci-official.yml b/.azure/pipelines/ci-official.yml index 6647260d893b..bf6f9e35a8f3 100644 --- a/.azure/pipelines/ci-official.yml +++ b/.azure/pipelines/ci-official.yml @@ -6,6 +6,8 @@ trigger: exclude: - release/2.0 +name: $(Date:yyMMdd)-$(Rev:rr) + phases: - phase: Windows queue: diff --git a/build/SharedFx.targets b/build/SharedFx.targets index fd39e7f06542..c2afa7094587 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -5,25 +5,26 @@ $(RepositoryRoot)\src\Framework\Framework.UnitTests\Framework.UnitTests.csproj + + + + + + + + - - - - - - - - - - - + @@ -101,8 +101,8 @@ - - + + @@ -175,7 +175,7 @@ - + @@ -233,7 +233,7 @@ - + diff --git a/build/external-dependencies.props b/build/external-dependencies.props index b1d3110878cc..9ed3c8aebdb0 100644 --- a/build/external-dependencies.props +++ b/build/external-dependencies.props @@ -6,49 +6,36 @@ - - - - - - - false - - false - true - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - diff --git a/build/repo.beforecommon.props b/build/repo.beforecommon.props deleted file mode 100644 index f470e9b2a653..000000000000 --- a/build/repo.beforecommon.props +++ /dev/null @@ -1,10 +0,0 @@ - - - - true - - diff --git a/build/repo.targets b/build/repo.targets index dd7bf5e5ac6f..764d74f46f69 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -15,7 +15,7 @@ SetTeamCityBuildNumberToVersion;$(PrepareDependsOn);VerifyPackageArtifactConfig;VerifyExternalDependencyConfig;PrepareOutputPaths $(CleanDependsOn);CleanArtifacts;CleanRepoArtifacts $(RestoreDependsOn);InstallDotNet - $(CompileDependsOn);BuildRepositories + $(CompileDependsOn);BuildRepositories;BuildSharedFx $(PackageDependsOn);BuildMetapackages;CheckExpectedPackagesExist $(TestDependsOn);_TestRepositories $(GetArtifactInfoDependsOn);ResolveRepoInfo @@ -25,7 +25,7 @@ - + MicrosoftNETCoreAppPackageVersion=$(MicrosoftNETCoreAppPackageVersion); @@ -42,6 +42,14 @@ + + + + - - $(RestoreSources);https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json - - diff --git a/src/Framework/Metapackage.targets b/src/Framework/Metapackage.targets index 14ba454616d9..127854f4ca76 100644 --- a/src/Framework/Metapackage.targets +++ b/src/Framework/Metapackage.targets @@ -44,7 +44,7 @@ - + NuGetPackage $(PackageId) @@ -56,4 +56,4 @@ - \ No newline at end of file + diff --git a/version.props b/version.props index b43ef1365b3c..8719aca8f2e0 100644 --- a/version.props +++ b/version.props @@ -5,7 +5,7 @@ 0 rtm - t000 + $([System.DateTime]::Now.ToString('yyMMdd'))-99 $(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion) 0.2.$(AspNetCorePatchVersion) $(PreReleaseLabel)-$(BuildNumber)