Skip to content

Commit 4bbd001

Browse files
committed
Fixing Abstractions package version specification throughout the different builds.
1 parent 9e74341 commit 4bbd001

File tree

9 files changed

+113
-76
lines changed

9 files changed

+113
-76
lines changed

build.proj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,15 @@
110110
and cannot be overridden by the project.
111111
-->
112112
<AbstractionsProperties
113-
Condition="'$(AbstractionsPackageVersion)' != ''"
114-
>AbstractionsPackageVersion=$(AbstractionsPackageVersion)</AbstractionsProperties>
113+
Condition="'$(AbstractionsPackageVersion)' != ''">
114+
AbstractionsPackageVersion=$(AbstractionsPackageVersion)
115+
</AbstractionsProperties>
116+
117+
<!-- Do the same for the AbstractionsAssemblyFileVersion property. -->
118+
<AbstractionsProperties
119+
Condition="'$(AbstractionsAssemblyFileVersion)' != ''">
120+
$(AbstractionsProperties);AbstractionsAssemblyFileVersion=$(AbstractionsAssemblyFileVersion)
121+
</AbstractionsProperties>
115122
</PropertyGroup>
116123

117124
<Target Name="RestoreAbstractions">

src/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- Shared Dependencies -->
99

1010
<!-- Sibling Packages -->
11-
<ItemGroup Condition="$(ReferenceType) == 'Package'">
11+
<ItemGroup Condition="'$(ReferenceType)' == 'Package'">
1212
<PackageVersion
1313
Include="Microsoft.Data.SqlClient.Extensions.Abstractions"
1414
Version="$(AbstractionsPackageVersion)" />

src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,10 @@
44
<!--
55
Additional project config is imported from parent Directory.Build.props
66
files.
7-
-->
8-
9-
<!-- Versioning Properties -->
10-
<PropertyGroup>
11-
<!--
12-
We accept two external properties to control versioning:
13-
14-
AbstractionsPackageVersion:
15-
- Used as the NuGet package version, both in the package file name
16-
and in the package metadata.
17-
- Used as the base value of the assembly attribute
18-
'AssemblyInformationalVersion' generated by MSBuild.
19-
- If not specified, defaults to:
20-
$(DefaultMajorVersion).0.0.$(BuildNumber)-dev.
21-
22-
AbstractionsAssemblyFileVersion:
23-
- Used as the value of the assembly attribute 'AssemblyFileVersion'
24-
generated by MSBuild.
25-
- If not specified:
26-
- If $(AbstractionsPackageVersion) is specified, use the numeric
27-
parts of its value, for example 1.0.0.345.
28-
- Otherwise, defaults to:
29-
$(DefaultMajorVersion).0.0.$(BuildNumber).
30-
-->
31-
32-
<!-- The default major version number. -->
33-
<DefaultMajorVersion>1</DefaultMajorVersion>
347
35-
<!-- Determine the assembly file version. -->
36-
<!-- If AbstractionsAssemblyFileVersion is set, use its value as-is. -->
37-
<OurAssemblyFileVersion Condition="'$(AbstractionsAssemblyFileVersion)' != ''">$(AbstractionsAssemblyFileVersion)</OurAssemblyFileVersion>
38-
<!-- If AbstractionsPackageVersion is set, use its trimmed value. -->
39-
<OurAssemblyFileVersion Condition="'$(AbstractionsAssemblyFileVersion)' == '' and '$(AbstractionsPackageVersion)' != ''">$(AbstractionsPackageVersion.Split('-')[0])</OurAssemblyFileVersion>
40-
<!-- If neither property is set, use the default value.-->
41-
<OurAssemblyFileVersion Condition="'$(AbstractionsAssemblyFileVersion)' == '' and '$(AbstractionsPackageVersion)' == ''">$(DefaultMajorVersion).0.0.$(BuildNumber)</OurAssemblyFileVersion>
42-
43-
<!-- Determine the package version. -->
44-
<OurPackageVersion Condition="'$(AbstractionsPackageVersion)' != ''">$(AbstractionsPackageVersion)</OurPackageVersion>
45-
<OurPackageVersion Condition="'$(AbstractionsPackageVersion)' == ''">$(DefaultMajorVersion).0.0.$(BuildNumber)-dev</OurPackageVersion>
46-
</PropertyGroup>
8+
Abstractions versioning information found in our sibling file
9+
AbstractionsVersions.props is imported via tools/props/Versions.props.
10+
-->
4711

