Skip to content

Commit f4908fd

Browse files
dougbuShreyasJejurkar
authored andcommitted
Always build App.Ref and the targeting packs (dotnet#39568)
- remove `$(IsTargetingPackBuilding)` entirely
1 parent 297d8c8 commit f4908fd

14 files changed

+8
-88
lines changed

Directory.Build.props

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@
139139
<RuntimeInstallerBaseName>aspnetcore-runtime</RuntimeInstallerBaseName>
140140
<TargetingPackInstallerBaseName>aspnetcore-targeting-pack</TargetingPackInstallerBaseName>
141141

142-
<!-- This is used to produce targeting pack installers/packages once per major.minor. -->
143-
<IsTargetingPackBuilding
144-
Condition=" '$(IsTargetingPackBuilding)' == '' AND '$(AspNetCorePatchVersion)' != '0' ">false</IsTargetingPackBuilding>
145-
<IsTargetingPackBuilding Condition=" '$(IsTargetingPackBuilding)' == '' ">true</IsTargetingPackBuilding>
146-
147142
<!--
148143
Archives and installers using this prefix are intended for internal use only.
149144
For example, this .zip is used to handoff bits to partner teams who then incorporate our shared frameworks

Directory.Build.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
<SharedFxProductName>$(Product) $(SharedFxVersion) Shared Framework</SharedFxProductName>
4848

4949
<TargetingPackVersion>$(SharedFxVersion)</TargetingPackVersion>
50-
<TargetingPackVersion Condition=" ! $(IsTargetingPackBuilding) ">$(TargetingPackVersionPrefix)</TargetingPackVersion>
5150

5251
<PackageVersion Condition=" '$(NoSemVer20)' == 'true' ">$(SiteExtensionVersion)</PackageVersion>
5352
</PropertyGroup>

eng/Versions.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
It's also used in root Directory.Build.targets to determine the version of the last-built targeting pack.
3030
-->
3131
<TargetingPackVersionPrefix>$(VersionPrefix)</TargetingPackVersionPrefix>
32-
<!-- Targeting packs do not produce patch versions in servicing builds. No API changes are allowed in patches. -->
33-
<TargetingPackVersionPrefix Condition="'$(IsTargetingPackBuilding)' != 'true'">$(AspNetCoreMajorMinorVersion).0</TargetingPackVersionPrefix>
3432
<ExperimentalVersionPrefix>0.3.$(AspNetCorePatchVersion)</ExperimentalVersionPrefix>
3533
<!-- ANCM versioning is intentionally 10 + AspNetCoreMajorVersion because earlier versions of ANCM shipped as 8.x. -->
3634
<AspNetCoreModuleVersionMajor>$([MSBuild]::Add(10, $(AspNetCoreMajorVersion)))</AspNetCoreModuleVersionMajor>

eng/targets/ResolveReferences.targets

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@
253253
-->
254254
<ItemGroup Condition=" '$(MSBuildProjectName)' != 'Microsoft.AspNetCore.App.Runtime' AND
255255
'$(MSBuildProjectName)' != 'RepoTasks' AND
256-
($(_CompileTfmUsingReferenceAssemblies) OR
257-
('$(IsTargetingPackBuilding)' != 'false' AND '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref')) ">
256+
($(_CompileTfmUsingReferenceAssemblies) OR '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref') ">
258257
<PackageReference Include="Microsoft.Internal.Runtime.AspNetCore.Transport"
259258
Version="$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)"
260259
IsImplicitlyDefined="true"
@@ -276,8 +275,7 @@
276275
'$(IsServicingBuild)' == 'true' AND
277276
'$(IsImplementationProject)' == 'true' AND
278277
'$(MSBuildProjectName)' != 'Microsoft.AspNetCore.App.Runtime' AND
279-
($(_CompileTfmUsingReferenceAssemblies) OR
280-
('$(IsTargetingPackBuilding)' != 'false' AND '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref')) ">
278+
($(_CompileTfmUsingReferenceAssemblies) OR '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref') ">
281279
<ItemGroup>
282280
<ResolvedCompileFileDefinitions Remove="@(ResolvedCompileFileDefinitions)"
283281
Condition=" '%(NuGetPackageId)' != 'Microsoft.Internal.Runtime.AspNetCore.Transport' AND

src/Framework/App.Ref.Internal/src/Microsoft.AspNetCore.App.Ref.Internal.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
55
<IsShippingPackage>false</IsShippingPackage>
66
<IsPackable>true</IsPackable>
7-
<IsPackable Condition="'$(IsTargetingPackBuilding)' == 'false'">false</IsPackable>
87
<PackageId>$(TargetingPackName).Internal</PackageId>
98
<VersionPrefix>$(TargetingPackVersionPrefix)</VersionPrefix>
109
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>

src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<PropertyGroup>
55
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
66
<IsPackable>true</IsPackable>
7-
<IsPackable Condition="'$(IsTargetingPackBuilding)' == 'false'">false</IsPackable>
87
<PackageId>$(TargetingPackName)</PackageId>
98
<VersionPrefix>$(TargetingPackVersionPrefix)</VersionPrefix>
109

@@ -89,8 +88,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
8988
</PropertyGroup>
9089

9190
<PropertyGroup>
92-
<!-- If this project won't produce a package, don't bother building anything. -->
93-
<BuildDependsOn Condition="'$(IsTargetingPackBuilding)' != 'false'">
91+
<BuildDependsOn>
9492
$(BuildDependsOn);
9593
_ResolveTargetingPackContent;
9694
GeneratePackageOverrides;
@@ -99,9 +97,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
9997
_InstallTargetingPackIntoLocalDotNet;
10098
_CreateTargetingPackArchive;
10199
</BuildDependsOn>
102-
103-
<!-- No-op when in source build -->
104-
<BuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'"/>
105100
</PropertyGroup>
106101

107102
<!-- Override the default MSBuild targets so that nothing is returned from the project since it represents a collection of assemblies. -->

src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@
5555
<_Parameter1>TargetingPackLayoutRoot</_Parameter1>
5656
<_Parameter2>$(TargetingPackLayoutRoot)</_Parameter2>
5757
</AssemblyAttribute>
58-
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
59-
<_Parameter1>IsTargetingPackBuilding</_Parameter1>
60-
<_Parameter2>$(IsTargetingPackBuilding)</_Parameter2>
61-
</AssemblyAttribute>
6258
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
6359
<_Parameter1>VerifyAncmBinary</_Parameter1>
6460
<_Parameter2>$(VerifyAncmBinary)</_Parameter2>
@@ -72,12 +68,6 @@
7268

7369
<ItemGroup>
7470
<ProjectReference Include="$(RepoRoot)\src\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj"
75-
Condition=" $(IsTargetingPackBuilding) "
76-
Private="false"
77-
ReferenceOutputAssembly="false"
78-
SkipGetTargetFrameworkProperties="true" />
79-
<ProjectReference Include="$(RepoRoot)\src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj"
80-
Condition=" !$(IsTargetingPackBuilding) "
8171
Private="false"
8272
ReferenceOutputAssembly="false"
8373
SkipGetTargetFrameworkProperties="true" />

src/Framework/test/TargetingPackTests.cs

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public class TargetingPackTests
1818
private readonly string _targetingPackTfm;
1919
private readonly string _targetingPackRoot;
2020
private readonly ITestOutputHelper _output;
21-
private readonly bool _isTargetingPackBuilding;
2221

2322
public TargetingPackTests(ITestOutputHelper output)
2423
{
@@ -33,17 +32,11 @@ public TargetingPackTests(ITestOutputHelper output)
3332
"packs",
3433
"Microsoft.AspNetCore.App.Ref",
3534
TestData.GetTestDataValue("TargetingPackVersion"));
36-
_isTargetingPackBuilding = bool.Parse(TestData.GetTestDataValue("IsTargetingPackBuilding"));
3735
}
3836

