Skip to content

Commit 54701d8

Browse files
authored
Azure Split - Step 2 - New Files (dotnet#3904)
1 parent f2d1155 commit 54701d8

72 files changed

Lines changed: 5777 additions & 85 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ name: "CodeQL Advanced"
1313

1414
on:
1515
push:
16-
branches: [ "main", "feat/*" ]
16+
branches: [ "main", "feat/*", "dev/**/*" ]
1717
pull_request:
18-
branches: [ "main", "feat/*" ]
18+
branches: [ "main", "feat/*", "dev/**/*" ]
1919
schedule:
2020
- cron: '33 23 * * 6'
2121

BUILDGUIDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ The following build targets are defined in `build.proj`:
2929

3030
|Target|Description|
3131
|-|-|
32+
|`BuildAbstractions`|Restore, build, and pack the Abstractions package, publishing the resulting NuGet into `packages/`.|
3233
|`BuildAllConfigurations`|Default target. Builds the .NET Framework and .NET drivers for all target frameworks and operating systems.|
34+
|`BuildAzure`|Restore, build, and pack the Azure package, publishing the resulting NuGet into `packages/`.|
3335
|`BuildNetCore`|Builds the .NET driver for all target frameworks.|
3436
|`BuildNetCoreAllOS`|Builds the .NET driver for all target frameworks and operating systems.|
3537
|`BuildNetFx`|Builds the .NET Framework driver for all target frameworks.|
@@ -230,6 +232,8 @@ Then, you can specify `Package` references be used, for example:
230232

231233
```bash
232234
cp NuGet.config.local NuGet.config
235+
dotnet build -t:BuildAbstractions
236+
dotnet build -t:BuildAzure -p:ReferenceType=Package
233237
dotnet build -t:BuildAll -p:ReferenceType=Package
234238
dotnet build -t:BuildAKVNetCore -p:ReferenceType=Package
235239
dotnet build -t:GenerateMdsPackage

Directory.Packages.props

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,28 @@
77
<!-- ===================================================================== -->
88
<!-- Driver Packages -->
99

10+
<ItemGroup>
11+
<!--
12+
We never reference this package via its project, so we always need a
13+
version specified.
14+
-->
15+
<PackageVersion Include="Microsoft.SqlServer.Server" Version="1.0.0" />
16+
</ItemGroup>
17+
18+
<!--
19+
We only need other driver package versions specified when building via
20+
package references.
21+
-->
1022
<ItemGroup Condition="'$(ReferenceType)' == 'Package'">
1123
<PackageVersion
1224
Include="Microsoft.Data.SqlClient"
1325
Version="$(MdsPackageVersion)" />
26+
<PackageVersion
27+
Include="Microsoft.Data.SqlClient.Extensions.Abstractions"
28+
Version="$(AbstractionsPackageVersion)" />
29+
<PackageVersion
30+
Include="Microsoft.Data.SqlClient.Extensions.Azure"
31+
Version="$(AzurePackageVersion)" />
1432
<PackageVersion
1533
Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider"
1634
Version="$(AkvPackageVersion)" />
@@ -56,15 +74,24 @@
5674
</ItemGroup>
5775

5876
<!-- ===================================================================== -->
59-
<!-- MDS project dependencies -->
77+
<!-- MSS Dependencies -->
78+
79+
<!-- None -->
80+
81+
<!-- ===================================================================== -->
82+
<!-- Abstractions Dependencies -->
83+
84+
<!-- None -->
85+
86+
<!-- ===================================================================== -->
87+
<!-- MDS Dependencies -->
6088

6189
<ItemGroup>
6290
<PackageVersion Include="Azure.Identity" Version="1.17.0" />
6391
<PackageVersion Include="Microsoft.Data.SqlClient.SNI" Version="6.0.2" />
6492
<PackageVersion Include="Microsoft.Data.SqlClient.SNI.runtime" Version="6.0.2" />
6593
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
6694
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.14.0" />
67-
<PackageVersion Include="Microsoft.SqlServer.Server" Version="1.0.0" />
6895
<PackageVersion Include="System.Buffers" Version="4.6.1" />
6996
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="8.0.1" />
7097
<PackageVersion Include="System.Memory" Version="4.6.3" />
@@ -87,15 +114,14 @@
87114
</ItemGroup>
88115

89116
<!-- ===================================================================== -->
90-
<!-- AKV project dependencies -->
117+
<!-- Azure Dependencies -->
91118

92-
<ItemGroup>
93-
<PackageVersion Include="Azure.Security.KeyVault.Keys" Version="4.8.0" />
94-
</ItemGroup>
119+
<!-- None -->
95120

96121
<!-- ===================================================================== -->
97-
<!-- MSS project dependencies -->
98-
99-
<!-- None -->
122+
<!-- AKV Dependencies -->
100123

124+
<ItemGroup>
125+
<PackageVersion Include="Azure.Security.KeyVault.Keys" Version="4.8.0" />
126+
</ItemGroup>
101127
</Project>

build.proj

Lines changed: 93 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
<ItemGroup>
6767
<Tools Include="tools/GenAPI/Microsoft.DotNet.GenAPI/Microsoft.DotNet.GenAPI.csproj" />
6868
<SqlServerLib Include="**/Microsoft.SqlServer.Server.csproj" />
69+
<Abstractions Include="src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj" />
70+
<Azure Include="src/Microsoft.Data.SqlClient.Extensions/Azure/src/Azure.csproj" />
6971
<NetFxDriver Include="**/netfx/**/Microsoft.Data.SqlClient*.csproj" Condition="'$(IsEnabledWindows)' == 'true'" />
7072
<NetCoreDriver Include="**/netcore/**/Microsoft.Data.SqlClient*.csproj" />
7173
<!-- Used to build .NET Standard DLL for lib folder from this project. -->
@@ -103,20 +105,105 @@
103105
<Target Name="BuildTestsNetCore" DependsOnTargets="RestoreTestsNetCore;BuildAKVNetCore;BuildManualTestsNetCore"/>
104106
<Target Name="BuildTestsNetFx" DependsOnTargets="RestoreTestsNetFx;BuildAKVNetFx;BuildManualTestsNetFx" Condition="$(IsEnabledWindows) == 'true'"/>
105107

108+
<!-- Abstractions Targets -->
109+
<PropertyGroup>
110+
<AbstractionsProperties>$(CommonProperties)</AbstractionsProperties>
111+
112+
<!--
113+
If the AbstractionsPackageVersion property was supplied on the
114+
command-line, then pass it along to the Abstractions build. Otherwise,
115+
omit it entirely to avoid it expanding as empty here and thus overriding
116+
the default behaviour in the Abstractions project. Command-line
117+
properties take precedence over project defaults, even if their value is
118+
empty. For example:
119+
120+
dotnet build -p:AbstractionsPackageVersion=
121+
122+
That results in $(AbstractionsPackageVersion) being defined as empty,
123+
and cannot be overridden by the project.
124+
-->
125+
<AbstractionsProperties
126+
Condition="'$(AbstractionsPackageVersion)' != ''">
127+
$(AbstractionsProperties);AbstractionsPackageVersion=$(AbstractionsPackageVersion)
128+
</AbstractionsProperties>
129+
130+
<!-- Do the same for the AbstractionsAssemblyFileVersion property. -->
131+
<AbstractionsProperties
132+
Condition="'$(AbstractionsAssemblyFileVersion)' != ''">
133+
$(AbstractionsProperties);AbstractionsAssemblyFileVersion=$(AbstractionsAssemblyFileVersion)
134+
</AbstractionsProperties>
135+
</PropertyGroup>
136+
137+
<Target Name="RestoreAbstractions">
138+
<MSBuild
139+
Projects="@(Abstractions)"
140+
Targets="Restore"
141+
Properties="$(AbstractionsProperties)" />
142+
</Target>
143+
144+
<Target Name="BuildAbstractions" DependsOnTargets="RestoreAbstractions">
145+
<MSBuild
146+
Projects="@(Abstractions)"
147+
Targets="Build;Pack"
148+
Properties="$(AbstractionsProperties)" />
149+
</Target>
150+
151+
<!-- Azure Targets -->
152+
<PropertyGroup>
153+
<AzureProperties>$(CommonProperties)</AzureProperties>
154+
155+
<!--
156+
If the AzurePackageVersion property was supplied on the command-line, then
157+
pass it along to the Azure build. Otherwise, omit it entirely to avoid it
158+
expanding as empty here and thus overriding the default behaviour in the
159+
Azure project. Command-line properties take precedence over project
160+
defaults, even if their value is empty. For example:
161+
162+
dotnet build -p:AzurePackageVersion=
163+
164+
That results in $(AzurePackageVersion) being defined as empty, and cannot
165+
be overridden by the project.
166+
-->
167+
<AzureProperties
168+
Condition="'$(AzurePackageVersion)' != ''">
169+
$(AzureProperties);AzurePackageVersion=$(AzurePackageVersion)
170+
</AzureProperties>
171+
172+
<!-- Do the same for the AzureAssemblyFileVersion property. -->
173+
<AzureProperties
174+
Condition="'$(AzureAssemblyFileVersion)' != ''">
175+
$(AzureProperties);AzureAssemblyFileVersion=$(AzureAssemblyFileVersion)
176+
</AzureProperties>
177+
</PropertyGroup>
178+
179+
<Target Name="RestoreAzure">
180+
<MSBuild
181+
Projects="@(Azure)"
182+
Targets="Restore"
183+
Properties="$(AzureProperties)" />
184+
</Target>
185+
186+
<Target Name="BuildAzure" DependsOnTargets="RestoreAzure">
187+
<MSBuild
188+
Projects="@(Azure)"
189+
Targets="Build;Pack"
190+
Properties="$(AzureProperties)" />
191+
</Target>
192+
106193
<!-- Other Targets -->
107194
<Target Name="RestoreSqlServerLib">
108195
<MSBuild Projects="@(SqlServerLib)" Targets="restore" Properties="$(SqlServerLibProperties)" />
109196
</Target>
110197

111-
<Target Name="RestoreNetCore" DependsOnTargets="RestoreSqlServerLib">
198+
<Target Name="RestoreNetCore" DependsOnTargets="RestoreSqlServerLib;RestoreAbstractions">
112199
<MSBuild Projects="@(NetCoreDriver)" Targets="restore" Properties="$(ProjectProperties)" />
113200
</Target>
114201

115202
<Target Name="RestoreTestsNetCore" DependsOnTargets="RestoreNetCore">
116203
<MSBuild Projects="@(ManualTests)" Targets="restore" Properties="$(TestProjectProperties)" />
117204
</Target>
118205

119-
<Target Name="RestoreNetFx" DependsOnTargets="RestoreSqlServerLib" Condition="'$(IsEnabledWindows)' == 'true'">
206+
<Target Name="RestoreNetFx" DependsOnTargets="RestoreSqlServerLib;RestoreAbstractions" Condition="'$(IsEnabledWindows)' == 'true'">
120207
<MSBuild Projects="@(NetFxDriver)" Targets="restore" Properties="$(ProjectProperties)" />
121208
</Target>
122209

@@ -132,7 +219,7 @@
132219
<MSBuild Projects="@(Tools)" Properties="$(CommonProperties)" />
133220
</Target>
134221

135-
<Target Name="BuildNetFx" DependsOnTargets="RestoreNetFx;BuildSqlServerLib" Condition="'$(IsEnabledWindows)' == 'true'">
222+
<Target Name="BuildNetFx" DependsOnTargets="RestoreNetFx;BuildSqlServerLib;BuildAbstractions" Condition="'$(IsEnabledWindows)' == 'true'">
136223
<MSBuild Projects="@(NetFxDriver)" Properties="$(CI);Platform=AnyCPU;$(ProjectProperties);$(NugetPackProperties);" />
137224
</Target>
138225

@@ -149,11 +236,11 @@
149236
<MSBuild Projects="@(SqlServerLib)" Properties="$(CI);$(SqlServerLibProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))" />
150237
</Target>
151238

152-
<Target Name="BuildNetCore" DependsOnTargets="RestoreNetCore;BuildSqlServerLib">
239+
<Target Name="BuildNetCore" DependsOnTargets="RestoreNetCore;BuildSqlServerLib;BuildAbstractions">
153240
<MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);Platform=AnyCPU;$(ProjectProperties)" />
154241
</Target>
155242

156-
<Target Name="BuildNetCoreAllOS" DependsOnTargets="RestoreNetCore;BuildSqlServerLib">
243+
<Target Name="BuildNetCoreAllOS" DependsOnTargets="RestoreNetCore;BuildSqlServerLib;BuildAbstractions">
157244
<MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;" RemoveProperties="TargetsWindows;TargetsUnix;" />
158245
<MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT;" RemoveProperties="TargetsWindows;TargetsUnix;" Condition="'$(IsEnabledWindows)' == 'true'" />
159246
<MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;" RemoveProperties="TargetsWindows;TargetsUnix;" />
@@ -349,6 +436,7 @@
349436
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "bin", SearchOption.AllDirectories))' />
350437
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", ".nuget", SearchOption.AllDirectories))' />
351438
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "obj", SearchOption.AllDirectories))' />
439+
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".","packages", SearchOption.AllDirectories))' />
352440
</Target>
353441

354442
<!-- AKV Targets ========================================================= -->

eng/pipelines/common/templates/jobs/run-tests-package-reference-job.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,5 @@ jobs:
6767
parameters:
6868
referenceType: Package
6969
buildConfiguration: Release
70-
cleanFirst: true
7170
${{ if parameters.isPreview }}:
7271
mdsPackageVersion: $(previewMdsPackageVersion)

eng/pipelines/common/templates/steps/build-and-run-tests-netcore-step.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ parameters:
2828
type: string
2929
default: $(Platform)
3030

31-
- name: cleanFirst
32-
type: boolean
33-
default: false
34-
3531
- name: TestTargetOS
3632
type: string
3733
default: Windowsnetcoreapp
@@ -45,13 +41,6 @@ parameters:
4541
default: 2
4642

4743
steps:
48-
- ${{ if eq(parameters.cleanFirst, true)}}:
49-
- task: MSBuild@1
50-
displayName: 'Clean artifacts folder'
51-
inputs:
52-
solution: build.proj
53-
msbuildArguments: '-t:clean'
54-
5544
- task: MSBuild@1
5645
displayName: 'Build AKV Provider .NET'
5746
inputs:

eng/pipelines/common/templates/steps/build-and-run-tests-netfx-step.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ parameters:
2828
type: string
2929
default: $(Platform)
3030

31-
- name: cleanFirst
32-
type: boolean
33-
default: false
34-
3531
- name: TestTargetOS
3632
type: string
3733
default: Windowsnetfx
@@ -45,13 +41,6 @@ parameters:
4541
default: 2
4642

4743
steps:
48-
- ${{ if eq(parameters.cleanFirst, true)}}:
49-
- task: MSBuild@1
50-
displayName: 'Clean artifacts folder'
51-
inputs:
52-
solution: build.proj
53-
msbuildArguments: '-t:clean'
54-
5544
- task: MSBuild@1
5645
displayName: 'Build AKV Provider .NET Framework'
5746
inputs:

eng/pipelines/common/templates/steps/ci-project-build-step.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ steps:
7878
-p:GenerateDocumentationFile=false
7979
-p:BuildNumber=${{ parameters.buildNumber }}
8080
-p:MdsPackageVersion=${{ parameters.mdsPackageVersion }}
81-
clean: true
8281
8382
- ${{ if or(eq(parameters.build, 'MDS'), eq(parameters.build, 'all')) }}:
8483
- task: MSBuild@1
@@ -95,7 +94,6 @@ steps:
9594
-p:GenerateNuget=false
9695
-p:BuildNumber=${{ parameters.buildNumber }}
9796
-p:MdsPackageVersion=${{ parameters.mdsPackageVersion }}
98-
clean: true
9997

10098
- ${{ if or(eq(parameters.build, 'AKV'), eq(parameters.build, 'all'), eq(parameters.build, 'allNoDocs')) }}:
10199
- task: MSBuild@1

0 commit comments

Comments
 (0)