4812
<!-- Target Config -->
4913
<PropertyGroup>
@@ -65,11 +29,11 @@
6529
We pin the AssemblyVersion of our package to the default major version
6630
number, with all remaining parts set to 0.
6731
-->
68-
<AssemblyVersion>$(DefaultMajorVersion).0.0.0</AssemblyVersion>
32+
<AssemblyVersion>$(_DefaultMajorVersion).0.0.0</AssemblyVersion>
6933

70-
<AssemblyFileVersion>$(OurAssemblyFileVersion)</AssemblyFileVersion>
71-
<FileVersion>$(OurAssemblyFileVersion)</FileVersion>
72-
<Version>$(OurPackageVersion)</Version>
34+
<AssemblyFileVersion>$(AbstractionsAssemblyFileVersion)</AssemblyFileVersion>
35+
<FileVersion>$(AbstractionsAssemblyFileVersion)</FileVersion>
36+
<Version>$(AbstractionsPackageVersion)</Version>
7337
</PropertyGroup>
7438
<ItemGroup>
7539
<!-- Our API is CLS Compliant. -->
@@ -88,7 +52,7 @@
8852
-->
8953
<PropertyGroup>
9054
<PackageId>$(AssemblyName)</PackageId>
91-
<PackageVersion>$(OurPackageVersion)</PackageVersion>
55+
<PackageVersion>$(AbstractionsPackageVersion)</PackageVersion>
9256
<PackageOutputPath>$(PackagesDir)</PackageOutputPath>
9357
<IncludeSymbols>true</IncludeSymbols>
9458
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!--
5+
This file contains the Abstractions package version information. It is
6+
separate from the Abstractions .csproj file so these versions can be
7+
imported into the overall MDS build without including other project
8+
variables.
9+
10+
Private properties, not intended to be set or used externally, are prefixed
11+
with an underscore (_).
12+
-->
13+
14+
<!--
15+
This file uses the $(BuildNumber) property defined in
16+
tools/props/Versions.props.
17+
-->
18+
19+
<!-- Versioning Properties -->
20+
<PropertyGroup>
21+
<!--
22+
We accept two public properties to control versioning:
23+
24+
AbstractionsPackageVersion:
25+
- Used as the NuGet package version, both in the package file name
26+
and in the package metadata.
27+
- Used as the base value of the assembly attribute
28+
'AssemblyInformationalVersion' generated by MSBuild.
29+
- If not specified, defaults to:
30+
$(DefaultMajorVersion).0.0.$(BuildNumber)-dev.
31+
32+
AbstractionsAssemblyFileVersion:
33+
- Used as the value of the assembly attribute 'AssemblyFileVersion'
34+
generated by MSBuild.
35+
- If not specified:
36+
- If $(AbstractionsPackageVersion) is specified, use the numeric
37+
parts of its value, for example 1.0.0.345.
38+
- Otherwise, defaults to:
39+
$(DefaultMajorVersion).0.0.$(BuildNumber).
40+
41+
We use private properties to hold the computed values, and then always
42+
assign those to the public properties. After importing this file, the
43+
public properties will always be set.
44+
-->
45+
46+
<!-- The default major version number. -->
47+
<_DefaultMajorVersion>1</_DefaultMajorVersion>
48+
49+
<!-- Determine the package version. -->
50+
<_OurPackageVersion Condition="'$(AbstractionsPackageVersion)' != ''">$(AbstractionsPackageVersion)</_OurPackageVersion>
51+
<_OurPackageVersion Condition="'$(AbstractionsPackageVersion)' == ''">$(_DefaultMajorVersion).0.0.$(BuildNumber)-dev</_OurPackageVersion>
52+
53+
<!--Determine the assembly file version. -->
54+
<!-- If AbstractionsAssemblyFileVersion is set, use its value as-is. -->
55+
<_OurAssemblyFileVersion Condition="'$(AbstractionsAssemblyFileVersion)' != ''">$(AbstractionsAssemblyFileVersion)</_OurAssemblyFileVersion>
56+
<!-- If AbstractionsPackageVersion is set, use its trimmed value. -->
57+
<_OurAssemblyFileVersion Condition="'$(AbstractionsAssemblyFileVersion)' == '' and '$(AbstractionsPackageVersion)' != ''">$(AbstractionsPackageVersion.Split('-')[0])</_OurAssemblyFileVersion>
58+
<!-- If neither property is set, use the default value.-->
59+
<_OurAssemblyFileVersion Condition="'$(AbstractionsAssemblyFileVersion)' == '' and '$(AbstractionsPackageVersion)' == ''">$(_DefaultMajorVersion).0.0.$(BuildNumber)</_OurAssemblyFileVersion>
60+
61+
<!--
62+
Assign the public properties. This has no effect if they were
63+
specified on the command-line, in which case they are read-only.
64+
-->
65+
<AbstractionsPackageVersion>$(_OurPackageVersion)</AbstractionsPackageVersion>
66+
<AbstractionsAssemblyFileVersion>$(_OurAssemblyFileVersion)</AbstractionsAssemblyFileVersion>
67+
68+
</PropertyGroup>
69+
70+
</Project>

