From 08968dd0d6ab23fc9eafdda03ef65d0d6eefab85 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Wed, 19 Jan 2022 10:01:39 -0800 Subject: [PATCH] Always build App.Ref and the targeting packs (#39568) - remove `$(IsTargetingPackBuilding)` entirely --- Directory.Build.props | 5 --- Directory.Build.targets | 1 - eng/Versions.props | 2 - eng/targets/ResolveReferences.targets | 6 +-- ...crosoft.AspNetCore.App.Ref.Internal.csproj | 1 - .../src/Microsoft.AspNetCore.App.Ref.csproj | 7 +--- .../Microsoft.AspNetCore.App.UnitTests.csproj | 10 ----- src/Framework/test/TargetingPackTests.cs | 41 +------------------ src/Installers/Debian/Directory.Build.targets | 2 +- .../Debian.TargetingPack.debproj | 3 -- src/Installers/Rpm/Directory.Build.targets | 2 +- .../TargetingPack/Rpm.TargetingPack.rpmproj | 3 -- .../TargetingPack/TargetingPack.wixproj | 7 +--- src/SiteExtensions/LoggingBranch/LB.csproj | 6 --- 14 files changed, 8 insertions(+), 88 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index e100d883e9b..a4302a035b8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -139,11 +139,6 @@ <RuntimeInstallerBaseName>aspnetcore-runtime</RuntimeInstallerBaseName> <TargetingPackInstallerBaseName>aspnetcore-targeting-pack</TargetingPackInstallerBaseName> - <!-- This is used to produce targeting pack installers/packages once per major.minor. --> - <IsTargetingPackBuilding - Condition=" '$(IsTargetingPackBuilding)' == '' AND '$(AspNetCorePatchVersion)' != '0' ">false</IsTargetingPackBuilding> - <IsTargetingPackBuilding Condition=" '$(IsTargetingPackBuilding)' == '' ">true</IsTargetingPackBuilding> - <!-- 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 diff --git a/Directory.Build.targets b/Directory.Build.targets index 037e05200af..d8bf2ae9cdb 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -47,7 +47,6 @@ <SharedFxProductName>$(Product) $(SharedFxVersion) Shared Framework</SharedFxProductName> <TargetingPackVersion>$(SharedFxVersion)</TargetingPackVersion> - <TargetingPackVersion Condition=" ! $(IsTargetingPackBuilding) ">$(TargetingPackVersionPrefix)</TargetingPackVersion> <PackageVersion Condition=" '$(NoSemVer20)' == 'true' ">$(SiteExtensionVersion)</PackageVersion> </PropertyGroup> diff --git a/eng/Versions.props b/eng/Versions.props index 30384403aba..55201990432 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -29,8 +29,6 @@ It's also used in root Directory.Build.targets to determine the version of the last-built targeting pack. --> <TargetingPackVersionPrefix>$(VersionPrefix)</TargetingPackVersionPrefix> - <!-- Targeting packs do not produce patch versions in servicing builds. No API changes are allowed in patches. --> - <TargetingPackVersionPrefix Condition="'$(IsTargetingPackBuilding)' != 'true'">$(AspNetCoreMajorMinorVersion).0</TargetingPackVersionPrefix> <ExperimentalVersionPrefix>0.3.$(AspNetCorePatchVersion)</ExperimentalVersionPrefix> <!-- ANCM versioning is intentionally 10 + AspNetCoreMajorVersion because earlier versions of ANCM shipped as 8.x. --> <AspNetCoreModuleVersionMajor>$([MSBuild]::Add(10, $(AspNetCoreMajorVersion)))</AspNetCoreModuleVersionMajor> diff --git a/eng/targets/ResolveReferences.targets b/eng/targets/ResolveReferences.targets index e512d898f59..c6ea2d8e0df 100644 --- a/eng/targets/ResolveReferences.targets +++ b/eng/targets/ResolveReferences.targets @@ -253,8 +253,7 @@ --> <ItemGroup Condition=" '$(MSBuildProjectName)' != 'Microsoft.AspNetCore.App.Runtime' AND '$(MSBuildProjectName)' != 'RepoTasks' AND - ($(_CompileTfmUsingReferenceAssemblies) OR - ('$(IsTargetingPackBuilding)' != 'false' AND '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref')) "> + ($(_CompileTfmUsingReferenceAssemblies) OR '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref') "> <PackageReference Include="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)" IsImplicitlyDefined="true" @@ -276,8 +275,7 @@ '$(IsServicingBuild)' == 'true' AND '$(IsImplementationProject)' == 'true' AND '$(MSBuildProjectName)' != 'Microsoft.AspNetCore.App.Runtime' AND - ($(_CompileTfmUsingReferenceAssemblies) OR - ('$(IsTargetingPackBuilding)' != 'false' AND '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref')) "> + ($(_CompileTfmUsingReferenceAssemblies) OR '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref') "> <ItemGroup> <ResolvedCompileFileDefinitions Remove="@(ResolvedCompileFileDefinitions)" Condition=" '%(NuGetPackageId)' != 'Microsoft.Internal.Runtime.AspNetCore.Transport' AND diff --git a/src/Framework/App.Ref.Internal/src/Microsoft.AspNetCore.App.Ref.Internal.csproj b/src/Framework/App.Ref.Internal/src/Microsoft.AspNetCore.App.Ref.Internal.csproj index f22ed58d292..08223b01aff 100644 --- a/src/Framework/App.Ref.Internal/src/Microsoft.AspNetCore.App.Ref.Internal.csproj +++ b/src/Framework/App.Ref.Internal/src/Microsoft.AspNetCore.App.Ref.Internal.csproj @@ -4,7 +4,6 @@ <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <IsShippingPackage>false</IsShippingPackage> <IsPackable>true</IsPackable> - <IsPackable Condition="'$(IsTargetingPackBuilding)' == 'false'">false</IsPackable> <PackageId>$(TargetingPackName).Internal</PackageId> <VersionPrefix>$(TargetingPackVersionPrefix)</VersionPrefix> <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory> diff --git a/src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj b/src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj index 5ebac9529ba..ef1b75f1030 100644 --- a/src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj +++ b/src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj @@ -4,7 +4,6 @@ <PropertyGroup> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <IsPackable>true</IsPackable> - <IsPackable Condition="'$(IsTargetingPackBuilding)' == 'false'">false</IsPackable> <PackageId>$(TargetingPackName)</PackageId> <VersionPrefix>$(TargetingPackVersionPrefix)</VersionPrefix> @@ -89,8 +88,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant </PropertyGroup> <PropertyGroup> - <!-- If this project won't produce a package, don't bother building anything. --> - <BuildDependsOn Condition="'$(IsTargetingPackBuilding)' != 'false'"> + <BuildDependsOn> $(BuildDependsOn); _ResolveTargetingPackContent; GeneratePackageOverrides; @@ -99,9 +97,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant _InstallTargetingPackIntoLocalDotNet; _CreateTargetingPackArchive; </BuildDependsOn> - - <!-- No-op when in source build --> - <BuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'"/> </PropertyGroup> <!-- Override the default MSBuild targets so that nothing is returned from the project since it represents a collection of assemblies. --> diff --git a/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj b/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj index dc0cb5a1752..441daea4915 100644 --- a/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj +++ b/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj @@ -55,10 +55,6 @@ <_Parameter1>TargetingPackLayoutRoot</_Parameter1> <_Parameter2>$(TargetingPackLayoutRoot)</_Parameter2> </AssemblyAttribute> - <AssemblyAttribute Include="Microsoft.AspNetCore.TestData"> - <_Parameter1>IsTargetingPackBuilding</_Parameter1> - <_Parameter2>$(IsTargetingPackBuilding)</_Parameter2> - </AssemblyAttribute> <AssemblyAttribute Include="Microsoft.AspNetCore.TestData"> <_Parameter1>VerifyAncmBinary</_Parameter1> <_Parameter2>$(VerifyAncmBinary)</_Parameter2> @@ -72,12 +68,6 @@ <ItemGroup> <ProjectReference Include="$(RepoRoot)\src\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj" - Condition=" $(IsTargetingPackBuilding) " - Private="false" - ReferenceOutputAssembly="false" - SkipGetTargetFrameworkProperties="true" /> - <ProjectReference Include="$(RepoRoot)\src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj" - Condition=" !$(IsTargetingPackBuilding) " Private="false" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" /> diff --git a/src/Framework/test/TargetingPackTests.cs b/src/Framework/test/TargetingPackTests.cs index 9ae909ae055..b7799ce3ff2 100644 --- a/src/Framework/test/TargetingPackTests.cs +++ b/src/Framework/test/TargetingPackTests.cs @@ -18,7 +18,6 @@ public class TargetingPackTests private readonly string _targetingPackTfm; private readonly string _targetingPackRoot; private readonly ITestOutputHelper _output; - private readonly bool _isTargetingPackBuilding; public TargetingPackTests(ITestOutputHelper output) { @@ -33,17 +32,11 @@ public class TargetingPackTests "packs", "Microsoft.AspNetCore.App.Ref", TestData.GetTestDataValue("TargetingPackVersion")); - _isTargetingPackBuilding = bool.Parse(TestData.GetTestDataValue("IsTargetingPackBuilding")); } [Fact] public void TargetingPackContainsListedAssemblies() { - if (!_isTargetingPackBuilding) - { - return; - } - var actualAssemblies = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll") .Select(Path.GetFileNameWithoutExtension) .ToHashSet(); @@ -69,11 +62,6 @@ public class TargetingPackTests [Fact] public void RefAssembliesHaveExpectedAssemblyVersions() { - if (!_isTargetingPackBuilding) - { - return; - } - IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories); Assert.NotEmpty(dlls); @@ -94,11 +82,6 @@ public class TargetingPackTests [Fact] public void RefAssemblyReferencesHaveExpectedAssemblyVersions() { - if (!_isTargetingPackBuilding) - { - return; - } - IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories); Assert.NotEmpty(dlls); @@ -121,11 +104,6 @@ public class TargetingPackTests [Fact] public void PackageOverridesContainsCorrectEntries() { - if (!_isTargetingPackBuilding) - { - return; - } - var packageOverridePath = Path.Combine(_targetingPackRoot, "data", "PackageOverrides.txt"); AssertEx.FileExists(packageOverridePath); @@ -185,11 +163,6 @@ public class TargetingPackTests [Fact] public void AssembliesAreReferenceAssemblies() { - if (!_isTargetingPackBuilding) - { - return; - } - IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref"), "*.dll", SearchOption.AllDirectories); Assert.NotEmpty(dlls); @@ -219,11 +192,6 @@ public class TargetingPackTests [Fact] public void PlatformManifestListsAllFiles() { - if (!_isTargetingPackBuilding) - { - return; - } - var platformManifestPath = Path.Combine(_targetingPackRoot, "data", "PlatformManifest.txt"); var expectedAssemblies = TestData.GetSharedFxDependencies() .Split(';', StringSplitOptions.RemoveEmptyEntries) @@ -289,11 +257,6 @@ public class TargetingPackTests [Fact] public void FrameworkListListsContainsCorrectEntries() { - if (!_isTargetingPackBuilding) - { - return; - } - var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml"); var expectedAssemblies = TestData.GetTargetingPackDependencies() .Split(';', StringSplitOptions.RemoveEmptyEntries) @@ -361,7 +324,7 @@ public class TargetingPackTests [Fact] public void FrameworkListListsContainsCorrectPaths() { - if (!_isTargetingPackBuilding || string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) { return; } @@ -403,7 +366,7 @@ public class TargetingPackTests [Fact] public void FrameworkListListsContainsAnalyzerLanguage() { - if (!_isTargetingPackBuilding || string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) { return; } diff --git a/src/Installers/Debian/Directory.Build.targets b/src/Installers/Debian/Directory.Build.targets index 84554cd0c38..6b46efd2584 100644 --- a/src/Installers/Debian/Directory.Build.targets +++ b/src/Installers/Debian/Directory.Build.targets @@ -28,7 +28,7 @@ <Target Name="Pack" /> <Target Name="DebBuild" DependsOnTargets="$(DebBuildDependsOn)" - Condition="!( '$(IsTargetingPackBuilding)' == 'false' AND '$(MSBuildProjectName)' == 'Debian.TargetingPack' )"> + Condition=" '$(MSBuildProjectName)' != 'Debian.TargetingPack' "> <!-- Generate debian_config.json. We can't simply use WriteLinesToFile because of https://github.com/Microsoft/msbuild/issues/1622. Use our custom GenerateFileFromTemplate task instead --> <PropertyGroup> <DebianConfigProperties> diff --git a/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj b/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj index 557b7317df8..9f22597fa9b 100644 --- a/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj +++ b/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj @@ -44,9 +44,6 @@ <!-- Deb installers are versioned as M.N.P~PreReleaseVersionLabel-Build following the core-setup convention --> <DebPackageVersion Condition="'$(VersionSuffix)' != ''">$(DebPackageVersion)~$(VersionSuffix)</DebPackageVersion> <PackageRevision>1</PackageRevision> - - <!-- Suppresses building this project completely during servicing builds. --> - <DebBuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'" /> </PropertyGroup> </Project> diff --git a/src/Installers/Rpm/Directory.Build.targets b/src/Installers/Rpm/Directory.Build.targets index 964ab6c4c30..73bd9c4915f 100644 --- a/src/Installers/Rpm/Directory.Build.targets +++ b/src/Installers/Rpm/Directory.Build.targets @@ -37,7 +37,7 @@ <Target Name="Pack" /> <Target Name="RpmBuild" DependsOnTargets="$(RpmBuildDependsOn)" - Condition="!( '$(IsTargetingPackBuilding)' == 'false' AND '$(MSBuildProjectName)' == 'Rpm.TargetingPack' )"> + Condition=" '$(MSBuildProjectName)' != 'Rpm.TargetingPack' "> <!-- Create layout: Create changelog --> <PropertyGroup> <ChangeLogProps>DATE=$([System.DateTime]::UtcNow.ToString(ddd MMM dd yyyy))</ChangeLogProps> diff --git a/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj b/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj index 17287160949..b2916bc0a83 100644 --- a/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj +++ b/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj @@ -39,8 +39,5 @@ <!-- Set package revision to '1' for RTM releases, but include the build number in pre-releases --> <PackageRevision Condition=" '$(VersionSuffix)' == '' ">1</PackageRevision> <PackageRevision Condition=" '$(VersionSuffix)' != '' ">0.1.$(VersionSuffix.Replace('-', '_'))</PackageRevision> - - <!-- Suppresses building this project completely during servicing builds. --> - <RpmBuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'" /> </PropertyGroup> </Project> diff --git a/src/Installers/Windows/TargetingPack/TargetingPack.wixproj b/src/Installers/Windows/TargetingPack/TargetingPack.wixproj index 610d68da3d4..27894df7180 100644 --- a/src/Installers/Windows/TargetingPack/TargetingPack.wixproj +++ b/src/Installers/Windows/TargetingPack/TargetingPack.wixproj @@ -10,7 +10,6 @@ <OutputType>Package</OutputType> <Cabinet>targeting_pack_$(Platform).cab</Cabinet> <IsShipping>true</IsShipping> - <SkipCopyToArtifactsDirectory Condition="'$(IsTargetingPackBuilding)' == 'false'">true</SkipCopyToArtifactsDirectory> <ProjectGuid>0AC34F1B-8056-4FFB-A398-E6BB7D67B48D</ProjectGuid> <HarvestDirectoryAutoGenerateGuids>true</HarvestDirectoryAutoGenerateGuids> <HarvestDirectorySuppressSpecificWarnings>5150;5151</HarvestDirectorySuppressSpecificWarnings> @@ -79,13 +78,9 @@ <ProductName>Microsoft ASP.NET Core $(PackageBrandingVersion) Targeting Pack ($(Platform))</ProductName> <PackageFileName>$(OutputName)$(TargetExt)</PackageFileName> <DefineConstants>$(DefineConstants);ProductName=$(ProductName)</DefineConstants> - - <!-- Suppresses building this project completely during servicing builds. --> - <BuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'" /> </PropertyGroup> - <Target Name="CreateTargetingPackNugetPackage" AfterTargets="CopyToArtifactsDirectory;Build" - Condition="'$(IsTargetingPackBuilding)' != 'false'"> + <Target Name="CreateTargetingPackNugetPackage" AfterTargets="CopyToArtifactsDirectory;Build"> <PropertyGroup> <MsiFullPath>$(InstallersOutputPath)$(PackageFileName)</MsiFullPath> </PropertyGroup> diff --git a/src/SiteExtensions/LoggingBranch/LB.csproj b/src/SiteExtensions/LoggingBranch/LB.csproj index 2fd20d6072f..7832725de86 100644 --- a/src/SiteExtensions/LoggingBranch/LB.csproj +++ b/src/SiteExtensions/LoggingBranch/LB.csproj @@ -25,12 +25,6 @@ <HostingStartupRuntimeStoreTargets Include="$(DefaultNetCoreTargetFramework)" Runtime="$(TargetRuntimeIdentifier)" /> <ProjectReference Include="..\..\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj" - Condition=" $(IsTargetingPackBuilding) " - Private="false" - ReferenceOutputAssembly="false" - SkipGetTargetFrameworkProperties="true" /> - <ProjectReference Include="..\..\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj" - Condition=" !$(IsTargetingPackBuilding) " Private="false" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" /> -- GitLab