Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate the Microsoft.AspNetCore.App metapackage in favor of targeting and runtime packs #7832

Merged
merged 2 commits into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@

<SharedFxProductName>$(Product) $(PackageVersion) Shared Framework</SharedFxProductName>
<SharedFxDescription>Shared Framework for hosting of Microsoft ASP.NET Core applications. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub ($(RepositoryUrl)). We happily accept issues and PRs.</SharedFxDescription>

<RuntimeInstallerBaseName>aspnetcore-runtime</RuntimeInstallerBaseName>
<TargetingPackInstallerBaseName>aspnetcore-targeting-pack</TargetingPackInstallerBaseName>
<!--
Archives and installers using this prefix are intended for internal-use only.
For example, this .zip is used to handoff bits to partner teams who then incorporate our shared frameworks
into their own installers.
-->
<InternalInstallerBaseName>$(RuntimeInstallerBaseName)-internal</InternalInstallerBaseName>
</PropertyGroup>

<!-- Warnings and errors -->
Expand Down Expand Up @@ -61,7 +70,7 @@
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

<!-- These project types are disabled because the presence of a PackageReference causes issues for NuGet. -->
<DisableSourceLink Condition="'$(MSBuildProjectExtension)' == '.zipproj' OR '$(MSBuildProjectExtension)' == '.debproj' OR '$(MSBuildProjectExtension)' == '.rpmproj'">true</DisableSourceLink>
<DisableSourceLink Condition="'$(MSBuildProjectExtension)' == '.debproj' OR '$(MSBuildProjectExtension)' == '.rpmproj'">true</DisableSourceLink>
</PropertyGroup>

<ItemGroup Condition="'$(DisableSourceLink)' != 'true'">
Expand Down Expand Up @@ -94,7 +103,7 @@
</SupportedRuntimeIdentifiers>

<!-- Make error messages clickable in VS Code's console -->
<GenerateFullPaths Condition="'$(VSCODE_PID)' != ''">true</GenerateFullPaths>
<GenerateFullPaths Condition="'$(VSCODE_CWD)' != '' OR '$(TERM_PROGRAM)' == 'vscode'">true</GenerateFullPaths>

<!-- Suppress the message about using a preview version of .NET Core SDK. We are okay with this and don't need the warning. -->
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
Expand Down Expand Up @@ -179,6 +188,13 @@
<BuildIisNativeProjects Condition="'$(BuildNative)' != 'false' AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64')">true</BuildIisNativeProjects>
<!-- This property is shared by several projects to layout the AspNetCore.App targeting pack for installers -->
<TargetingPackLayoutRoot>$(ArtifactsObjDir)TargetingPack.Layout\$(Configuration)\</TargetingPackLayoutRoot>
<!-- This property is shared by several projects to layout the AspNetCore.App shared framework for installers -->
<SharedFrameworkLayoutRoot>$(ArtifactsObjDir)SharedFx.Layout\$(Configuration)\$(TargetRuntimeIdentifier)\</SharedFrameworkLayoutRoot>
<!-- This property points to a folder which includes both Microsoft.NETCore.App and AspNetCore.App. -->
<RedistSharedFrameworkLayoutRoot>$(ArtifactsObjDir)RedistSharedFx.Layout\$(Configuration)\$(TargetRuntimeIdentifier)\</RedistSharedFrameworkLayoutRoot>

<ArchiveExtension>.tar.gz</ArchiveExtension>
<ArchiveExtension Condition="'$(TargetOsName)' == 'win'">.zip</ArchiveExtension>
</PropertyGroup>

<Import Project="eng\Workarounds.props" />
Expand Down
5 changes: 5 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
-->
<IsShippingPackage Condition=" '$(IsShippingPackage)' == '' ">false</IsShippingPackage>

<!--
By default, assemblies which are only in the Microsoft.AspNetCore.App shared framework are not available as NuGet packages.
-->
<IsPackable Condition="'$(IsAspNetCoreApp)' == 'true' AND '$(IsShippingPackage)' != 'true'">false</IsPackable>
natemcmaster marked this conversation as resolved.
Show resolved Hide resolved

<PackageOutputPath Condition=" '$(IsShippingPackage)' == 'true' ">$(ArtifactsShippingPackagesDir)</PackageOutputPath>
<PackageOutputPath Condition=" '$(IsShippingPackage)' != 'true' ">$(ArtifactsNonShippingPackagesDir)</PackageOutputPath>