tools/props/Versions.props

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
<BuildNumber Condition="'$(BuildNumber)' == ''">0</BuildNumber>
77
</PropertyGroup>
88

9+
<!-- SqlServer Package Properties -->
10+
<PropertyGroup>
11+
<!-- This version section corresponds to version info of Microsoft.SqlServer.Server Assembly. -->
12+
<!-- Should only be changed in future when a non-backwards compatible driver is released. -->
13+
<!-- Future Assembly Version values shall be Major.Minor.0.0; e.g. 1.0.0.0 -->
14+
<SqlServerAssemblyVersion>1.0.0.0</SqlServerAssemblyVersion>
15+
<SqlServerAssemblyFileVersion Condition="'$(SqlServerAssemblyFileVersion)' == ''">1.0.0.0</SqlServerAssemblyFileVersion>
16+
<SqlServerPackageVersion Condition="'$(SqlServerPackageVersion)' == ''">1.0.0-dev</SqlServerPackageVersion>
17+
<SqlServerLibVersion>$(SqlServerPackageVersion)</SqlServerLibVersion>
18+
</PropertyGroup>
19+
20+
<!-- Abstractions Package Properties -->
21+
<Import Project="..\..\src\Microsoft.Data.SqlClient.Extensions\Abstractions\src\AbstractionsVersions.props" />
22+
923
<!-- MDS Package Properties -->
1024
<PropertyGroup>
1125
<MdsVersionDefault>7.0.0</MdsVersionDefault>
@@ -39,17 +53,6 @@
3953
<Version>$(MdsPackageVersion)</Version>
4054
</PropertyGroup>
4155

