Skip to content

Commit

Permalink
[release/6.0] Add packaging changes for System.Text.Json (#61703)
Browse files Browse the repository at this point in the history
* [release/6.0] Add packaging changes for System.Text.Json

* Fix version calculation when using ServicingVersion for dependencies and current package

* Simplify version calculation for servicing

* Disable assembly validation for DirectoryServices as its version is pinned
  • Loading branch information
safern committed Nov 17, 2021
1 parent c1e9122 commit e9036b0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
18 changes: 15 additions & 3 deletions eng/packaging.targets
Expand Up @@ -39,9 +39,15 @@
<UseIntellisenseDocumentationFile Condition="'$(UseIntellisenseDocumentationFile)' == '' and Exists('$(LibIntellisenseDocumentationFilePath)')">true</UseIntellisenseDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(ServicingVersion)' != ''">
<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing'">
<!-- If no servicing version is set we need to default to 0 in order for dependency versions to
be calculated propertly, if we don't set it to 0, we would get the dependency version using the
product Patch Version -->
<ServicingVersion Condition="'$(ServicingVersion)' == ''">0</ServicingVersion>

<!-- Always update the package version in servicing. -->
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(ServicingVersion)</VersionPrefix>
<Version>$(MajorVersion).$(MinorVersion).$(ServicingVersion)</Version>
<Version Condition="'$(VersionSuffix)' != ''">$(Version)-$(VersionSuffix)</Version>
<_IsWindowsDesktopApp Condition="$(WindowsDesktopCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsWindowsDesktopApp>
<_IsAspNetCoreApp Condition="$(AspNetCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsAspNetCoreApp>
<_AssemblyInTargetingPack Condition="('$(IsNETCoreAppSrc)' == 'true' or '$(_IsAspNetCoreApp)' == 'true' or '$(_IsWindowsDesktopApp)' == 'true') and '$(TargetFrameworkIdentifier)' != '.NETFramework'">true</_AssemblyInTargetingPack>
Expand Down Expand Up @@ -267,9 +273,15 @@
</Target>

<Target Name="ValidateAssemblyVersionsInRefPack"
Condition="$(_AssemblyInTargetingPack) == 'true' and '$(PreReleaseVersionLabel)' == 'servicing'"
Condition="'$(SkipValidateAssemblyVersion)' != 'true' and '$(_AssemblyInTargetingPack)' == 'true' and '$(PreReleaseVersionLabel)' == 'servicing'"
AfterTargets="CoreCompile" >
<Error Condition="'$(AssemblyVersion)' != '$(LastReleasedStableAssemblyVersion)'" Text="AssemblyVersion should match last released assembly version $(LastReleasedStableAssemblyVersion)" />
</Target>

<Target Name="ValidateServicingVersionIsPropertlySet"
Condition="'$(PreReleaseVersionLabel)' == 'servicing'"
AfterTargets="GenerateNuspec">
<Error Condition="'$(ServicingVersion)' == '0'" Text="ServicingVersion is set to 0 and it should be an increment of the patch version from the last released package." />
</Target>

</Project>
3 changes: 3 additions & 0 deletions src/libraries/System.DirectoryServices/Directory.Build.props
Expand Up @@ -5,6 +5,9 @@
plan on shipping a new desktop version out of band. Instead add API
to a different assembly. -->
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<!-- Since this assembly version is pinned, we don't want to validate that it matches
the expected assembly version on the targeting pack. -->
<SkipValidateAssemblyVersion>true</SkipValidateAssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<SupportedOSPlatforms>windows</SupportedOSPlatforms>
</PropertyGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/System.Text.Json/src/System.Text.Json.csproj
Expand Up @@ -9,6 +9,8 @@
<Nullable>enable</Nullable>
<IncludeInternalObsoleteAttribute>true</IncludeInternalObsoleteAttribute>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>1</ServicingVersion>
<PackageDescription>Provides high-performance and low-allocating types that serialize objects to JavaScript Object Notation (JSON) text and deserialize JSON text to objects, with UTF-8 support built-in. Also provides types to read and write JSON text encoded as UTF-8, and to create an in-memory document object model (DOM), that is read-only, for random access of the JSON elements within a structured view of the data.

Commonly Used Types:
Expand Down

0 comments on commit e9036b0

Please sign in to comment.