Expand Down
2 changes: 1 addition & 1 deletion build/CodeSign.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<Target Name="CollectFileSignInfo">
<PropertyGroup>
<BaseRedistNetCorePath>$(ArtifactsDir)obj\ar\</BaseRedistNetCorePath>
<BaseRedistNetCorePath>$(ArtifactsDir)obj\RedistSharedFx.Layout\$(Configuration)\</BaseRedistNetCorePath>
<RedistNetCorePath>$(BaseRedistNetCorePath)$(TargetRuntimeIdentifier)\</RedistNetCorePath>
</PropertyGroup>

Expand Down
42 changes: 2 additions & 40 deletions build/SharedFx.targets
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
<Project>
<PropertyGroup>
<UnitTestFxProject>$(RepositoryRoot)src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj</UnitTestFxProject>
<UnitTestFxProject>$([MSBuild]::NormalizePath($(UnitTestFxProject)))</UnitTestFxProject>
<BuildSharedFxDependsOn>_BuildSharedFxProjects;TestSharedFx</BuildSharedFxDependsOn>
<BuildSharedFxDependsOn>_BuildSharedFxProjects;RemoveSharedFrameworkOnlyRefsFromNuspec</BuildSharedFxDependsOn>
<BuildSharedFxDependsOn Condition="'$(TestOnly)' != 'true'">$(BuildSharedFxDependsOn);CodeSign</BuildSharedFxDependsOn>
</PropertyGroup>

<ItemGroup>
<FxProjectToBuild Include="$(RepositoryRoot)src\Framework\**\*.pkgproj" />
<FxProjectToBuild Include="$(RepositoryRoot)src\Framework\**\*.shfxproj" />
<FxProjectToBuild Include="$(UnitTestFxProject)" />
<FxProjectToBuild Condition=" '$(BuildRuntimeArchive)' != 'false' " Include="$(RepositoryRoot)src\Installers\Archive\*.*proj" />

<FxProjectToBuild Condition=" '$(TargetRuntimeIdentifier)' == 'linux-x64' AND '$(LinuxInstallerType)' == 'deb' " Include="$(RepositoryRoot)src\Installers\Debian\**\*.*proj" />
<FxProjectToBuild Condition=" '$(TargetRuntimeIdentifier)' == 'linux-x64' AND '$(LinuxInstallerType)' == 'rpm' " Include="$(RepositoryRoot)src\Installers\Rpm\**\*.*proj" />

Expand All @@ -21,7 +14,7 @@

<Target Name="BuildSharedFx" DependsOnTargets="$(BuildSharedFxDependsOn)" />

<Target Name="_BuildSharedFxProjects">
<Target Name="_BuildSharedFxProjects" Condition="@(FxProjectToBuild->Count()) != 0">

<PropertyGroup>
<_RestoreGraphProjectInput>@(FxProjectToBuild)</_RestoreGraphProjectInput>
Expand All @@ -42,35 +35,4 @@
SkipNonexistentTargets="true" />
</Target>

<Target Name="TestSharedFx" DependsOnTargets="InstallDotNet">

<PropertyGroup>
<!-- The file path to the log file, from within the container -->
<UnitTestFxTrxLogFile>$(LogOutputDir)SharedFx-UnitTests-$(PackageVersion)-$(TargetRuntimeIdentifier).trx</UnitTestFxTrxLogFile>
<!-- The trx file path from the perspective of the TeamCity agent -->
<UnitTestFxTrxPhysicalFilePath>$(UnitTestFxTrxLogFile)</UnitTestFxTrxPhysicalFilePath>
<UnitTestFxTrxPhysicalFilePath Condition="'$(HostMachineRepositoryRoot)' != ''">$(HostMachineRepositoryRoot)/artifacts/logs/SharedFx-UnitTests.trx</UnitTestFxTrxPhysicalFilePath>
</PropertyGroup>

<MSBuild Projects="$(UnitTestFxProject)" Targets="GetTargetPath" Properties="$(BuildProperties)">
<Output TaskParameter="TargetOutputs" ItemName="SharedFxTestAssembly" />
</MSBuild>