42-
<!-- SqlServer Package Properties -->
43-
<PropertyGroup>
44-
<!-- This version section corresponds to version info of Microsoft.SqlServer.Server Assembly. -->
45-
<!-- Should only be changed in future when a non-backwards compatible driver is released. -->
46-
<!-- Future Assembly Version values shall be Major.Minor.0.0; e.g. 1.0.0.0 -->
47-
<SqlServerAssemblyVersion>1.0.0.0</SqlServerAssemblyVersion>
48-
<SqlServerAssemblyFileVersion Condition="'$(SqlServerAssemblyFileVersion)' == ''">1.0.0.0</SqlServerAssemblyFileVersion>
49-
<SqlServerPackageVersion Condition="'$(SqlServerPackageVersion)' == ''">1.0.0-dev</SqlServerPackageVersion>
50-
<SqlServerLibVersion>$(SqlServerPackageVersion)</SqlServerLibVersion>
51-
</PropertyGroup>
52-
5356
<!-- AKV Package Properties -->
5457
<PropertyGroup>
5558
<AkvVersionDefault>7.0.0</AkvVersionDefault>

tools/specs/Microsoft.Data.SqlClient.nuspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<dependency id="Azure.Core" version="1.47.1" />
3333
<dependency id="Azure.Identity" version="1.14.2" />
3434
<dependency id="Microsoft.Bcl.Cryptography" version="8.0.0" />
35-
<dependency id="Microsoft.Data.SqlClient.Extensions.Abstractions" version="1.0.0" />
35+
<dependency id="Microsoft.Data.SqlClient.Extensions.Abstractions" version="$AbstractionsPackageVersion$" />
3636
<dependency id="Microsoft.Data.SqlClient.SNI" version="6.0.2" />
3737
<dependency id="Microsoft.Extensions.Caching.Memory" version="8.0.1" exclude="Compile" />
3838
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="7.7.1" />
@@ -49,7 +49,7 @@
4949
<dependency id="Azure.Core" version="1.47.1" />
5050
<dependency id="Azure.Identity" version="1.14.2" />
5151
<dependency id="Microsoft.Bcl.Cryptography" version="8.0.0" />
52-
<dependency id="Microsoft.Data.SqlClient.Extensions.Abstractions" version="1.0.0" />
52+
<dependency id="Microsoft.Data.SqlClient.Extensions.Abstractions" version="$AbstractionsPackageVersion$" />
5353
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="6.0.2" exclude="Compile" />
5454
<dependency id="Microsoft.Extensions.Caching.Memory" version="8.0.1" exclude="Compile" />
5555
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="7.7.1" />
@@ -64,7 +64,7 @@
6464
<dependency id="Azure.Core" version="1.47.1" />
6565
<dependency id="Azure.Identity" version="1.14.2" />
6666
<dependency id="Microsoft.Bcl.Cryptography" version="9.0.5" />
67-
<dependency id="Microsoft.Data.SqlClient.Extensions.Abstractions" version="1.0.0" />
67+
<dependency id="Microsoft.Data.SqlClient.Extensions.Abstractions" version="$AbstractionsPackageVersion$" />
6868
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="6.0.2" exclude="Compile" />
6969
<dependency id="Microsoft.Extensions.Caching.Memory" version="9.0.5" exclude="Compile" />
7070
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="7.7.1" />
@@ -79,7 +79,7 @@
7979
<dependency id="Azure.Core" version="1.47.1" />
8080
<dependency id="Azure.Identity" version="1.14.2" />
8181
<dependency id="Microsoft.Bcl.Cryptography" version="9.0.5" />
82-
<dependency id="Microsoft.Data.SqlClient.Extensions.Abstractions" version="1.0.0" />
82+
<dependency id="Microsoft.Data.SqlClient.Extensions.Abstractions" version="$AbstractionsPackageVersion$" />
8383
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="6.0.2" exclude="Compile" />
8484
<dependency id="Microsoft.Extensions.Caching.Memory" version="9.0.5" exclude="Compile" />
8585
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="7.7.1" />
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Target Name="GenerateMdsPackage" Condition="'$(GenerateNuget)' == 'true'">
4-
<PropertyGroup>
5-
<MdsPackageVersion Condition="'$(Configuration)' == 'Debug'">$(MdsPackageVersion)-debug</MdsPackageVersion>
6-
</PropertyGroup>
7-
<Message Text="Setting MdsPackageVersion to $(MdsPackageVersion)" />
84
<!-- Get the current commit id and store it in CommitId property to be used in nuget pack command -->
95
<Exec Command="git rev-parse HEAD" ConsoleToMSBuild="true">
106
<Output TaskParameter="ConsoleOutput" PropertyName="CommitId" />
117
</Exec>
128
<Message Text="Commit Id = $(CommitId)" />
139
<Exec Command="powershell.exe -NonInteractive -executionpolicy Unrestricted ^
1410
-command &quot;&amp;$(ToolsDir)scripts\downloadLatestNuget.ps1 -nugetDestPath '$(NuGetRoot)'&quot;" />
15-
<Exec Command="$(NuGetCmd) pack -Symbols -SymbolPackageFormat snupkg $(ToolsDir)specs\Microsoft.Data.SqlClient.nuspec -Version $(MdsPackageVersion) -OutputDirectory $(PackagesDir) -properties &quot;COMMITID=$(CommitId);Configuration=$(Configuration)&quot;" />
11+
<Exec Command="$(NuGetCmd) pack -Symbols -SymbolPackageFormat snupkg $(ToolsDir)specs\Microsoft.Data.SqlClient.nuspec -Version $(MdsPackageVersion) -OutputDirectory $(PackagesDir) -properties &quot;COMMITID=$(CommitId);Configuration=$(Configuration);AbstractionsPackageVersion=$(AbstractionsPackageVersion)&quot;" />
1612
</Target>
1713
</Project>

