From 0bcb79da8662d90f706ea2715ad31d7b20f4f90e Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Sun, 16 Jan 2022 22:55:10 -0800 Subject: [PATCH 1/2] Always build App.Ref and the targeting packs - 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 e100d883e9b1..a4302a035b87 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -139,11 +139,6 @@ aspnetcore-runtime aspnetcore-targeting-pack - - false - true - $(VersionPrefix) - - $(AspNetCoreMajorMinorVersion).0 0.3.$(AspNetCorePatchVersion) $([MSBuild]::Add(10, $(AspNetCoreMajorVersion))) diff --git a/eng/targets/ResolveReferences.targets b/eng/targets/ResolveReferences.targets index e512d898f592..c6ea2d8e0df3 100644 --- a/eng/targets/ResolveReferences.targets +++ b/eng/targets/ResolveReferences.targets @@ -253,8 +253,7 @@ --> + ($(_CompileTfmUsingReferenceAssemblies) OR '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref') "> + ($(_CompileTfmUsingReferenceAssemblies) OR '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref') "> false $(TargetingPackName).Internal $(TargetingPackVersionPrefix) false 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 3a0832ee217a..f33f097e6ac1 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 @@ $(DefaultNetCoreTargetFramework) true - false $(TargetingPackName) $(TargetingPackVersionPrefix) @@ -89,8 +88,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant - - + $(BuildDependsOn); _ResolveTargetingPackContent; GeneratePackageOverrides; @@ -99,9 +97,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant _InstallTargetingPackIntoLocalDotNet; _CreateTargetingPackArchive; - - - diff --git a/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj b/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj index dc0cb5a17529..441daea49158 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 <_Parameter2>$(TargetingPackLayoutRoot) - - <_Parameter1>IsTargetingPackBuilding - <_Parameter2>$(IsTargetingPackBuilding) - <_Parameter1>VerifyAncmBinary <_Parameter2>$(VerifyAncmBinary) @@ -72,12 +68,6 @@ - diff --git a/src/Framework/test/TargetingPackTests.cs b/src/Framework/test/TargetingPackTests.cs index 9ae909ae055d..b7799ce3ff2c 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 TargetingPackTests(ITestOutputHelper output) "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 void TargetingPackContainsListedAssemblies() [Fact] public void RefAssembliesHaveExpectedAssemblyVersions() { - if (!_isTargetingPackBuilding) - { - return; - } - IEnumerable dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories); Assert.NotEmpty(dlls); @@ -94,11 +82,6 @@ public void RefAssembliesHaveExpectedAssemblyVersions() [Fact] public void RefAssemblyReferencesHaveExpectedAssemblyVersions() { - if (!_isTargetingPackBuilding) - { - return; - } - IEnumerable dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories); Assert.NotEmpty(dlls); @@ -121,11 +104,6 @@ public void RefAssemblyReferencesHaveExpectedAssemblyVersions() [Fact] public void PackageOverridesContainsCorrectEntries() { - if (!_isTargetingPackBuilding) - { - return; - } - var packageOverridePath = Path.Combine(_targetingPackRoot, "data", "PackageOverrides.txt"); AssertEx.FileExists(packageOverridePath); @@ -185,11 +163,6 @@ public void PackageOverridesContainsCorrectEntries() [Fact] public void AssembliesAreReferenceAssemblies() { - if (!_isTargetingPackBuilding) - { - return; - } - IEnumerable dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref"), "*.dll", SearchOption.AllDirectories); Assert.NotEmpty(dlls); @@ -219,11 +192,6 @@ public void AssembliesAreReferenceAssemblies() [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 void PlatformManifestListsAllFiles() [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 @@ void CompareFrameworkElements(HashSet expectedAssemblyNames, IEnumerable [Fact] public void FrameworkListListsContainsCorrectPaths() { - if (!_isTargetingPackBuilding || string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) { return; } @@ -403,7 +366,7 @@ public void FrameworkListListsContainsCorrectPaths() [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 84554cd0c383..6b46efd25844 100644 --- a/src/Installers/Debian/Directory.Build.targets +++ b/src/Installers/Debian/Directory.Build.targets @@ -28,7 +28,7 @@ + Condition=" '$(MSBuildProjectName)' != 'Debian.TargetingPack' "> diff --git a/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj b/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj index 557b7317df8e..9f22597fa9bc 100644 --- a/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj +++ b/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj @@ -44,9 +44,6 @@ $(DebPackageVersion)~$(VersionSuffix) 1 - - - diff --git a/src/Installers/Rpm/Directory.Build.targets b/src/Installers/Rpm/Directory.Build.targets index 964ab6c4c30f..73bd9c4915fc 100644 --- a/src/Installers/Rpm/Directory.Build.targets +++ b/src/Installers/Rpm/Directory.Build.targets @@ -37,7 +37,7 @@ + Condition=" '$(MSBuildProjectName)' != 'Rpm.TargetingPack' "> DATE=$([System.DateTime]::UtcNow.ToString(ddd MMM dd yyyy)) diff --git a/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj b/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj index 17287160949a..b2916bc0a83f 100644 --- a/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj +++ b/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj @@ -39,8 +39,5 @@ 1 0.1.$(VersionSuffix.Replace('-', '_')) - - - diff --git a/src/Installers/Windows/TargetingPack/TargetingPack.wixproj b/src/Installers/Windows/TargetingPack/TargetingPack.wixproj index 610d68da3d43..27894df71808 100644 --- a/src/Installers/Windows/TargetingPack/TargetingPack.wixproj +++ b/src/Installers/Windows/TargetingPack/TargetingPack.wixproj @@ -10,7 +10,6 @@ Package targeting_pack_$(Platform).cab true - true 0AC34F1B-8056-4FFB-A398-E6BB7D67B48D true 5150;5151 @@ -79,13 +78,9 @@ Microsoft ASP.NET Core $(PackageBrandingVersion) Targeting Pack ($(Platform)) $(OutputName)$(TargetExt) $(DefineConstants);ProductName=$(ProductName) - - - - + $(InstallersOutputPath)$(PackageFileName) diff --git a/src/SiteExtensions/LoggingBranch/LB.csproj b/src/SiteExtensions/LoggingBranch/LB.csproj index 2fd20d6072f7..7832725de868 100644 --- a/src/SiteExtensions/LoggingBranch/LB.csproj +++ b/src/SiteExtensions/LoggingBranch/LB.csproj @@ -25,12 +25,6 @@ - From 4c8c6611964d6cefbca60b8eed10f4b0ea8dbe3f Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Mon, 17 Jan 2022 14:04:57 -0800 Subject: [PATCH 2/2] Undo optional changes - subset of #39568 - set `$(IsTargetingPackBuilding)` to `true` unconditionally - leave all _use_ of `$(IsTargetingPackBuilding)` --- Directory.Build.props | 1 + 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, 84 insertions(+), 8 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index a4302a035b87..d71b30890551 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -138,6 +138,7 @@ Microsoft.AspNetCore.App.Ref aspnetcore-runtime aspnetcore-targeting-pack + true $(VersionPrefix) + + $(AspNetCoreMajorMinorVersion).0 0.3.$(AspNetCorePatchVersion) $([MSBuild]::Add(10, $(AspNetCoreMajorVersion))) diff --git a/eng/targets/ResolveReferences.targets b/eng/targets/ResolveReferences.targets index c6ea2d8e0df3..e512d898f592 100644 --- a/eng/targets/ResolveReferences.targets +++ b/eng/targets/ResolveReferences.targets @@ -253,7 +253,8 @@ --> + ($(_CompileTfmUsingReferenceAssemblies) OR + ('$(IsTargetingPackBuilding)' != 'false' AND '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref')) "> + ($(_CompileTfmUsingReferenceAssemblies) OR + ('$(IsTargetingPackBuilding)' != 'false' AND '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref')) "> false $(TargetingPackName).Internal $(TargetingPackVersionPrefix) false 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 f33f097e6ac1..3a0832ee217a 100644 --- a/src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj +++ b/src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj @@ -4,6 +4,7 @@ $(DefaultNetCoreTargetFramework) true + false $(TargetingPackName) $(TargetingPackVersionPrefix) @@ -88,7 +89,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant - + + $(BuildDependsOn); _ResolveTargetingPackContent; GeneratePackageOverrides; @@ -97,6 +99,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant _InstallTargetingPackIntoLocalDotNet; _CreateTargetingPackArchive; + + + diff --git a/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj b/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj index 441daea49158..dc0cb5a17529 100644 --- a/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj +++ b/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj @@ -55,6 +55,10 @@ <_Parameter1>TargetingPackLayoutRoot <_Parameter2>$(TargetingPackLayoutRoot) + + <_Parameter1>IsTargetingPackBuilding + <_Parameter2>$(IsTargetingPackBuilding) + <_Parameter1>VerifyAncmBinary <_Parameter2>$(VerifyAncmBinary) @@ -68,6 +72,12 @@ + diff --git a/src/Framework/test/TargetingPackTests.cs b/src/Framework/test/TargetingPackTests.cs index b7799ce3ff2c..9ae909ae055d 100644 --- a/src/Framework/test/TargetingPackTests.cs +++ b/src/Framework/test/TargetingPackTests.cs @@ -18,6 +18,7 @@ public class TargetingPackTests private readonly string _targetingPackTfm; private readonly string _targetingPackRoot; private readonly ITestOutputHelper _output; + private readonly bool _isTargetingPackBuilding; public TargetingPackTests(ITestOutputHelper output) { @@ -32,11 +33,17 @@ public TargetingPackTests(ITestOutputHelper output) "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(); @@ -62,6 +69,11 @@ public void TargetingPackContainsListedAssemblies() [Fact] public void RefAssembliesHaveExpectedAssemblyVersions() { + if (!_isTargetingPackBuilding) + { + return; + } + IEnumerable dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories); Assert.NotEmpty(dlls); @@ -82,6 +94,11 @@ public void RefAssembliesHaveExpectedAssemblyVersions() [Fact] public void RefAssemblyReferencesHaveExpectedAssemblyVersions() { + if (!_isTargetingPackBuilding) + { + return; + } + IEnumerable dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories); Assert.NotEmpty(dlls); @@ -104,6 +121,11 @@ public void RefAssemblyReferencesHaveExpectedAssemblyVersions() [Fact] public void PackageOverridesContainsCorrectEntries() { + if (!_isTargetingPackBuilding) + { + return; + } + var packageOverridePath = Path.Combine(_targetingPackRoot, "data", "PackageOverrides.txt"); AssertEx.FileExists(packageOverridePath); @@ -163,6 +185,11 @@ public void PackageOverridesContainsCorrectEntries() [Fact] public void AssembliesAreReferenceAssemblies() { + if (!_isTargetingPackBuilding) + { + return; + } + IEnumerable dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref"), "*.dll", SearchOption.AllDirectories); Assert.NotEmpty(dlls); @@ -192,6 +219,11 @@ public void AssembliesAreReferenceAssemblies() [Fact] public void PlatformManifestListsAllFiles() { + if (!_isTargetingPackBuilding) + { + return; + } + var platformManifestPath = Path.Combine(_targetingPackRoot, "data", "PlatformManifest.txt"); var expectedAssemblies = TestData.GetSharedFxDependencies() .Split(';', StringSplitOptions.RemoveEmptyEntries) @@ -257,6 +289,11 @@ public void PlatformManifestListsAllFiles() [Fact] public void FrameworkListListsContainsCorrectEntries() { + if (!_isTargetingPackBuilding) + { + return; + } + var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml"); var expectedAssemblies = TestData.GetTargetingPackDependencies() .Split(';', StringSplitOptions.RemoveEmptyEntries) @@ -324,7 +361,7 @@ void CompareFrameworkElements(HashSet expectedAssemblyNames, IEnumerable [Fact] public void FrameworkListListsContainsCorrectPaths() { - if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) + if (!_isTargetingPackBuilding || string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) { return; } @@ -366,7 +403,7 @@ public void FrameworkListListsContainsCorrectPaths() [Fact] public void FrameworkListListsContainsAnalyzerLanguage() { - if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) + if (!_isTargetingPackBuilding || string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) { return; } diff --git a/src/Installers/Debian/Directory.Build.targets b/src/Installers/Debian/Directory.Build.targets index 6b46efd25844..84554cd0c383 100644 --- a/src/Installers/Debian/Directory.Build.targets +++ b/src/Installers/Debian/Directory.Build.targets @@ -28,7 +28,7 @@ + Condition="!( '$(IsTargetingPackBuilding)' == 'false' AND '$(MSBuildProjectName)' == 'Debian.TargetingPack' )"> diff --git a/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj b/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj index 9f22597fa9bc..557b7317df8e 100644 --- a/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj +++ b/src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj @@ -44,6 +44,9 @@ $(DebPackageVersion)~$(VersionSuffix) 1 + + + diff --git a/src/Installers/Rpm/Directory.Build.targets b/src/Installers/Rpm/Directory.Build.targets index 73bd9c4915fc..964ab6c4c30f 100644 --- a/src/Installers/Rpm/Directory.Build.targets +++ b/src/Installers/Rpm/Directory.Build.targets @@ -37,7 +37,7 @@ + Condition="!( '$(IsTargetingPackBuilding)' == 'false' AND '$(MSBuildProjectName)' == 'Rpm.TargetingPack' )"> DATE=$([System.DateTime]::UtcNow.ToString(ddd MMM dd yyyy)) diff --git a/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj b/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj index b2916bc0a83f..17287160949a 100644 --- a/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj +++ b/src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj @@ -39,5 +39,8 @@ 1 0.1.$(VersionSuffix.Replace('-', '_')) + + + diff --git a/src/Installers/Windows/TargetingPack/TargetingPack.wixproj b/src/Installers/Windows/TargetingPack/TargetingPack.wixproj index 27894df71808..610d68da3d43 100644 --- a/src/Installers/Windows/TargetingPack/TargetingPack.wixproj +++ b/src/Installers/Windows/TargetingPack/TargetingPack.wixproj @@ -10,6 +10,7 @@ Package targeting_pack_$(Platform).cab true + true 0AC34F1B-8056-4FFB-A398-E6BB7D67B48D true 5150;5151 @@ -78,9 +79,13 @@ Microsoft ASP.NET Core $(PackageBrandingVersion) Targeting Pack ($(Platform)) $(OutputName)$(TargetExt) $(DefineConstants);ProductName=$(ProductName) + + + - + $(InstallersOutputPath)$(PackageFileName) diff --git a/src/SiteExtensions/LoggingBranch/LB.csproj b/src/SiteExtensions/LoggingBranch/LB.csproj index 7832725de868..2fd20d6072f7 100644 --- a/src/SiteExtensions/LoggingBranch/LB.csproj +++ b/src/SiteExtensions/LoggingBranch/LB.csproj @@ -25,6 +25,12 @@ +