<RunDotNet
IgnoreStandardErrorWarningFormat="true"
IgnoreExitCode="true"
Arguments="vstest;
--Framework:%(TargetFrameworkIdentifier),Version=v%(TargetFrameworkVersion);
--Logger:$([MSBuild]::Escape('trx;LogFileName=$(UnitTestFxTrxLogFile)'));
%(SharedFxTestAssembly.Identity);
--;RunConfiguration.NoAutoReporters=true">
<Output TaskParameter="ExitCode" PropertyName="VsTestExitCode" />
</RunDotNet>

<Message Text="##teamcity[importData type='vstest' path='$(UnitTestFxTrxPhysicalFilePath)']"
Importance="High"
Condition="'$(TEAMCITY_VERSION)' != '' AND Exists('$(UnitTestFxTrxLogFile)')" />
<Error Text="SharedFx.UnitTests failed with exit code '$(VsTestExitCode)'." Condition=" $(VsTestExitCode) != 0 " />
</Target>

</Project>
1 change: 1 addition & 0 deletions build/repo.props
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
<DotNetProjects Include="
$(RepositoryRoot)src\Framework\ref\Microsoft.AspNetCore.App.Ref.csproj;
$(RepositoryRoot)src\Framework\src\Microsoft.AspNetCore.App.Runtime.csproj;
$(RepositoryRoot)src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj;
$(RepositoryRoot)src\DefaultBuilder\**\*.*proj;
$(RepositoryRoot)src\Features\JsonPatch\**\*.*proj;
$(RepositoryRoot)src\DataProtection\**\*.*proj;
Expand Down
2 changes: 1 addition & 1 deletion build/repo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<CompileDependsOn>$(CompileDependsOn);BuildProjects</CompileDependsOn>

<PackageDependsOn>$(PackageDependsOn);PackProjects</PackageDependsOn>
<PackageDependsOn Condition=" '$(BuildAllProjects)' == 'true' ">$(PackageDependsOn);BuildSharedFx;RemoveSharedFrameworkOnlyRefsFromNuspec</PackageDependsOn>
<PackageDependsOn Condition=" '$(BuildAllProjects)' == 'true' ">$(PackageDependsOn);RemoveSharedFrameworkOnlyRefsFromNuspec;BuildSharedFx</PackageDependsOn>

<TestDependsOn />
<TestDependsOn Condition=" '$(_RunBuild)' == 'true' ">$(TestDependsOn);Compile</TestDependsOn>
Expand Down
55 changes: 0 additions & 55 deletions build/tasks/GenerateRestoreSourcesPropsFile.cs

This file was deleted.

14 changes: 13 additions & 1 deletion build/tasks/GenerateSharedFrameworkDepsFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.DotNet.Build.Tasks;
using Microsoft.Extensions.DependencyModel;
using RepoTasks.Utilities;

namespace RepoTasks
{
Expand All @@ -38,6 +38,9 @@ public class GenerateSharedFrameworkDepsFile : Task
[Required]
public string RuntimePackageName { get; set; }

[Required]
public string PlatformManifestOutputPath { get; set; }

public override bool Execute()
{
ExecuteCore();
Expand All @@ -51,6 +54,7 @@ private void ExecuteCore()
var runtimeFiles = new List<RuntimeFile>();
var nativeFiles = new List<RuntimeFile>();
var resourceAssemblies = new List<ResourceAssembly>();
var platformManifest = new List<string>();

foreach (var reference in References)
{
Expand All @@ -62,13 +66,15 @@ private void ExecuteCore()
{
var nativeFile = new RuntimeFile(fileName, null, fileVersion);
nativeFiles.Add(nativeFile);
platformManifest.Add($"{fileName}|{FrameworkName}||{fileVersion}");
}
else
{
var runtimeFile = new RuntimeFile(fileName,
fileVersion: fileVersion,
assemblyVersion: assemblyVersion.ToString());
runtimeFiles.Add(runtimeFile);
platformManifest.Add($"{fileName}|{FrameworkName}|{assemblyVersion}|{fileVersion}");
}
}

Expand All @@ -91,6 +97,12 @@ private void ExecuteCore()
Enumerable.Empty<RuntimeFallbacks>());

Directory.CreateDirectory(Path.GetDirectoryName(DepsFilePath));
Directory.CreateDirectory(Path.GetDirectoryName(PlatformManifestOutputPath));

File.WriteAllText(
PlatformManifestOutputPath,
string.Join("\n", platformManifest.OrderBy(n => n)),
Encoding.UTF8);

try
{
Expand Down
Loading