tools/targets/GenerateSqlServerPackage.targets

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Target Name="GenerateSqlServerPackage" Condition="'$(GenerateNuget)' == 'true'">
4-
<PropertyGroup>
5-
<SqlServerPackageVersion Condition="'$(Configuration)' == 'Debug'">$(SqlServerPackageVersion)-debug</SqlServerPackageVersion>
6-
</PropertyGroup>
7-
<Message Text="Setting SqlServerPackageVersion to $(SqlServerPackageVersion)" />
84
<!-- Get the current commit id and store it in CommitId property to be used in nuget pack command -->
95
<Exec Command="git rev-parse HEAD" ConsoleToMSBuild="true">
106
<Output TaskParameter="ConsoleOutput" PropertyName="CommitId" />
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Target Name="GenerateAkvPackage" Condition="'$(GenerateNuget)' == 'true'">
4-
<PropertyGroup>
5-
<AkvPackageVersion Condition="'$(Configuration)' == 'Debug'">$(AkvPackageVersion)-debug</AkvPackageVersion>
6-
</PropertyGroup>
7-
<Message Text="Setting AkvPackageVersion to $(AkvPackageVersion)" />
4+
<!-- Get the current commit id and store it in CommitId property to be used in nuget pack command -->
5+
<Exec Command="git rev-parse HEAD" ConsoleToMSBuild="true">
6+
<Output TaskParameter="ConsoleOutput" PropertyName="CommitId" />
7+
</Exec>
8+
<Message Text="Commit Id = $(CommitId)" />
89
<Exec Command="powershell.exe -NonInteractive -executionpolicy Unrestricted ^
910
-command &quot;&amp;$(ToolsDir)scripts\downloadLatestNuget.ps1 -nugetDestPath '$(NuGetRoot)'&quot;" />
10-
<Exec Command="$(NuGetCmd) pack $(ToolsDir)specs\add-ons\Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec -Version $(AkvPackageVersion) -Symbols -SymbolPackageFormat snupkg -OutputDirectory $(PackagesDir) -properties Configuration=$(Configuration);ReferenceType=$(ReferenceType)" />
11+
<Exec Command="$(NuGetCmd) pack $(ToolsDir)specs\add-ons\Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec -Version $(AkvPackageVersion) -Symbols -SymbolPackageFormat snupkg -OutputDirectory $(PackagesDir) -properties Configuration=$(Configuration);COMMITID=$(CommitId)" />
1112
</Target>
1213
</Project>

0 commit comments

Comments
 (0)