From 564e049ae9d220a4576420e060c5a94698b0f843 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 23 Dec 2017 00:03:05 -0500 Subject: [PATCH] Build Microsoft.AspNetCore.App - Produce .App and .All metapackages and shared frameworks --- build/SharedFx.props | 1 + build/SharedFx.targets | 158 ++++++--- build/artifacts.props | 313 +++++++++--------- build/repo.targets | 9 + build/tasks/AddMetapackageReferences.cs | 9 +- .../tools/templates/SharedFx/SharedFx.csproj | 4 +- .../Microsoft.AspNetCore.All.csproj | 4 + .../Microsoft.AspNetCore.App.csproj | 30 ++ .../Microsoft.AspNetCore.App.props | 5 + .../lib/netcoreapp2.1/_._ | 0 10 files changed, 328 insertions(+), 205 deletions(-) create mode 100644 src/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.csproj create mode 100644 src/Microsoft.AspNetCore.App/build/netcoreapp2.1/Microsoft.AspNetCore.App.props create mode 100644 src/Microsoft.AspNetCore.App/lib/netcoreapp2.1/_._ diff --git a/build/SharedFx.props b/build/SharedFx.props index ea3f45c872..f142cf3d82 100644 --- a/build/SharedFx.props +++ b/build/SharedFx.props @@ -6,6 +6,7 @@ <_WorkOutputDir>$(_WorkRoot).o\ <_SrcDir>$(RepositoryRoot)src\ <_AllMetapackageDir>$(_SrcDir)Microsoft.AspNetCore.All\ + <_AppMetapackageDir>$(_SrcDir)Microsoft.AspNetCore.App\ <_TemplatesDir>$(MSBuildThisFileDirectory)tools\templates\ <_DockerDir>$(MSBuildThisFileDirectory)tools\docker\ <_PackagingDir>$(MSBuildThisFileDirectory)tools\packaging\ diff --git a/build/SharedFx.targets b/build/SharedFx.targets index 6092d80c68..17a4355534 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -6,85 +6,139 @@ $([MSBuild]::NormalizeDirectory($(ArtifactsDir)))assets\Runtime\$(PackageVersion)\ - - - - + - $(_WorkRoot)Microsoft.AspNetCore.All\ - <_SharedFxProps>Configuration=$(Configuration);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath);AspNetUniverseBuildOffline=true - <_SharedFxProps>$(_SharedFxProps);RuntimeFrameworkVersion=$(MicrosoftNETCoreApp21PackageVersion) + $(_WorkRoot)$(MetapackageName)\ + Configuration=$(Configuration);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath);AspNetUniverseBuildOffline=true + $(CommonProps);RuntimeFrameworkVersion=$(MicrosoftNETCoreApp21PackageVersion) + $(CommonProps);AppMetapackageVersion=$(PackageVersion) + - + + + + - + - + - + - + + + MetapackageName=Microsoft.AspNetCore.App + $(AppMetapackageProps);MetapackageSource=$(_AppMetapackageDir) + $(AppMetapackageProps);MetapackageReferenceType=AppMetapackage + MetapackageName=Microsoft.AspNetCore.All + $(AllMetapackageProps);MetapackageSource=$(_AllMetapackageDir) + $(AllMetapackageProps);MetapackageReferenceType=AllMetapackage + + + + + + + true - - - - $(_WorkRoot)SharedFx\ + $(_WorkRoot)AppSharedFx\ + $(_WorkRoot)AllSharedFx\ $(_WorkRoot)Publish\ $(_WorkRoot)CrossGen\ $(_WorkRoot)CrossGenSymbols\ $(_WorkRoot)CrossGenTool\ $(_WorkRoot)CrossGenRsp\ - $(SharedFxIntermediateOutputPath)shared\Microsoft.AspNetCore.All\$(PackageVersion)\ + $(SharedFxIntermediateOutputPath)shared\Microsoft.AspNetCore.App\$(PackageVersion)\ + $(SharedFxIntermediateOutputPath)shared\Microsoft.AspNetCore.All\$(PackageVersion)\ $(SharedFxRID) + + : + %3B + win7-x64 win7-x86 - <_SharedFxProps>Configuration=$(Configuration);RuntimeIdentifier=$(SharedFxRestoreRid) - <_SharedFxProps>$(_SharedFxProps);RuntimeFrameworkVersion=$(MicrosoftNETCoreApp21PackageVersion) - <_SharedFxProps>$(_SharedFxProps);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath) - <_SharedFxProps>$(_SharedFxProps);AspNetUniverseBuildOffline=true + Configuration=$(Configuration);RuntimeIdentifier=$(SharedFxRestoreRid) + $(CommonSharedFxProps);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath) + $(CommonSharedFxProps);AspNetUniverseBuildOffline=true + + + + + + $(CommonSharedFxProps) + $(RestoreProps);SharedFxPackage=$(SharedFxPackage) + $(RestoreProps);SharedFxPackageVersion=$(PackageVersion) + $(RestoreProps);SharedFxBase=$(SharedFxBase) + $(RestoreProps);SharedFxBaseVersion=$(SharedFxBaseVersion) - + - + Properties="$(RestoreProps);_Target=Restore" /> - - + + + SharedFxWorkDirectory=$(AppSharedFxWorkDirectory) + $(AppSharedFxProps);SharedFxPackage=Microsoft.AspNetCore.App + $(AppSharedFxProps);SharedFxBase=Microsoft.NETCore.App + $(AppSharedFxProps);SharedFxBaseVersion=$(MicrosoftNETCoreApp21PackageVersion) + SharedFxWorkDirectory=$(AllSharedFxWorkDirectory) + $(AllSharedFxProps);SharedFxPackage=Microsoft.AspNetCore.All + $(AllSharedFxProps);SharedFxBase=Microsoft.AspNetCore.App + $(AllSharedFxProps);SharedFxBaseVersion=$(PackageVersion) + + + + + + + + + + + + + + + + + + + Properties="$(CommonSharedFxProps);GenerateRuntimeConfigurationFiles=true;SelfContained=false;PublishDir=$(SharedFxPublishDirectory)" /> @@ -100,11 +154,11 @@ + DestinationFiles="$(SharedFxPublishDirectory)\$(SharedFxPackage).deps.json" /> + DestinationFiles="$(SharedFxPublishDirectory)\$(SharedFxPackage).runtimeconfig.json" /> @@ -119,19 +173,28 @@ - - - - - + + + + + SharedFxPackage=Microsoft.AspNetCore.App + $(AppSharedFxProps);SharedFxWorkDirectory=$(AppSharedFxWorkDirectory) + $(AppSharedFxProps);SharedFxPublishDirectory=$(AppSharedFxPublishDirectory) + SharedFxPackage=Microsoft.AspNetCore.All + $(AllSharedFxProps);SharedFxWorkDirectory=$(AllSharedFxWorkDirectory) + $(AllSharedFxProps);SharedFxPublishDirectory=$(AllSharedFxPublishDirectory) + + + + @@ -148,8 +211,8 @@ .dylib - - + + @@ -170,15 +233,20 @@ - - + + + + - - <_AssembliesToCrossgen Include="$(SharedFxPublishDirectory)**\*.dll" /> + + <_AssembliesToCrossgen Include="$(SharedFxIntermediateOutputPath)**\*.dll" /> @@ -208,7 +276,7 @@ - + @@ -232,7 +300,7 @@ - + @@ -261,7 +329,7 @@ diff --git a/build/artifacts.props b/build/artifacts.props index 943ef9e82f..02c9434654 100644 --- a/build/artifacts.props +++ b/build/artifacts.props @@ -2,7 +2,8 @@ - false + false + false false false false @@ -15,125 +16,127 @@ - + + - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - + + - + - - - - + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - + + + - + - + - - + + - - - - + + + + - - - - - - + + + + + + - + - + - - - - - - - + + + + + + + @@ -151,92 +154,92 @@ - + - + - - - + + + - - + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - - + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + - - - - + + + + - + - + - - - + + + - + @@ -245,14 +248,14 @@ - + - + - + diff --git a/build/repo.targets b/build/repo.targets index a9b2998960..ea11b566aa 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -198,6 +198,15 @@ + + + + + + diff --git a/build/tasks/AddMetapackageReferences.cs b/build/tasks/AddMetapackageReferences.cs index 9693ac31ef..ea5b700d93 100644 --- a/build/tasks/AddMetapackageReferences.cs +++ b/build/tasks/AddMetapackageReferences.cs @@ -15,6 +15,9 @@ namespace RepoTasks [Required] public string ReferencePackagePath { get; set; } + [Required] + public string MetapackageReferenceType { get; set; } + [Required] public ITaskItem[] BuildArtifacts { get; set; } @@ -27,8 +30,8 @@ namespace RepoTasks public override bool Execute() { // Parse input - var metapackageArtifacts = PackageArtifacts.Where(p => p.GetMetadata("Metapackage") == "true"); - var externalArtifacts = ExternalDependencies.Where(p => p.GetMetadata("Metapackage") == "true"); + var metapackageArtifacts = PackageArtifacts.Where(p => p.GetMetadata(MetapackageReferenceType) == "true"); + var externalArtifacts = ExternalDependencies.Where(p => p.GetMetadata(MetapackageReferenceType) == "true"); var buildArtifacts = BuildArtifacts.Select(ArtifactInfo.Parse) .OfType() .Where(p => !p.IsSymbolsArtifact); @@ -41,7 +44,7 @@ namespace RepoTasks // Items var itemGroupElement = xmlDoc.CreateElement("ItemGroup"); - Log.LogMessage(MessageImportance.High, $"Metapackage will include the following packages"); + Log.LogMessage(MessageImportance.High, $"{MetapackageReferenceType} will include the following packages"); foreach (var package in metapackageArtifacts) { diff --git a/build/tools/templates/SharedFx/SharedFx.csproj b/build/tools/templates/SharedFx/SharedFx.csproj index 0c9298a024..5f130476e7 100644 --- a/build/tools/templates/SharedFx/SharedFx.csproj +++ b/build/tools/templates/SharedFx/SharedFx.csproj @@ -20,8 +20,8 @@ - - + + diff --git a/src/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj b/src/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj index 252ff6be55..e200628429 100644 --- a/src/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj +++ b/src/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj @@ -28,4 +28,8 @@ + + + + diff --git a/src/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.csproj b/src/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.csproj new file mode 100644 index 0000000000..71ab3a1e61 --- /dev/null +++ b/src/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.csproj @@ -0,0 +1,30 @@ + + + + + + $(DotNetRestoreSources) + + $(RestoreSources); + https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; + + + $(RestoreSources); + https://api.nuget.org/v3/index.json; + + + false + false + netcoreapp2.1 + aspnetcore + Microsoft.AspNetCore.App + false + + + + + + + + diff --git a/src/Microsoft.AspNetCore.App/build/netcoreapp2.1/Microsoft.AspNetCore.App.props b/src/Microsoft.AspNetCore.App/build/netcoreapp2.1/Microsoft.AspNetCore.App.props new file mode 100644 index 0000000000..42d32389f1 --- /dev/null +++ b/src/Microsoft.AspNetCore.App/build/netcoreapp2.1/Microsoft.AspNetCore.App.props @@ -0,0 +1,5 @@ + + + Microsoft.AspNetCore.App + + \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.App/lib/netcoreapp2.1/_._ b/src/Microsoft.AspNetCore.App/lib/netcoreapp2.1/_._ new file mode 100644 index 0000000000..e69de29bb2