Skip to content

Commit 600803b

Browse files
committed
User Story 37654: Create Abstractions package
- Removed obsolete ADO Library inclusion in CI variables. - Moved MDS CI versions numbers into CI variables. - Fixed Abstractions versioning to handle CI version format.
1 parent 865cfce commit 600803b

3 files changed

Lines changed: 47 additions & 34 deletions

File tree

eng/pipelines/dotnet-sqlclient-ci-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ stages:
165165
${{ if eq(parameters.referenceType, 'Package') }}:
166166
dependsOn:
167167
- build_abstractions_package_stage
168-
- build_nugets
168+
- build_mds_akv_packages_stage
169169

170170
prebuildSteps: # steps to run prior to building and running tests on each job
171171
- ${{if ne(parameters.SNIVersion, '')}}:

eng/pipelines/libraries/ci-build-variables.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
variables:
88
- group: 'ADO Build properties'
9-
- group: 'ADO CI Packaging'
109
- group: 'ADO Test Configuration Properties'
1110

1211
- name: buildNumber
@@ -16,11 +15,11 @@ variables:
1615
- name: SQLTarget
1716
value: 'localhost'
1817
- name: abstractionsPackageVersion
19-
value: 1.0.0.$(buildNumber)
18+
value: 1.0.0.$(buildNumber)-ci
2019
- name: akvPackageVersion
21-
value: 7.0.0.$(buildNumber)
20+
value: 7.0.0.$(buildNumber)-ci
2221
- name: mdsPackageVersion
23-
value: $(Major).$(Minor)$(Patch)-pull.1$(buildnumber)
22+
value: 7.0.0.$(buildNumber)-ci
2423
- name: skipComponentGovernanceDetection
2524
value: true
2625
- name: runCodesignValidationInjection

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

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,41 @@
88

99
<!-- Versioning Properties -->
1010
<PropertyGroup>
11-
<!-- The current Major version number for the Abstractions package. -->
12-
<AbstractionsPackageMajorVersion>1</AbstractionsPackageMajorVersion>
13-
1411
<!--
15-
If the Abstractions package version is specified on the command-line, then
16-
we use it as-is, for example:
17-
18-
msbuild -p:AbstractionsPackageVersion=1.0.0
19-
dotnet build -p:AbstractionsPackageVersion=1.0.0
20-
21-
Otherwise, we use a default value with a "-dev" suffix.
22-
23-
$(BuildNumber) is defined in tools/props/Versions.props.
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+
$(AbstractionsPackageMajorVersion).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+
$(AbstractionsPackageMajorVersion).0.0.$(BuildNumber).
2430
-->
25-
<AbstractionsPackageVersionSuffix Condition="'$(AbstractionsPackageVersion)' == ''">-dev</AbstractionsPackageVersionSuffix>
26-
<AbstractionsPackageVersion>$(AbstractionsPackageMajorVersion).0.0.$(BuildNumber)</AbstractionsPackageVersion>
2731

28-
<!--
29-
We pin the AssemblyVersion of our package to its current Major version
30-
number, with all remaining parts set to 0.
31-
-->
32-
<AbstractionsPackageAssemblyVersion>$(AbstractionsPackageMajorVersion).0.0.0</AbstractionsPackageAssemblyVersion>
32+
<!-- The default major version number. -->
33+
<DefaultMajorVersion>1</DefaultMajorVersion>
34+
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>
3346
</PropertyGroup>
3447

3548
<!-- Target Config -->
@@ -48,10 +61,15 @@
4861
<AssemblyName>Microsoft.Data.SqlClient.Extensions.Abstractions</AssemblyName>
4962
<RootNamespace>Microsoft.Data.SqlClient.Extensions.Abstractions</RootNamespace>
5063

51-
<AssemblyVersion>$(AbstractionsPackageAssemblyVersion)</AssemblyVersion>
52-
<AssemblyFileVersion>$(AbstractionsPackageVersion)</AssemblyFileVersion>
53-
<FileVersion>$(AssemblyFileVersion)</FileVersion>
54-
<Version>$(AbstractionsPackageVersion)$(AbstractionsPackageVersionSuffix)</Version>
64+
<!--
65+
We pin the AssemblyVersion of our package to the default major version
66+
number, with all remaining parts set to 0.
67+
-->
68+
<AssemblyVersion>$(DefaultMajorVersion).0.0.0</AssemblyVersion>
69+
70+
<AssemblyFileVersion>$(OurAssemblyFileVersion)</AssemblyFileVersion>
71+
<FileVersion>$(OurAssemblyFileVersion)</FileVersion>
72+
<Version>$(OurPackageVersion)</Version>
5573
</PropertyGroup>
5674
<ItemGroup>
5775
<!-- Our API is CLS Compliant. -->
@@ -69,12 +87,8 @@
6987
See: https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target
7088
-->
7189
<PropertyGroup>
72-
<!--
73-
We omit specifying <PackageId> here since it defaults to $(AssemblyName),
74-
specified above.
75-
-->
76-
77-
<PackageVersion>$(Version)</PackageVersion>
90+
<PackageId>$(AssemblyName)</PackageId>
91+
<PackageVersion>$(OurPackageVersion)</PackageVersion>
7892
<PackageOutputPath>$(PackagesDir)</PackageOutputPath>
7993
<IncludeSymbols>true</IncludeSymbols>
8094
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

0 commit comments

Comments
 (0)