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

Add Installer project build skip functionality for servicing builds #2291

Merged
merged 1 commit into from
Jan 29, 2020
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
27 changes: 27 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,34 @@
<NETCoreAppMaximumVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppMaximumVersion>
<NETCoreAppFrameworkVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppFrameworkVersion>
<NETCoreAppFramework>netcoreapp$(NETCoreAppFrameworkVersion)</NETCoreAppFramework>
<!--
The NETStandard.Library targeting pack uses this patch version, which does not match the
runtime's. After publishing a new version of the NETStandard targeting pack in a servicing
release, increase this number by one.
-->
<NETStandardPatchVersion>0</NETStandardPatchVersion>
</PropertyGroup>

<!--
Servicing build settings for Setup/Installer packages. Instructions:
* To enable a package build for the current patch release, set PatchVersion to match the current
patch version of that package. ("major.minor.patch".) This is normally the same as
PatchVersion above, but not always. Notably, NETStandard has its own patch version.
* When the PatchVersion property above is incremented at the beginning of the next servicing
release, all packages listed below automatically stop building because the property no longer
matches the metadata. (Do not delete the items!)
If the PatchVersion below is never changed from '0', the package will build in the 'master'
branch, and during a forked RTM release ("X.Y.0"). It will stop building for "X.Y.1" unless
manually enabled by updating the metadata.
-->
<ItemGroup>
<!-- Targeting packs are only patched in extreme cases. -->
<ProjectServicingConfiguration Include="Microsoft.NETCore.App.Ref" PatchVersion="0" />
<ProjectServicingConfiguration Include="NETStandard.Library.Ref" PatchVersion="0" />
</ItemGroup>

<PropertyGroup>
<!-- Arcade dependencies -->
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.20071.3</MicrosoftDotNetApiCompatVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<IsFrameworkPackage>true</IsFrameworkPackage>
<ShortFrameworkName>netstandard</ShortFrameworkName>
<ProductBrandPrefix>Microsoft .NET Standard</ProductBrandPrefix>

<ProductBandVersion>2.1</ProductBandVersion>
<ProductionVersion>$(ProductBandVersion).0</ProductionVersion>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this property not needed anymore? Was '0' used to specify patch version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed, but it's calculated in the following target, so this is a minor refactor to improve clarity:

<!--
Arcade SDK versioning is defined by static properties in a targets file: work around this by
moving properties based on versioning into a target.
-->
<Target Name="GetProductVersions">
<PropertyGroup>
<IncludePreReleaseLabelInPackageVersion Condition="'$(DotNetFinalVersionKind)' != 'release'">true</IncludePreReleaseLabelInPackageVersion>
<IncludePreReleaseLabelInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludePreReleaseLabelInPackageVersion>
<IncludePreReleaseLabelInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludePreReleaseLabelInPackageVersion>
<IncludeBuildNumberInPackageVersion Condition="'$(StabilizePackageVersion)' != 'true'">true</IncludeBuildNumberInPackageVersion>
<IncludeBuildNumberInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludeBuildNumberInPackageVersion>
<IncludeBuildNumberInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludeBuildNumberInPackageVersion>
<ProductVersionSuffix Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">-$(VersionSuffix)</ProductVersionSuffix>
<ProductBandVersion Condition="'$(ProductBandVersion)' == ''">$(MajorVersion).$(MinorVersion)</ProductBandVersion>
<ProductionVersion Condition="'$(ProductionVersion)' == ''">$(ProductBandVersion).$(PatchVersion)</ProductionVersion>
<ProductVersion>$(ProductionVersion)$(ProductVersionSuffix)</ProductVersion>

Yeah, .0 here was just the old, hard-to-find way the patch version was defined. Putting it in eng/Version.props makes it easier to rev versions to service the repo.

</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />

<PropertyGroup>
<ProductBandVersion>2.1</ProductBandVersion>
<PatchVersion>$(NETStandardPatchVersion)</PatchVersion>

<FrameworkListName>.NET Standard 2.1</FrameworkListName>
<FrameworkListTargetFrameworkIdentifier>.NETStandard</FrameworkListTargetFrameworkIdentifier>
<FrameworkListTargetFrameworkVersion>2.1</FrameworkListTargetFrameworkVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ public class NETCoreTests
[Fact]
public void NETCoreTargetingPackIsValid()
{
using (var tester = NuGetArtifactTester.Open(
using (var tester = NuGetArtifactTester.OpenOrNull(
dirs,
"Microsoft.NETCore.App.Ref"))
{
// Allow no targeting pack in case this is a servicing build.
// This condition should be tightened: https://github.com/dotnet/core-setup/issues/8830
if (tester == null)
{
return;
}

tester.IsTargetingPackForPlatform();
tester.HasOnlyTheseDataFiles(
"data/FrameworkList.xml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ public class NETStandardTests
[Fact]
public void NETStandardTargetingPackIsValid()
{
using (var tester = NuGetArtifactTester.Open(
using (var tester = NuGetArtifactTester.OpenOrNull(
dirs,
"NETStandard.Library.Ref"))
{
// Allow no targeting pack in case this is a servicing build.
// This condition should be tightened: https://github.com/dotnet/core-setup/issues/8830
if (tester == null)
{
return;
}

tester.HasOnlyTheseDataFiles(
"data/FrameworkList.xml",
"data/PackageOverrides.txt");
Expand Down