3937
[Fact]
4038
public void TargetingPackContainsListedAssemblies()
4139
{
42-
if (!_isTargetingPackBuilding)
43-
{
44-
return;
45-
}
46-
4740
var actualAssemblies = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll")
4841
.Select(Path.GetFileNameWithoutExtension)
4942
.ToHashSet();
@@ -69,11 +62,6 @@ public void TargetingPackContainsListedAssemblies()
6962
[Fact]
7063
public void RefAssembliesHaveExpectedAssemblyVersions()
7164
{
72-
if (!_isTargetingPackBuilding)
73-
{
74-
return;
75-
}
76-
7765
IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories);
7866
Assert.NotEmpty(dlls);
7967

@@ -94,11 +82,6 @@ public void RefAssembliesHaveExpectedAssemblyVersions()
9482
[Fact]
9583
public void RefAssemblyReferencesHaveExpectedAssemblyVersions()
9684
{
97-
if (!_isTargetingPackBuilding)
98-
{
99-
return;
100-
}
101-
10285
IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories);
10386
Assert.NotEmpty(dlls);
10487

@@ -121,11 +104,6 @@ public void RefAssemblyReferencesHaveExpectedAssemblyVersions()
121104
[Fact]
122105
public void PackageOverridesContainsCorrectEntries()
123106
{
124-
if (!_isTargetingPackBuilding)
125-
{
126-
return;
127-
}
128-
129107
var packageOverridePath = Path.Combine(_targetingPackRoot, "data", "PackageOverrides.txt");
130108

131109
AssertEx.FileExists(packageOverridePath);
@@ -185,11 +163,6 @@ public void PackageOverridesContainsCorrectEntries()
185163
[Fact]
186164
public void AssembliesAreReferenceAssemblies()
187165
{
188-
if (!_isTargetingPackBuilding)
189-
{
190-
return;
191-
}
192-
193166
IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref"), "*.dll", SearchOption.AllDirectories);
194167
Assert.NotEmpty(dlls);
195168

@@ -219,11 +192,6 @@ public void AssembliesAreReferenceAssemblies()
219192
[Fact]
220193
public void PlatformManifestListsAllFiles()
221194
{
222-
if (!_isTargetingPackBuilding)
223-
{
224-
return;
225-
}
226-
227195
var platformManifestPath = Path.Combine(_targetingPackRoot, "data", "PlatformManifest.txt");
228196
var expectedAssemblies = TestData.GetSharedFxDependencies()
229197
.Split(';', StringSplitOptions.RemoveEmptyEntries)
@@ -289,11 +257,6 @@ public void PlatformManifestListsAllFiles()
289257
[Fact]
290258
public void FrameworkListListsContainsCorrectEntries()
291259
{
292-
if (!_isTargetingPackBuilding)
293-
{
294-
return;
295-
}
296-
297260
var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml");
298261
var expectedAssemblies = TestData.GetTargetingPackDependencies()
299262
.Split(';', StringSplitOptions.RemoveEmptyEntries)
@@ -361,7 +324,7 @@ void CompareFrameworkElements(HashSet<string> expectedAssemblyNames, IEnumerable
361324
[Fact]
362325
public void FrameworkListListsContainsCorrectPaths()
363326
{
364-
if (!_isTargetingPackBuilding || string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
327+
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
365328
{
366329
return;
367330
}
@@ -403,7 +366,7 @@ public void FrameworkListListsContainsCorrectPaths()
403366
[Fact]
404367
public void FrameworkListListsContainsAnalyzerLanguage()
405368
{
406-
if (!_isTargetingPackBuilding || string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
369+
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
407370
{
408371
return;
409372
}

src/Installers/Debian/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<Target Name="Pack" />
2929

3030
<Target Name="DebBuild" DependsOnTargets="$(DebBuildDependsOn)"
31-
Condition="!( '$(IsTargetingPackBuilding)' == 'false' AND '$(MSBuildProjectName)' == 'Debian.TargetingPack' )">
31+
Condition=" '$(MSBuildProjectName)' != 'Debian.TargetingPack' ">
3232
<!-- 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 -->
3333
<PropertyGroup>
3434
<DebianConfigProperties>

src/Installers/Debian/TargetingPack/Debian.TargetingPack.debproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@
4444
<!-- Deb installers are versioned as M.N.P~PreReleaseVersionLabel-Build following the core-setup convention -->
4545
<DebPackageVersion Condition="'$(VersionSuffix)' != ''">$(DebPackageVersion)~$(VersionSuffix)</DebPackageVersion>
4646
<PackageRevision>1</PackageRevision>
47-
48-
<!-- Suppresses building this project completely during servicing builds. -->
49-
<DebBuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'" />
5047
</PropertyGroup>
5148

5249
</Project>

src/Installers/Rpm/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<Target Name="Pack" />
3838

3939
<Target Name="RpmBuild" DependsOnTargets="$(RpmBuildDependsOn)"
40-
Condition="!( '$(IsTargetingPackBuilding)' == 'false' AND '$(MSBuildProjectName)' == 'Rpm.TargetingPack' )">
40+
Condition=" '$(MSBuildProjectName)' != 'Rpm.TargetingPack' ">
4141
<!-- Create layout: Create changelog -->
4242
<PropertyGroup>
4343
<ChangeLogProps>DATE=$([System.DateTime]::UtcNow.ToString(ddd MMM dd yyyy))</ChangeLogProps>

src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,5 @@
3939
<!-- Set package revision to '1' for RTM releases, but include the build number in pre-releases -->
4040
<PackageRevision Condition=" '$(VersionSuffix)' == '' ">1</PackageRevision>
4141
<PackageRevision Condition=" '$(VersionSuffix)' != '' ">0.1.$(VersionSuffix.Replace('-', '_'))</PackageRevision>
42-
43-
<!-- Suppresses building this project completely during servicing builds. -->
44-
<RpmBuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'" />
4542
</PropertyGroup>
4643
</Project>

src/Installers/Windows/TargetingPack/TargetingPack.wixproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<OutputType>Package</OutputType>
1111
<Cabinet>targeting_pack_$(Platform).cab</Cabinet>
1212
<IsShipping>true</IsShipping>
13-
<SkipCopyToArtifactsDirectory Condition="'$(IsTargetingPackBuilding)' == 'false'">true</SkipCopyToArtifactsDirectory>
1413
<ProjectGuid>0AC34F1B-8056-4FFB-A398-E6BB7D67B48D</ProjectGuid>
1514
<HarvestDirectoryAutoGenerateGuids>true</HarvestDirectoryAutoGenerateGuids>
1615
<HarvestDirectorySuppressSpecificWarnings>5150;5151</HarvestDirectorySuppressSpecificWarnings>
@@ -79,13 +78,9 @@
7978
<ProductName>Microsoft ASP.NET Core $(PackageBrandingVersion) Targeting Pack ($(Platform))</ProductName>
8079
<PackageFileName>$(OutputName)$(TargetExt)</PackageFileName>
8180
<DefineConstants>$(DefineConstants);ProductName=$(ProductName)</DefineConstants>
82-
83-
<!-- Suppresses building this project completely during servicing builds. -->
84-
<BuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'" />
8581
</PropertyGroup>
8682

87-
<Target Name="CreateTargetingPackNugetPackage" AfterTargets="CopyToArtifactsDirectory;Build"
88-
Condition="'$(IsTargetingPackBuilding)' != 'false'">
83+
<Target Name="CreateTargetingPackNugetPackage" AfterTargets="CopyToArtifactsDirectory;Build">
8984
<PropertyGroup>
9085
<MsiFullPath>$(InstallersOutputPath)$(PackageFileName)</MsiFullPath>
9186
</PropertyGroup>

src/SiteExtensions/LoggingBranch/LB.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
<HostingStartupRuntimeStoreTargets Include="$(DefaultNetCoreTargetFramework)" Runtime="$(TargetRuntimeIdentifier)" />
2626

2727
<ProjectReference Include="..\..\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj"
28-
Condition=" $(IsTargetingPackBuilding) "
29-
Private="false"
30-
ReferenceOutputAssembly="false"
31-
SkipGetTargetFrameworkProperties="true" />
32-
<ProjectReference Include="..\..\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj"
33-
Condition=" !$(IsTargetingPackBuilding) "
3428
Private="false"
3529
ReferenceOutputAssembly="false"
3630
SkipGetTargetFrameworkProperties="true" />

0 commit comments

Comments
 (0)